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:
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?
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.