import * as GoogleSignIn from 'expo-google-sign-in';
componentDidMount() {
this.initAsync();
}
initAsync = async () => {
await GoogleSignIn.initAsync({
// You may ommit the clientId when the firebase `googleServicesFile` is configured
//clientId: '<YOUR_IOS_CLIENT_ID>',
});
};
googleButtonOnPress = async () => {
try {
await GoogleSignIn.askForPlayServicesAsync();
const { type, user } = await GoogleSignIn.signInAsync();
if (type === 'success') {
// Google Login
}
} catch ({ message }) {
alert('login: Error:' + message);
}
}
Basically these are the source code that I used to implement the Google Login feature. It works totally fine for Android. However, for iOS, it works fine everytime the app is being started from fresh but it hits the error when I log out from the app (without killing the app) and log back in via Google login.