Guest User

Untitled

a guest
Sep 14th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. // Register the callback for the Facebook authentication
  2. LoginManager.getInstance().registerCallback(callbackManager, object : FacebookCallback<LoginResult> {
  3. override fun onSuccess(result: LoginResult?) {
  4. Log.d(TAG, "Facebook token = ${result?.accessToken?.token}")
  5. toast("Access Token received")
  6. }
  7.  
  8. override fun onCancel() {
  9. Log.d(TAG, "Facebook authentication is cancelled")
  10. toast("Facebook Authentication is cancelled")
  11. }
  12.  
  13. override fun onError(error: FacebookException?) {
  14. Log.e(TAG, "Facebook Authentication failed: ${error?.message}")
  15. toast("Facebook Authentication failed: ${error?.message}")
  16. }
  17. })
Add Comment
Please, Sign In to add comment