2015-11-05 83 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>