NSExceptionDomains xcode 8 not working

妖精的绣舞 提交于 2020-01-02 18:54:52

问题


I am using a UIWebView to show a email subscription sign up page. It is not a https:// page so I obviously need to make an exception. I don't want to set it to NSAllowsArbitraryLoads because it is only one page in the whole app and the app may get rejected. So I have used the code below in my info.plist file but I still get the error. Lots of stackoverflow answers point towards this code however I can't get it to work in xcode 8/ ios 10.

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

<key>NSExceptionDomains</key>
    <dict>
        <key>http://www.exampleurl.com</key>
        <dict>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <true/>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>

来源:https://stackoverflow.com/questions/40289712/nsexceptiondomains-xcode-8-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!