Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

{Session state:OPENING, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[]}, appId:1xxxxxxxxxxx}

I want to implement Facebook Login in my application, but here I am getting problem while trying to login i.e :

**{Session state:OPENING, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[]}, appId:1xxxxxxxxxxxxxxx}**

and sometimes this one also:

  **{Session state:CLOSED, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[]}, appId:1xxxxxxxxxxxxxxx}**

Note: The above problem occurs when my device already has installed NATIVE FACEBOOK APP, if I uninstall the Facebook app it works absolutely fine. Can Anyone please help me out what the matter is ?

Thanks in advance

like image 687
Gaurav Arora Avatar asked Feb 18 '14 10:02

Gaurav Arora


3 Answers

Be sure to override in your Activity the onActivityResult method:

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {

    super.onActivityResult(requestCode, resultCode, data);

    Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);

}
like image 139
koma Avatar answered Oct 17 '22 22:10

koma


Try

AccessToken.getCurrentAccessToken().getToken();

instead of using the toString() function.

like image 5
bergjs Avatar answered Oct 17 '22 22:10

bergjs


I know this is an old ticket, but no one has appeared to give the correct answer. The token is removed from toString to prevent token exposure.

com.facebook.LoggingBehavior (from line 29):

/**
 * Indicates that access tokens should be logged as part of the request logging; normally they are not.
 */
INCLUDE_ACCESS_TOKENS,

com.facebook.AccessToken (from line 322):

private String tokenToString() {
    if (this.token == null) {
        return "null";
    } else if (Settings.isLoggingBehaviorEnabled(LoggingBehavior.INCLUDE_ACCESS_TOKENS)) {
        return this.token;
    } else {
        return "ACCESS_TOKEN_REMOVED";
    }
}

To show the token in toString requests simply add logging to the settings :

    Settings.addLoggingBehavior( LoggingBehavior.INCLUDE_ACCESS_TOKENS );
    this.mUiLifecycleHelper = new UiLifecycleHelper( this, this.mCallback );
    this.mUiLifecycleHelper.onCreate( savedInstanceState );

Hope this helps others with the same issue.

like image 2
James Lockhart Avatar answered Oct 17 '22 22:10

James Lockhart