Last night I made some changes, basically separating behavior from clientId entirely.
I made double sure that these DON’T change with environment. So even if you are in production mode (still in Expo though), logInAsync
will know to use the non-standalone clientIds (which have host.exp.exponent
as the package name). It shouldn’t depend at all on what behavior
you are using (which I didn’t figure out until my tests this morning). I’m using web
in all environments.
androidClientId: GOOGLE_CLIENTID_ANDROID_EXPO,
iosClientId: GOOGLE_CLIENTID_IOS_EXPO,
androidStandaloneAppClientId: GOOGLE_CLIENTID_ANDROID_STANDALONE,
iosStandaloneAppClientId: GOOGLE_CLIENTID_IOS_STANDALONE,
This morning I tested my expo android variant, and both expo and standalone ios variants. The expo variants are working (not giving 400 redirect_uri_mismatch
), but the standalone still isn’t.
I think what’s happening is that here the new wrapper code is only taking the non-standalone clientIds, because whoever wrote the wrapper thought (as I did for a while) that standalone and system
were one-to-one related. They aren’t. As a result, since system
behavior was deprecated in SDK 32, the developer thought to only grab the non-standalone clientIds. I’ll create an issue in the repo.
Workaround might be to provide your standalone clientId in the non-standalone parameter. Here’s what I’m doing:
try {
resp = await Expo.Google.logInAsync({
behavior: 'web',
scopes: [
'https://www.googleapis.com/auth/userinfo.email',
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/calendar',
'https://www.googleapis.com/auth/calendar.events',
],
androidClientId: Expo.Constants.appOwnership === 'standalone' ? GOOGLE_CLIENTID_ANDROID_STANDALONE : GOOGLE_CLIENTID_ANDROID_EXPO,
iosClientId: Expo.Constants.appOwnership === 'standalone' ? GOOGLE_CLIENTID_IOS_STANDALONE : GOOGLE_CLIENTID_IOS_EXPO,
androidStandaloneAppClientId: GOOGLE_CLIENTID_ANDROID_STANDALONE,
iosStandaloneAppClientId: GOOGLE_CLIENTID_IOS_STANDALONE,
webClientId: 'abc.apps.googleusercontent.com'
});
}