Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native fbsdk login IOS white screen

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.

like image 601
Hakutsuru Avatar asked Oct 17 '22 16:10

Hakutsuru


1 Answers

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;
}
like image 102
Filip P. Avatar answered Oct 21 '22 05:10

Filip P.