For some reason 1onAuthStateChange1 wont detect the logged in user in my physical device (samsung) using expo app. It always responds with "user not logged in" Even though the user is visible in authentication user.
Current output: "User is not logged in", Expected output: "User is " + user.phoneNumber,
Any help would be appreciated!
code:-
const checkUser = (dispatch) => {
return () => {
firebase.auth().onAuthStateChanged((user) => {
if (user) {
console.log("User is " + user.phoneNumber);
RootNavigation.navigate("home");
} else {
console.log("User is not logged in");
RootNavigation.navigate("HomeRegistration");
}
});
};
};