AppDelegate.m for both FBSDK and LinkingManager

前端 未结 3 1759
失恋的感觉
失恋的感觉 2021-02-20 05:24

To use FBSDK I need this snippet in app delegate

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url 
    sourceApplication:(NSString *)sourceA         


        
3条回答
  •  后悔当初
    2021-02-20 05:41

    For those who are using RNFirebase Linking:

    - (BOOL)application:(UIApplication *)application
    openURL:(NSURL *)url
    options:(NSDictionary *)options {
      
      BOOL handledFB = [[FBSDKApplicationDelegate sharedInstance]
                        application:application
                        openURL:url
                        sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
                        annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
      
      BOOL handledRCT = [RCTLinkingManager application:application openURL:url options:options];
    
      if (!handledRCT) {
          handledRCT = [[RNFirebaseLinks instance] application:application openURL:url options:options];
      }
    
      return handledFB || handledRCT;
    }
    

提交回复
热议问题