Bug 36831 - iOS App Crashes after updating Facebook iOS SDK to 4.80
Summary: iOS App Crashes after updating Facebook iOS SDK to 4.80
Status: RESOLVED ANSWERED
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: N/A
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Israel Soto [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-12-10 15:50 UTC by Bharath Kumar P
Modified: 2015-12-16 02:44 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Bharath Kumar P 2015-12-10 15:50:09 UTC
Hello,

   I have been using the Facebook iOS SDK for sharing messages . Recently i updated the Xamarin as well as FACEBOOK IOS SDK to 4.80. After updating , the app crashes as soon as it opens. We removed the component and its related code and everything seems to work fine without the component. 

   Below are the exception which we found in the  device logs , which seems to be in internal methods of Facebook SDK :-
    1)[FBSDKInternalUtility checkRegisteredCanOpenURLScheme]
    2)[FBSDKMessageDialog initialize]

    I had done some  R&D and tried the below fixes which did not worked out.
    1)Added ATS for Whitelist (https://components.xamarin.com/gettingstarted/facebookios)
    2)Added LSApplicationQueriesSchemes keys (https://components.xamarin.com/gettingstarted/facebookios)


   Below are the details of environment in which we found the issue.

   Component name: FaceBook iOS SDK
   Updated Version : 4.80
   Updated date : Friday  4th Dec 2015
   Xcode Version : 7.2
   Xamarin Version : 5.10.1 (Build 6)
   iOS version : 9.2

   You can find the similar issue in this link (https://bugzilla.xamarin.com/show_bug.cgi?id=11041).

Thanks

 Thanks
Comment 2 Israel Soto [MSFT] 2015-12-16 02:44:48 UTC
Hi Bharath,

Based on your test case, adding the "Whitelist Facebook Servers for Network Requests":

```
<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>
```

and adding the "Whitelist Facebook Apps" for FB iOS v4.6 or later:

```
<key>LSApplicationQueriesSchemes</key>
<array>
        <string>fbapi</string>
        <string>fb-messenger-api</string>
        <string>fbauth2</string>
        <string>fbshareextension</string>
</array>
```

to the Info.plist, solved the problem. You need these permission so you can use FB iOS SDK on iOS 9.0 or later.

Warm regards,
Israel Soto.