2015-11-05 82 views
2

错误:传输安全性已阻止明文HTTP(http://)资源加载,因为它不安全。临时例外可以通过您的应用程序的Info.plist文件进行配置。graph.facebook.com - 传输安全块

当试图访问graph.facebook.com/等 我已经把 NSAllowsArbitraryLoads上的plist
,但它一直在给这个错误。

任何解决方案,请?

编辑:我有这个,它不工作。相同的错误

<key>NSAppTransportSecurity</key> 
<dict> 
    <key>NSAllowsArbitraryLoads</key><true/> 
    <key>NSExceptionDomains</key> 
    <dict> 
     <key>facebook.com</key> 
     <dict> 
      <key>NSIncludesSubdomains</key> <true/> 
      <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> 
     </dict> 
     <key>fbcdn.net</key> 
     <dict> 
      <key>NSIncludesSubdomains</key> <true/> 
      <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> 
     </dict> 
     <key>akamaihd.net</key> 
     <dict> 
      <key>NSIncludesSubdomains</key> <true/> 
      <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> 
     </dict> 
    </dict> 
</dict> 
+2

请出示在上下文中的plist中的相关部分,并确认您已经修改了正确的plist。 – Paulw11

回答

1

您需要更新您的info.plist以包含更多的facebook.com条目。

Facebook iOS 9 Migration doc

<key>NSAppTransportSecurity</key> 
<dict> 
    <key>NSExceptionDomains</key> 
    <dict> 
     <key>facebook.com</key> 
     <dict> 
      <key>NSIncludesSubdomains</key> 
      <true/>     
      <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> 
      <false/> 
     </dict> 
     <key>fbcdn.net</key> 
     <dict> 
      <key>NSIncludesSubdomains</key> 
      <true/> 
      <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> 
      <false/> 
     </dict> 
     <key>akamaihd.net</key> 
     <dict> 
      <key>NSIncludesSubdomains</key> 
      <true/> 
      <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> 
      <false/> 
     </dict> 
    </dict> 
</dict>