Answer the question
In order to leave comments, you need to log in
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]
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/me/friends",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
System.out.println( "COMPLETE" );
}
}
).executeAsync();
@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 questionAsk a Question
731 491 924 answers to any question