now I am learning flutter for chat app, I need to get currentUserEmail, now I have two ways to save currentUserEmail, a. save it in sharedPreference; b. always get it from FirebaseAuth
So here is my question:
thank you for any info in advance and keep safe!
Regarding reading data from your Firestore and whether it'll affect the cost of using Firebase, a similar question was answered there:
So a short answer is - yes, it may affect , but you can reduce the cost by implementing solutions from the linked articles.
Regarding saving the user's email in the preferences - yes, you can save it as long as the authentication in your application doesn't rely on the email address only. If you're using any Authentication service (such as Firebase Auth ), then changing email in the preferences won't cause any issues with user's authentication.
There is no need to cache the values of FirebaseAuth.instance.currentUser
in sharedPreference
yourself, as the Firebase SDK already caches this value for you. There is no cost for accessing FirebaseAuth.instance.currentUser
or any of its properties.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.