com.facebook.FacebookAuthorizationException Java Examples
The following examples show how to use
com.facebook.FacebookAuthorizationException.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FBLoginInstance.java From ShareLoginPayUtil with Apache License 2.0 | 4 votes |
@Override public void doLogin(Activity activity, final LoginListener listener, boolean fetchUserInfo) { if (callbackManager == null) { ShareLogger.i(ShareLogger.INFO.LOGIN_ERROR); listener.loginFailure(new Exception(ShareLogger.INFO.LOGIN_ERROR), -1); LoginUtil.recycle(); return; } ShareLogger.i("fb doLogin"); LoginManager.getInstance().registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Override public void onSuccess(LoginResult loginResult) { AccessToken accessToken = loginResult.getAccessToken(); FacebookToken faceBookToken = new FacebookToken(accessToken); ShareLogger.i(ShareLogger.INFO.LOGIN_AUTH_SUCCESS); if (mFetchUserInfo) { mLoginListener.beforeFetchUserInfo(faceBookToken); fetchUserInfo(faceBookToken); } else { mLoginListener.loginSuccess(new LoginResultData(LoginPlatform.FACEBOOK, faceBookToken)); LoginUtil.recycle(); } } @Override public void onCancel() { mLoginListener.loginCancel(); LoginUtil.recycle(); } @Override public void onError(FacebookException error) { if (error instanceof FacebookAuthorizationException) { if (AccessToken.getCurrentAccessToken() != null) { LoginManager.getInstance().logOut(); } } mLoginListener.loginFailure(new Exception(error), 303); LoginUtil.recycle(); } }); LoginManager.getInstance().logInWithReadPermissions(activity, Arrays.asList("public_profile")); }
Example #2
Source File: FacebookSignUpActivity.java From socialmediasignup with MIT License | 4 votes |
@Override public void onError(FacebookException error) { handleError(error); if (error instanceof FacebookAuthorizationException) LoginManager.getInstance().logOut(); }