f-miyu / Plugin.CloudFirestore

MIT License
121 stars 44 forks source link

Firebase.Auth #11

Open Midnayt opened 4 years ago

Midnayt commented 4 years ago

How we can use auth with this package?

AntvissMedia commented 4 years ago

If you authenticated the user prior to using this library, the Auth info will be sent to Firebase when performing an action in the database.

You can also use Auth information in the Firestore request like below (assuming you have a document with the USER ID as it's ID.

await CrossCloudFirestore.Current.Instance
        .GetCollection("myCollection")
        .GetDocument(CrossFirebaseAuth.Current.Instance.CurrentUser.Uid)
        .DeleteDocumentAsync();