daily pastebin goal
40%
SHARE
TWEET

Patata

a guest Jan 29th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void handleFacebookAccessToken(AccessToken token) {
  2.     Log.d(TAG, "handleFacebookAccessToken:" + token);
  3.  
  4.     AuthCredential credential = FacebookAuthProvider.getCredential(token.getToken());
  5.     mAuth.signInWithCredential(credential)
  6.             .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
  7.                 @Override
  8.                 public void onComplete(@NonNull Task<AuthResult> task) {
  9.                     if (task.isSuccessful()) {
  10.                         // Sign in success, update UI with the signed-in user's information
  11.                         Log.d(TAG, "signInWithCredential:success");
  12.                         FirebaseUser user = mAuth.getCurrentUser();
  13.                         updateUI(user);
  14.                     } else {
  15.                         // If sign in fails, display a message to the user.
  16.                         Log.w(TAG, "signInWithCredential:failure", task.getException());
  17.                         Toast.makeText(FacebookLoginActivity.this, "Authentication failed.",
  18.                                 Toast.LENGTH_SHORT).show();
  19.                         updateUI(null);
  20.                     }
  21.  
  22.                     // ...
  23.                 }
  24.             });
  25. }
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top