在iOS 9下,我的UIWebview加载公司的Facebook页面只有在NSAllowsArbitraryLoads键设置为YES的情况下才能工作,否则会导致以下错误:
NSURLSession/NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9802)
有什么建议吗?
发布于 2015-09-22 02:11:40
将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>https://stackoverflow.com/questions/32694820
复制相似问题