React native fbsdk login ios white screen

I have a problem using the official response-native-fbsdk package to login to facebook, it works well on Android, but on iOS, after the login has completed or canceled it, redirecting to a blank page instead of returning to my application.

What I've done:

  • Related reaction-native-fbsdk

  • The next iOS getting started guide on facebook page

Any help would be appreciated.

+4
source share
1 answer

You need to change AppDelegate.m file in ios project

Facebook-responsive-native faq

This issue indicates that the code in the AppDelegate.m file was not configured correctly. Make sure your code looks like 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;
}
+3

Source: https://habr.com/ru/post/1670257/


All Articles