Google-signin: IOS - After successful logging not redirecting back to app, so i can't get any response from user.

Created on 16 Aug 2017  路  3Comments  路  Source: react-native-google-signin/google-signin

Problem is only on IOS. On android everything works properly.

{
"react": "^16.0.0-alpha.6",
"react-native": "^0.43.0",
"react-native-google-signin": "^0.11.0",
}

Maybe this will help:
'sendAppEventWithName:body:' is deprecated: Subclass RCTEventEmitter instead

Question

Most helpful comment

Thanks @misuna1997 for your comment, it solved my problem!

To anybody else with the same problem: if you have enabled universal links/deep links support in your React Native app, Xcode may shout at you with an Duplicate declaration of method application:openURL:options: error. To fix that, replace your existing application:openURL:options method with the following:

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
            options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
  BOOL handled = [RNGoogleSignin application:application openURL:url sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];

  return handled || [RCTLinkingManager application:application openURL:url options:options];
}

All 3 comments

Finally, I found resolution:

Add this method in your AppDelegate.m

Thanks @misuna1997 for your comment, it solved my problem!

To anybody else with the same problem: if you have enabled universal links/deep links support in your React Native app, Xcode may shout at you with an Duplicate declaration of method application:openURL:options: error. To fix that, replace your existing application:openURL:options method with the following:

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
            options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
  BOOL handled = [RNGoogleSignin application:application openURL:url sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];

  return handled || [RCTLinkingManager application:application openURL:url options:options];
}

Original issue seems to be solved.
please check out the Example app for any further debugging.

Was this page helpful?
0 / 5 - 0 ratings