0

Hi I have added firebase authentication system to my android app

Now i need to get Facebook token after successful login , i can get user DisplayName, Email , Phone , but not the token string that i need to store for further actions in my app .

I have tried

if (requestCode == RC_SIGN_IN) {
            IdpResponse response = IdpResponse.fromResultIntent(data);

            if (resultCode == RESULT_OK) {

                FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
                String fb_token = user.getToken(true).toString();

                // ...
            } 

but it seems that there is no getToken() method

So , how can i get the token as a string

thank you

AYMEN SOUMER
  • 175
  • 2
  • 8

1 Answers1

0

This question is similar to Android Studio - Get Firebase token from GetIdToken which has an answer to your question.

The FirebaseUser class has a getIdToken(boolean) method that returns a Task that can be used to get the token as a String.

https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser.html#getIdToken(boolean)