Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React native linking with react native fbsdk #12877

Closed
jjdp opened this issue Mar 11, 2017 · 2 comments
Closed

React native linking with react native fbsdk #12877

jjdp opened this issue Mar 11, 2017 · 2 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@jjdp
Copy link

jjdp commented Mar 11, 2017

After debugging, I found out why my app isn't receving the deep links.

It's because of the fb code:

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

BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application
                                                            openURL:url
                                                  sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
                                                         annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
              ];
// Add any custom logic here.
return handled;
}

How do you suppose to combine these for the rn-linking code, since this is also required:

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

ghost commented Mar 12, 2017

What I did was used a if statement as follows:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

  NSString * scheme = (NSString*)url.scheme;
  NSString * fbScheme = @"fb123456789";
  
  if ([fbScheme isEqualToString:scheme]) {
    return [[FBSDKApplicationDelegate sharedInstance]
            application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
  } else {
    //Your other stuff here
  }
}

@jjdp jjdp closed this as completed Mar 13, 2017
@jslok
Copy link

jslok commented Oct 29, 2017

Including linking, RN fbsdk, and RN google-signin:

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

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants