Relative Content

Tag Archive for flutterfirebasegoogle-cloud-firestorefirebase-authentication

Firestore Error: Document Not Found Despite Read Permissions

I’m facing an issue with Firestore in my Flutter application. I’m trying to access a document in my “users” collection using the recipient’s userID, but I keep getting an error [cloud_firestore/not-found] Some requested document was not found. even though I’ve allowed read and write access in my Firestore rules.

How do I get a confirmation when the email is updated so that I can save the new email into Firebase Firestore?

I am updating my current login email using verifyBeforeUpdateEmail() function from firebase authentication, which successfully updates the email (in the Authentication) upon user verification of the email link received in their inbox. So my task is once that is done, I want to update my firebase firestore with the new email. How is this possible – as I only want to update the firestore only when the user has succesffully verified it.

The authStateChange is not updating the authentication state, unless I resart the app deugging session, causing previous user data to be displayed

I am using authStateChange as a stream in my Splash Screen to check for any changes in the authentication state of my app, but after signing out using Firebase Auth signOut build in function, when I sign in back with a different user, it still shows the data of the previous user, fetching it from the firestore. But when I hot restart the app debugging session, it starts displaying the data of the current signed in user. I have printed the user id many times in the StreamBuilder of the authStateChange, and unless I restart the app, it prints the previous users userID. What could be the issue that forces me to restart the app to get correct data?