-
Notifications
You must be signed in to change notification settings - Fork 986
Description
Operating System
Android 14
Browser Version
React Native
Firebase SDK Version
10.10.0
Firebase SDK Product:
Auth, Firestore
Describe your project's tooling
Bare React Native
Describe the problem
When doing a fresh signInWithEmailAndPassword, the onAuthStateChanged fires and gives the user quickly, but after killing the app and starting again the persisted user takes 20-30secs to be returned, even on hot reloads. Has anyone experienced this issue as well. Please help, it's urgent.
Steps and code to reproduce issue
Listener:
onAuthStateChanged(auth, user => {
console.log(user);
if (user) {
setUser(user)
} else {
setUser(null);
}
});
Initialization:
const createFirebaseApp = () => {
let app;
let auth;
if (getApps().length === 0) {
app = initializeApp(config);
auth = initializeAuth(app, {
persistence: getReactNativePersistence(ReactNativeAsyncStorage)
});
} else {
app = getApp();
}
return { app, auth };
};
const { app, auth } = createFirebaseApp();
export const firestore = getFirestore(app);
export { auth };