ios9 - 使用 FBSDKProfilePictureView 在 iOS 9 中不显示 Facebook 个人资料图片

标签 ios9 facebook-sdk-4.x

自 iOS 9(测试版)以来,Facebook 个人资料图片不再显示在 FBSDKProfilePictureView 内。

此消息被打印到日志中 -

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

我猜这是因为 Apple 新的 NSAppTransportSecurity,但添加 facebook.com 域的豁免并没有帮助。

知道应该添加哪些异常(exception)才能使这项工作正常进行吗?

最佳答案

事实证明,Facebook 有一个单独的内容提供商,有两个额外的域名 - akamaihd.netakamai.net,他们不支持 TLSv1.2,也不支持t 支持前向保密。

将其添加到您的 Project-Info.plist -

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <false/>
    <key>NSExceptionDomains</key>
    <dict>
        <key>facebook.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSTemporaryExceptionMinimumTLSVersion</key>
            <string>1.1</string>
        </dict>
        <key>akamai.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSTemporaryExceptionMinimumTLSVersion</key>
            <string>1.1</string>
        </dict>
        <key>akamaihd.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSTemporaryExceptionMinimumTLSVersion</key>
            <string>1.1</string>
        </dict>
    </dict>
</dict>

关于ios9 - 使用 FBSDKProfilePictureView 在 iOS 9 中不显示 Facebook 个人资料图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31972024/

相关文章:

ios - supportedInterfaceOrientationsForWindow 返回 UIInterfaceOrientationMaskPortrait 但我的 View Controller 显示为横向

Android - 只有我可以看到从应用程序分享到 Facebook 的照片

android - Facebook 登录时未调用 onActivityResult

ios - 弃用 : 'sendAsynchronousRequest:queue:completionHandler:' in iOS9

ios - 打开功能后,iOS 9/10 中未收到 Apple 推送通知

ios - 条件绑定(bind)的初始化程序必须具有可选类型,而不是 'NSDictionary'

android - FB Analytics 推送 Activity - "Set up Your Push Campaigns"在实现后仍然存在

ios - SWIFT:在 performSegueWithIdentifier 之后未加载原型(prototype)单元格

ios - 操作无法完成。 (com.facebook.sdk.core 错误 3.)

android - 使用 Facebook android SDK ShareDialog。单击 shareddialog 的交叉按钮返回到带有 onSuccess 回调的应用程序