Google Sign in Expo SDK 32 (Managed App) - Not Works

Hi everybody thanks for your wonderful work, i have problems with Google Sign in on Expo SDK 32, and I am not the only one:
Google Sign in Expo 32 Issues

I found this article: https://blog.expo.io/react-native-google-sign-in-with-expo-d1707579a7ce, but that is only for Bare Expo App. The people on the first link above asking about if is possible to do Google Sign in on Expo Managed Apps, but there are no answers, they have closed the topic without a solution.

Here is my Error, is the same error for many guys:

The official documentation does not say anything about any limitation or bug regarding Google Sign in in Expo Managed Apps.

This guy say he reverting back to 31 Expo SDK Version so fixed it: https://forums.expo.dev/t/google-sign-in-broken-in-expo-32/19496/9?u=bomar24. I don’t know if should to do the same too, until you solve the problem.

I’ll waiting for a answer, please not close the topic, without a solution thanks.

Hi @bomar24,

To clarify- you’re testing this as a standalone Expo app, correct? As the docs state, it can’t be used in the Expo Client.

-Charlie

@charliecruzan I am working with this guide: https://docs.expo.io/versions/v32.0.0/sdk/google/, my project is managed not Bare.

My question is if you are testing in the Expo app or as a standalone app (for iOS, that would have to be through TestFlight)?

Yep I am testing with the Expo App on my iphone 6 :slight_smile: .

Great! Could you try following these steps:

  • Go to the Google Credentials Page
  • Create an app for your project if you haven’t already.
  • Once that’s done, click “Create Credentials” and then “OAuth client ID.”
  • Select “iOS Application” as the Application Type. Give it a name
  • Use host.exp.exponent as the bundle identifier.
  • Click “Create”
  • You will now see a modal with the client ID.
  • The client ID is used in the iosClientId option for Expo.Google.loginAsync (see below)
googleLogIn = async () => {
    try {
      const clientId = "<CLIENT-ID-HERE>";
      const { type, accessToken, user } = await Google.logInAsync({
        iosClientId: clientId,
        scopes: ["profile", "email"]
      });

      if (type === "success") {
        /* `accessToken` is now valid and can be used to get data from the Google API with HTTP requests */
      } else {
        return { cancelled: true };
      }
    } catch (e) {
      return { error: true };
    }
  };

thanks @charliecruzan! It seems that your example works at least further that just using the clientId. In current documentation, iosClientIdis deprecated and the guide says that you should use clientIdinstead. So maybe the problem is more about the current documentation than the code itself?

1 Like

Yeah, there’s an update coming to the docs- although it may need to be back ported to the earlier SDKs as well…

1 Like

Thanks @charliecruzan your solution works with SDK 32, i hope not downgrade the SDK to 31, really the docs should be updated to avoid waste time. thanks for your help.

Hey there, what is the solution for android? I get the same error there standalone and in the expo app (I am using the managed Expo)

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.