Create Protected User Directories in Firebase Cloud Firestore

preview_player
Показать описание
Integrate Firebase Authentication and Firebase Cloud Firestore Database to create partitions of user data in that are protected bu Firebase Auth. In previous videos, I set up and configured Firebase Auth and Firebase Cloud Firestore Database in our Jetpack Compose Android App with Kotlin. In this video, I create a User data class that stores a uid from FirebaseUser, then I create a collection called users in Firebase Cloud Firestore. That collection holds our objects of our User data class, which are keyed by the Firebase Auth uid for each user. Under that user document, I store user-specific data. I add authentication rules to the Firebase Cloud Firestore, so that users can only access data in their own private directories. I adjust the save and listen functions in the MainViewModel to save and listen to data in user directories exclusively. I also do quite a bit of null checking.

Рекомендации по теме