Facebook profile pictures not showing in iOS 9 using FBSDKProfilePictureView

497 Views Asked by At

Since iOS 9 (beta), Facebook profile pictures are not shown inside a FBSDKProfilePictureView.

This message is printed to the log -

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

I guess this is because of Apple's new NSAppTransportSecurity, but adding an exempt for facebook.com domain doesn't help.

Any idea what exceptions should be added to make this work?

1

There are 1 best solutions below

0
Kof On BEST ANSWER

Turns out Facebook has a separate content provider with two extra domain names - akamaihd.net and akamai.net, they don't support TLSv1.2 and don't support forward secrecy.

Add this to your 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>