5

i am having problem using official react-native-fbsdk package for facebook login, it works well in android but in IOS after the login finished or cancelling it redirects to blank page instead of going back to my app.

What I have done :

  • Linked react-native-fbsdk

  • Followed IOS getting started guide in facebook page

any help will be appreciated.

4
  • I had the exact same issue. Works perfectly on android, but silently fails with white screen on iOS.
    – sheepdog
    Mar 21, 2017 at 8:20
  • Same here. Very annoying because even in XCode I'm not getting any error messages or useful information. Since it works in Android, I know the Javascript is correct & that it must be a mismatch between the react-native-fbsdk code & the Facebook SDK. I'm gonna try with one of the older versions of the Facebook SDK & maybe the old version of the react-native-fbsdk if none of those work. I'll let you know. Mar 22, 2017 at 12:34
  • Tried going backwards through the last 7 SDK versions & then tried rolling back to react-native-fbsdk 0.4.0 but same issue. Mar 22, 2017 at 12:56
  • I have the same problem, however, my AppDelegate.m is already as it is described in the answer below. Any other solutions of that problem?
    – Lucky_girl
    Mar 8, 2018 at 17:07

1 Answer 1

3

You need to modify your AppDelegate.m file in ios project

Facebook react-native faq

This problem indicates that the code in the AppDelegate.m file hasn't been setup properly. Confirm that your code is similar to this example:

AppDelegate.m
#import <FBSDKCoreKit/FBSDKCoreKit.h>
- (BOOL)application:(UIApplication *)application 
        didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    [[FBSDKApplicationDelegate sharedInstance] application:application
        didFinishLaunchingWithOptions:launchOptions];
    // Add any custom logic here.
    return YES;
}

- (BOOL)application:(UIApplication *)application 
        openURL:(NSURL *)url 
        sourceApplication:(NSString *)sourceApplication 
        annotation:(id)annotation {

    BOOL handled = [[FBSDKApplicationDelegate sharedInstance] 
        application:application
        openURL:url
        sourceApplication:sourceApplication
        annotation:annotation
    ];
    // Add any custom logic here.
    return handled;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.