Android Studio - Get Firebase Token From GetIdToken


Answer :

Your second approach is close, you just need to use <GetTokenResult> instead of <UploadTask.TaskSnapshot> as that is for uploading images using Firebase Storage.

Try this:

user.getIdToken(true).addOnSuccessListener(new OnSuccessListener<GetTokenResult>() {   @Override   public void onSuccess(GetTokenResult result) {     String idToken = result.getToken();     //Do whatever     Log.d(TAG, "GetTokenResult result = " + idToken);   } }); 

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable