0

I'm trying to make a Graph API call on Facebook from Java (Android).

Here's the request

new Request(
        session,
        "/me/taggable_friends?fields=name,picture.type(normal)",
        null,
        HttpMethod.GET,
        new Request.Callback() {
            public void onCompleted(Response response) {

            }
        }
    ).executeAsync();

The first error is the following

07-13 18:23:19.871: Facebook Request(3884): {Response:  responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 2500, errorType: OAuthException, errorMessage: An active access token must be used to query information about the current user.}, isFromCache:false}

To resolve this error I put explicitly the access token on the request in this way

new Request(
        session,
        "/me/taggable_friends?fields=name,picture.type(normal)&access_token=" + session.getAccessToken(),
        null,
        HttpMethod.GET,
        new Request.Callback() {
            public void onCompleted(Response response) {
                /* handle the result */
                Log.d("Facebook Request Friends", response.toString());
            }
        }
    ).executeAsync();

and returns me this error

07-13 18:26:14.624: Facebook Request(4005): {Response:  responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 190, errorType: OAuthException, errorMessage: Malformed access token CAATukWchF0IBAEgpzi4aywNlkkieqVXbrshYhtx6mrrJiDxLIWOVI6623uA4x5ZBpwoTjyxWZArLgzHgF2nu9zZAwrnGx5kojCqWrvaj2HMPZCrqq2M2OH828IsZAxTRsdCQecJaH1mgCZBRls7BZASh96F9oDVKBdLrxqZAQkmFoFetGwCZABaXkT9jjIZD?access_token=CAATukWchF0IBAEgpzi4aywNlkkieqVXbrshYhtx6mrrJiDxLIWOVI6623uA4x5ZBpwoTjyxWZArLgzHgF2nu9zZAwrnGx5kojCqWrvaj2HMPZCrqq2M2OH828IsZAxTRsdCQecJaH1mgCZBRls7BZASh96F9oDVKBdLrxqZAQkmFoFetGwCZABaXkT9jjIZD}, isFromCache:false}

I have a malformed access_token but is taken from getAccessToken().

I don't understand why my access token is written twice in logcat as you can see. Like [ACCESS_TOKEN]?access_token=[ACCESS_TOKEN]??

I tried also to print in logcat the result of getAccessToken() and is correct.

Facebook app is configured, permissions are okay, and in Graph API Explorer works with the same access_token!

Does the access token can be specified in another way on the request?

I don't know how to resolve this issue, I hope you do.

Thanks in advice.

Giorgio
  • 41
  • 1
  • 5

0 Answers0