错误信息:
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.
主要是在有第三方SDK在import后,这些SDK基本都是http连接,不符合苹果的HTTPS要求。
解决方法:
1是关闭https验证,2是添加例外。
都是右键打开info.plist,选择open as source code
。
1.关闭验证,添加代码:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
2.添加例外,稍微麻烦,而且要知道你的网络连接的域名:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>bmob.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>wtc.edu.cn</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>