iosobjective-cfacebookfirebasefbsdkloginkit

Firebase conflict with FB SDK Login


I am recently found one update that need to integrate Firebase for crash reporting analytics, along side previously implemented Facebook login. I have implemented FB login with FBSDKLoginButton, and works superb.

But when I uncomment [FIRApp configure] on appdelegate it stopping to handle application:openURL:options:, I am 100% sure about FB login implementation, As I said It works fine if I comments [FIRApp configure].

Here is the code for reference:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      BOOL b = [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
      [FIRApp configure]; //If I comment this, works fine with FB callback which handles at application:openURL:options:
      return b;
}

-(BOOL)application:(UIApplication *)app
       openURL:(NSURL *)url
       options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {

       BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:app
                                                              openURL:url
                                                    sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
                                                           annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
     return handled;
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
     [FBSDKAppEvents activateApp];
}

As soon we uncomment Firebase configuration method, FB Call back changes to following backtrace :

-[ViewController loginButton:didCompleteWithResult:error:]

-[FBSDKLoginButton _buttonPressed:]_block_invoke

-[FBSDKLoginManager invokeHandler:error:]

-[FBSDKLoginManager(Native) handleImplicitCancelOfLogIn]

-[FBSDKApplicationDelegate applicationDidBecomeActive:]

Update

The Problem is with [FIRApp configure], so please suggest solution where case same.


Solution

  • Or you can disable it with FirebaseAppDelegateProxy. In info.plist paste FirebaseAppDelegateProxyEnabled with value NO.