I am trying to run authentication using google with expo-google-app-auth package.
It works fine in ExpoGo . But after building the app in android, on pressing the login button it redirects to accounts/google and after i submit the gmail details, it doesn’t redirect to an app but google search page opens their itself.
What could be the issue? Please help.
Here is my code:-
const handleGoogleSignin = () => {
const config = {
androidClientId: [andriodClient ID],
androidStandaloneAppClientId:[standaloneAppClientID[,
scopes: ['profile', 'email'],
};
Google.logInAsync(config)
.then((result) => {
const { type, user } = result;
if (type == 'success') {
const { email, name, photoUrl } = user;
navigation.navigate('WelcomeScreen', { email, name, photoUrl });
} else {
console.log('Google Signin was cancelled');
}
})
.catch((error) => {
console.log(error);
});
};
In App.json,
"android": {
"package": "com.appname.project",
"config": {
"googleSignIn": {
"apiKey": "APIKEY",
"certificateHash": "CERTIFICATEHASH"
}
}
},