简体   繁体   中英

Quickblox login facebook Android

I search many on stackoverflow but don't get answer yet.

 loginButtonFb.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult loginResult) {
                QBUsers.signInUsingSocialProvider(QBProvider.FACEBOOK, facebookAccessToken, null, new QBEntityCallbackImpl<QBUser>() {
                @Override
                public void onSuccess(final QBUser user, Bundle args) {
                    ChatService.getInstance().login(user, new QBEntityCallbackImpl() {......................}

and it gets error:

Token is required

Can anyone give me some method to do this?

Add this before signIn:

facebookAccessToken = loginResult.getAccessToken();

This way you sign in using the facebook session. Hope it helps !

enter code here
AccessToken token = AccessToken.getCurrentAccessToken();
String fb_token=token.getToken();

After logging in through facebook Successfully put the following code to get the current access token of the user

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM