在iOS 9下,我的UIWebview加载公司的Facebook页面只能将NSAllowsArbitraryLoads键设置为YES,否则会导致以下错误:
NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9802)
任何sugestions?
答案 0 :(得分:4)
打开您的Info.plist文件作为源代码,并确保“NSAppTransportSecurity”键看起来像这样(https://developers.facebook.com/docs/ios/ios9上的更多信息)
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>facebook.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>fbcdn.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>akamaihd.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>