FirebaseAuthentication.net package in Xamarin Forms – get current user UID

In my Xamarin.Forms project, I saw that the FirebaseAuthentication.Net package can be used for the cross-platform project. How would I get the current user's UID with this? I have figured out how to get the current user's email by saving the firebase refresh token and using NewtonSoft.JSON, but am not sure how to do this with the id.

Here's what I have so far:

var authProvider = new FirebaseAuthProvider(new FirebaseConfig(WebAPIKey));

var savedfirebaseauth = JsonConvert.DeserializeObject<Firebase.Auth.FirebaseAuth>(Preferences.Get("FirebaseRefreshToken", ""));
var RefreshedContent = await authProvider.RefreshAuthAsync(savedfirebaseauth);
Preferences.Set("FirebaseRefreshToken", JsonConvert.SerializeObject(RefreshedContent));
string UsersEmailToDisplay = savedfirebaseauth.User.Email;

Please let me know if any more clarification of my question is needed.



Read more here: https://stackoverflow.com/questions/66323317/firebaseauthentication-net-package-in-xamarin-forms-get-current-user-uid

Content Attribution

This content was originally published by ums2026 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: