App Transport Security policy requires the use of

2020-04-24 17:17发布

问题:

I added the NsAppTransportSecurity as dictionary and added the key NsAllowArbitaryLoads exactly how everybody said but it does not work for me. I made a clean rebuild of the project, but I still the same error.

回答1:

It should be done like this

NSAppTransportSecurity <- Type Dictionary NSAllowsArbitraryLoads <- Type Boolean Value YES



回答2:

It should be done like:

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>your.domain.name.net</key>
            <dict>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
        </dict>
    </dict>