Google Signin in standalone app

#1

I keeps failing telling

Status{statusCode=DEVELOPER_ERROR, resolution=null}

I’ve searched for this issue and put sha1 to my firebase console
after getting keystore from expo server.

What should I do more?

#2

I think @janic might be able to help here.

#3

I’m having the same error. Peter says:
Google.loginAsync won’t work in standalone mode for the time being until serverId & schema both start working

How would I know if this got fixed?

#4

Hey @jordanmhart,

There is a fix for this that was merged in - you can now use WebBrowser to complete the oauth experience. You can pass in your own oauth url and use an javascript redirect to take you back to expo.

#5

Right, that is the work around you described to me in Slack? But is there still supposed to be a true fix to the problem imminently?

#6

Yeah. It should work in native too not web browser redirection… This kind of fix will make sourcode messy…

Also another problem with google login is in ios.
When you first login with google, it is ok.

However when you logout then try to login again, the app suddenly crashes.

#7

I agree with @dooboolab I have the same issues. Any update on this?

#8

Several topics on this here on GitHub and StackOverflow, but no solutions. I.E doesn’t work?

We depend on Google signin and will be unable to go to production without a fix.

Obviously double checked Google OAuth credentials and rebuilt.

      "ios": {
      "bundleIdentifier": "se...",
      "config": {
        "googleMapsApiKey": "AIzaSyARKW...tg8TDu-BqsfUoags",
        "googleSignIn": {
          "reservedClientId": "com.googleusercontent.apps.16...ons"
        }
      },
      "buildNumber": "1.0.0",
      "isRemoteJSEnabled": true,
      "supportsTablet": false,
      "associatedDomains": [
        "myDomain.com"
      ]
    },
    "android": {
      "package": "se......",
      "versionCode": 1,
      "config": {
        "googleSignIn":{
          "certificateHash": "1250CCD9...DE89FBEE7",
          "apiKey": "AIzaSyAnX4ln...wiqsZjFWeMaQ"
        },
        "googleMaps": {
          "apiKey": "AIzaSyARKW...8TDu-BqsfUoags"
        }
      },    "extra": {
      "google": {
        "maps": "AIzaSyARK...sfUoags",
        "webClientId": "16279835...47fkoi.apps.googleusercontent.com",
        "androidStandaloneAppClientId": "16279835...1o49ik7.apps.googleusercontent.com",
        "iosStandaloneAppClientId": "16279835...qbc15ukcbons.apps.googleusercontent.com",
        "androidClientId": "162798352...c5rg.apps.googleusercontent.com",
        "iosClientId": "16279835...ec2nn6a.apps.googleusercontent.com"
      }
    }
import { Google, Constants } from 'expo';
...
import { SaveByKey } from './StorageActions';

const config =
 Constants.appOwnerShip === 'standalone' ? {
   webClientId: Constants.manifest.extra.google.webClientId,
   androidStandaloneAppClientId: Constants.manifest.extra.google.androidStandaloneAppClientId,
   iosStandaloneAppClientId: Constants.manifest.extra.google.iosStandaloneAppClientId,
} :
{
  androidClientId: Constants.manifest.extra.google.androidClientId,
  iosClientId: Constants.manifest.extra.google.iosClientId,
  webClientId: Constants.manifest.extra.google.webClientId,
};

/**
 * The resulting user
 * @type {User}
 * @memberof GoogleActions
 */
let user = null;

/**
 * Login to Google and store user to AsyncStorage
 */
const GoogleLogin = () => async (dispatch) => {
  dispatch({ type: LOGIN_BUSY });

  try {
    const result = await Google.logInAsync(config);


#9

The issue looks a bit old :thinking: @tomcrusader what SDK are you using? Is this happening for all devices?

#10

This is on latest:

  • Expo 25.0.0
  • React-Native 0.53.3
#11

What OS does this happen for? Would it possible for you to provide some native logs? This would be probably easier when running Android.

#12

I have the same exact setup as @tomcrusader, all the OAuth IDs are valid (both Expo and standalone ones), I’ve triple checked. I also insert all of them inside the logInAsync function.

I’ve built the Android APK and installed it on a physical device and upon clicking the google sign in button, a crash occurs.

Here is the output of that crash.

W/dalvikvm(11714): threadid=1: thread exiting with uncaught exception (group=0x4c890160)
E/AndroidRuntime(11714): FATAL EXCEPTION: main
E/AndroidRuntime(11714): Process: <package>, PID: 11714
E/AndroidRuntime(11714): abi25_0_0.com.facebook.react.bridge.NoSuchKeyException: couldn't find key androidClientId in dynamic object
E/AndroidRuntime(11714):        at abi25_0_0.com.facebook.react.bridge.ReadableNativeMap.getString(Native Method)
E/AndroidRuntime(11714):        at abi25_0_0.host.exp.exponent.modules.api.GoogleModule$1.run(GoogleModule.java:79)
E/AndroidRuntime(11714):        at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime(11714):        at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(11714):        at android.os.Looper.loop(Looper.java:149)
E/AndroidRuntime(11714):        at android.app.ActivityThread.main(ActivityThread.java:5273)
E/AndroidRuntime(11714):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(11714):        at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(11714):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
E/AndroidRuntime(11714):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
E/AndroidRuntime(11714):        at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(  582):   Force finishing activity <package>/host.exp.exponent.experience.ShellAppActivity
  • Expo 25.0.0
  • React-Native 0.52.0

EDIT:
On a side note, Constants.appOwnerShip as used by @tomcrusader, in my case always results in ‘undefined’.

For that reason, I have only input the client IDs relevant for the standalone app and rebuilt it again after which I encountered the same crash with the same error.

#13

Hello I know that this question is probably stupid but how can I style my button like a google sign in?