Skip to content

Instantly share code, notes, and snippets.

@alfongj
Created June 3, 2016 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfongj/44bdab03de37224c44a274bfb35e7b6b to your computer and use it in GitHub Desktop.
Save alfongj/44bdab03de37224c44a274bfb35e7b6b to your computer and use it in GitHub Desktop.
FirebaseUser user = mAuth.getCurrentUser(); // mAuth is your current firebase auth instance
user.getToken(true).addOnCompleteListener(this, new OnCompleteListener<GetTokenResult>() {
@Override
public void onComplete(@NonNull Task<GetTokenResult> task) {
if (task.isSuccessful()) {
Log.d(TAG, "token=" + task.getResult().getToken());
} else {
Log.e(TAG, "exception=" +task.getException().toString());
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment