Loggin in with expo-auth-session works absolutely fine in Expo Go App but as soon as .apk is built, the login workflow opens the signin page and then closes after the login is complete but the response vanishes and does not do anything, this happens only in .apk but works fine in Expo Go App.
const config = {
expoClientId: "some value",
iosClientId: "some value",
androidClientId: "some value",
};
const [user, setUser] = useState(null);
const [request, response, googlePromptLogin] = Google.useAuthRequest(config);
useEffect(() => {
if (response?.type === "success") {
async function SignIn() {
const credential = GoogleAuthProvider.credential(
null,
response.authentication.accessToken
);
await signInWithCredential(auth, credential);
}
SignIn();
}
else {
console.log("not logged in");
}
}, [response]);
useEffect(() => {
onAuthStateChanged(auth, (user) => {
if (user) {
setUser(user);
} else {
setUser(null);
}
});
}),
[];
// Button
<Button onPress={googlePromptLogin} title="Login"/>