samedi 28 mars 2015

Facebook Android SDK 4.0: newGraphPathRequest returns "An active access token must be used to query information about the current user."

I've upgraded to Facebook Android SDK 4.0. I'm trying to request a graph path:



AccessToken token = AccessToken.getCurrentAccessToken();
GraphRequest req = GraphRequest.newGraphPathRequest(token,
"me?fields=name,picture.width(400).height(400)",
new GraphRequest.Callback() { ... });


I've stepped over the code and I verify that token is a perfectly valid access token, I've copied and debugged it in Graph API Explorer and it's valid. I also tried to request the exact same path by copy pasting me?fields=name,picture.width(400).height(400) into Graph API Explorer, using the same token, and it works.


However, when I execute the request:



req.executeAsync();


I'm getting this error in the completion handler:



{"error":{"type":"OAuthException","message":"An active access token must be
used to query information about the current user.","code":2500}}


What am I doing wrong?


Aucun commentaire:

Enregistrer un commentaire