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
Post a Comment