Firebase与FB SDK登录的冲突



我最近发现了一个更新,需要集成Firebase以进行崩溃报告分析,以及先前已实现的Facebook登录。我已经使用FBSDKloginButton实施了FB登录,并且起作用了。

但是,当我在appdelegate上取消[FIRApp configure]时,它会停止处理application:openURL:options:时,我对FB登录实现100%确定,我说如果我评论[FIRApp configure]

这是参考的代码:

- (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];
}

我们很快我们取消燃烧燃料配置方法,FB回电更改为以下backtrace:

- [viewController loginbutton:didCompleteWithResult:错误:]

- [fbsdkloginbutton _buttonpressed:] _ block_invoke

- [fbsdkloginmanager InvokeHandler:错误:]

- [FBSDKLOGINMANAGER(本机(handerimpliticcanceloflogin]

- [fbsdkapplicationdelegate applicationdidBecomeycomecomeTive:]

update

问题是 [FIRApp configure],因此请在情况下建议解决方案。

,也可以使用firebaseappdelegateproxy禁用它。在info.plist粘贴firebaseappdelegateproxyenabled具有值编号

请检查此。

在您的项目goto->信息中,您需要在URL类型中粘贴reversegoogle键,这可能就是您正在遇到的错误,只需将代码粘贴到AppDelegate

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation {
    if ([url.scheme hasPrefix:@"fb"]){
        return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                              openURL:url
                                                    sourceApplication:sourceApplication
                                                           annotation:annotation];
    }else{
        return [[GIDSignIn sharedInstance] handleURL:url
                                   sourceApplication:sourceApplication
                                          annotation:annotation];
    }
}

我不确定我的解决方案与OP如何相关,但是通过将其放入我的POD文件中,我的Facebook登录和Firebase之间的冲突已解决:

pod 'FBSDKCoreKit', '4.38.1'
pod 'FBSDKLoginKit', '4.38.1'

如下所述:https://github.com/facebook/facebook-swift-sdk/issues/298

相关内容

  • 没有找到相关文章

最新更新