N
N
nikon2015-07-19 23:37:18
Android
nikon, 2015-07-19 23:37:18

Android Facebook SDK. Why is it giving AccessToken token:ACCESS_TOKEN_REMOVED permissions:[user_friends, contact_email, email, public_profile]?

I'm trying to authorize using Facebook + get a list of friends who use the application.
At first everything was ok, no bugs were observed, the code worked perfectly, I received a list of friends.
But a day later, the application fell off, and the application code did not change.
Now the application authorization is successful, the correct Token is returned (I check through the Graph API Exporer - requests to the Graph API are processed correctly).
But when outputting AccessToken.getCurrentAccessToken() - I see the following:

AccessToken token: ACCESS_TOKEN_REMOVED permissions:[user_friends, contact_email, email, public_profile]

Because of this, it is impossible to execute the code to get the list of friends:
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/me/friends",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
System.out.println( "COMPLETE" );
}
}
).executeAsync();

It simply does not work and no errors are displayed.
I don't understand what he wants.
What I tried:
* I checked all the application settings in FB
* I checked the correct generation and installation of KeyHash
* I checked the settings of the develop account (I registered KeyHash there)
Please tell me how can I fix it?
The authorization code itself:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if ( ! FacebookSdk.isInitialized())
{
FacebookSdk.sdkInitialize(getApplicationContext());
}
LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList( "public_profile", "user_friends", "email" ));
callbackManager = CallbackManager.Factory.create();
LoginManager.getInstance().registerCallback( callbackManager, new FacebookCallback() {
@Override
public void onSuccess(LoginResult loginResult)
{
if ( loginResult.getAccessToken() !
{
accessToken = loginResult.getAccessToken();
finish();
}
}
@Override
public void onCancel() {
System.out.println("Facebook: cancel");
}
@Override
public void onError(FacebookException e) {
System.out.println("Facebook: error");
}
});
setContentView(R.layout.activity_login);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
callbackManager.onActivityResult(requestCode, resultCode, data);
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question