I am developing a react native expo project with firebase. I installed firebase with: "yarn add firebase" and when I import firebase/auth with OnAuthChanged I get the following error:
AsyncStorage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-async-storage/async-storage' instead of 'react-native'. See https://github.com/react-native-async-storage/async-storage
I understand that firebase is storing my credentials locally with async and it is outdated and thats why I get this error. Now when I try to get rid of this error by installing: "yarn add @react-native-async-storage/async-storage" and changing the dependencies in the index.js to the correct async-storage package (https://mcmap.net/q/345829/-how-to-remove-39-warning-async-storage-has-been-extracted-from-react-native-core-39) then my Warning dissapears.
The problem now is that my credentials are not saved, and onAuthChanges never triggers. I have to login each time I open my app.The correct version of async-storage is not saving my creds.
Any ideas on this one? :S
import { initializeApp } from 'firebase/app';
import { getAuth } from 'firebase/auth';
const firebaseConfig = {
...
};
const firebaseApp = initializeApp(firebaseConfig);
const auth = getAuth(firebaseApp);
onAuthStateChanged(auth, user => {userHandler(user)});