IOS10 ATS Configuration Detailed Introduction _ios

Source: Internet
Author: User

A little thought about iOS10 ATS configuration

ATS cannot restrict IP addresses

Suppose the API to invoke is/foo/bar/dosth

    1. If the server address is api.myserver.com, then http://api.myserver.com/foo/bar/doSth will be intercepted by the ATS because it is unsafe
    2. If the server address is 221.233.20.115:9090, then http://221.233.20.115:9090/foo/bar/doSth will not be intercepted by ATS, even if it is using the HTTP protocol
    3. This is in my other translation article Apple document translation iOS10 Nsapptransportsecurity also mentioned

Third-party SDK, also need to comply with ATS rules

That is, the third party SDK also has the risk of being filtered by ATS, currently known:

    1. Aurora
    2. Friends Union
    3. Baidu Map

Configuration examples

The following example makes the following configuration:

IOS10

    1. Web View can load any content (nsallowsarbitraryloadsinwebcontent)
    2. MyServer.com and all of its subdomains (for example, APIs and picture servers) can be accessed using HTTP connections
    3. MyServer.com and all of its subdomains can be accessed using HTTP connections (third-party SDK also needs to comply with ATS rules, so list all Third-party SDK domain names that still use HTTP requests and add them to exceptions)

IOS9

ATS completely shut down (nsallowsarbitraryloads)

  <key>NSAppTransportSecurity</key>
  <dict>
    <key>nsallowsarbitraryloads</key >
    <true/>
    <key>NSAllowsArbitraryLoadsInWebContent</key>
    <true/>
    <key>NSExceptionDomains</key>
    <dict>
      <key>myserver.com</key>
      < dict>
        <key>NSExceptionAllowsInsecureHTTPLoads</key>
        <true/>
        <key> nsincludessubdomains</key>
        <true/>
      </dict>
      <key>jpush.cn</key>
      <dict>
        <key>NSIncludesSubdomains</key>
        <true/>
        <key> nsexceptionallowsinsecurehttploads</key>
        <true/>
      </dict>
    </dict>
  </dict>

Thank you for reading, I hope to help you, thank you for your support for this site!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.