React native how to implement deep link and fbsdk in IOS

I am trying to implement deep linking from React Native on IOS using this link here https://medium.com/react-native-training/deep-linking-your-react-native-app-d87c39a1ad5e however I am having problems with steps installing code in AppDelegate.m

. As part of the FBsdk integration, mine AppDelegate.m

has the following code

 - (BOOL)application:(UIApplication *)application
     openURL:(NSURL *)url
     sourceApplication:(NSString *)sourceApplication
     annotation:(id)annotation {
         return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                    openURL:url
                                          sourceApplication:sourceApplication
                                                 annotation:annotation];
 }

      

then I integrate with App Deep Link ( https://medium.com/react-native-training/deep-linking-your-react-native-app-d87c39a1ad5e ) then it asks to change the same function. Below is what Deep Link is as required by IOS for the above method

 - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
        sourceApplication:(NSString *)sourceApplication annotation:
        (id)annotation
 {
       return [RCTLinkingManager application:application openURL:url
                  sourceApplication:sourceApplication annotation:annotation];
 } 

      

So my question is how to combine these two functions

BOOL fbsdk = [[FBSDKApplicationDelegate sharedInstance] application:application
                                                    openURL:url
                                          sourceApplication:sourceApplication
                                                 annotation:annotation];
BOOL deeplink = [RCTLinkingManager application:application
                                     openURL:url
                           sourceApplication:sourceApplication
                                  annotation:annotation];
return fbsdk || deeplink;

      

Is this the correct answer? or I need to do something with the url that is returned fromNSString * scheme = (NSString*)url.scheme;

+3


source to share





All Articles