0👍
There should be two ways to solve your problem:
- You can use a plugin (for example
@capacitor-firebase/authentication
). This persists the state for you and firesonAuthStateChanged
on startup. - You can try to set
persistence
toindexedDBLocalPersistence
when initializing Firebase Authentication:
initializeAuth(firebaseApp, {
persistence: indexedDBLocalPersistence
});
Source:stackexchange.com