Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Register the callback for the Facebook authentication
- LoginManager.getInstance().registerCallback(callbackManager, object : FacebookCallback<LoginResult> {
- override fun onSuccess(result: LoginResult?) {
- Log.d(TAG, "Facebook token = ${result?.accessToken?.token}")
- toast("Access Token received")
- }
- override fun onCancel() {
- Log.d(TAG, "Facebook authentication is cancelled")
- toast("Facebook Authentication is cancelled")
- }
- override fun onError(error: FacebookException?) {
- Log.e(TAG, "Facebook Authentication failed: ${error?.message}")
- toast("Facebook Authentication failed: ${error?.message}")
- }
- })
Add Comment
Please, Sign In to add comment