Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Provider Data

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?

like image 512
Dan Levy Avatar asked Jun 18 '16 19:06

Dan Levy


People also ask

What is Firebase provider?

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.

What is getIdToken in Firebase?

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.

How can I get user details from Firebase?

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/… .

Where is Firebase auth data stored?

The user data for firebase authentication is stored in firebaseLocalStorageDb in IndexedDB .


1 Answers

    if let providerData = FIRAuth.auth()?.currentUser?.providerData {
        for item in providerData {
            print("\(item.providerID)")
        }
    }
like image 62
Christian Tuskes Avatar answered Sep 22 '22 12:09

Christian Tuskes