I am trying to get a Firebase user's provider information (Email, Facebook, Twitter, etc). When I run FIRAuth.auth()?.currentUser.providerID
I get and output of Firebase
even when the user signs up with Twitter. When I run FIRAuth.auth()?.currentUser.providerData
I get [<FIRUserInfoImpl: 0x7a63e7f0>]
. How do I get an output of Facebook
or Twitter
?
Firebase Authentication provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app. It supports authentication using passwords, phone numbers, popular federated identity providers like Google, Facebook and Twitter, and more.
getIdToken ( forceRefresh ? : boolean ) : Promise < string > Returns a JSON Web Token (JWT) used to identify the user to a Firebase service. Returns the current token if it has not expired. Otherwise, this will refresh the token and return a new one.
If the user login with a custom "email/password" you don't know anything else about that user (apart from the unique user id). If a user login with Facebook, or with Google sign in, you can get other information like the profile picture url. It is explained here: firebase.google.com/docs/auth/android/… .
The user data for firebase authentication is stored in firebaseLocalStorageDb in IndexedDB .
if let providerData = FIRAuth.auth()?.currentUser?.providerData {
for item in providerData {
print("\(item.providerID)")
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With