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
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);
}
Try
AccessToken.getCurrentAccessToken().getToken();
instead of using the toString() function.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With