I am trying to implement login through google and facebook in the app I’m working on, as far as the android studio emulator goes, it is working perfectly, login in on both facebook and google, however, once I built an apk and tried to run on mine and a co-worker’s android phone, google’s sign in wouldn’t work (though facebook’s still does).
I am not sure what to do, because it seems to be working perfectly as long as its not on a phone, has anyone had a similar problem? Maybe it’s a problem with the libvrary itself, but I hardly seem to find anyone using it.
Edit: The expo-google-app-auth was returning a problem “File ‘expo-module-scripts/tsconfig.base’ not found.”. I am trying to fix it now, may be that.
Btw, here’s the method of access
signInWithGoogle = async (callback) => {
try {
let created = new Date();
const result = await Google.logInAsync({
androidClientId: this.googleAuthAndroid,
scopes: ['profile', 'email'],
});
if (result.type === 'success') {
let logInValues = {
email: result.user.email,
familyName: result.user.familyName,
givenName: result.user.givenName,
id: result.user.id,
photoUrl: result.user.photoUrl,
accessToken: result.accessToken,
idToken: result.idToken,
refreshToken: result.refreshToken,
created: created.getFullYear() + "-" + (created.getMonth() + 1) + "-" + created.getDate() + " " +
created.getHours() + ":" + created.getMinutes() + ":" + created.getSeconds(),
}
fetch('http://' + this.cdm.getHost() + '/login/logInWithGoogle.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(logInValues)
})
.then(response => response.json())
.then(responseJson => {
console.log(responseJson);
callback(responseJson);
});
return result.accessToken;
} else {
return { cancelled: true };
}
} catch (e) {
console.log(e);
return { error: true };
}
}