java - Facebook API 2.1 how to query and get the data output -
i trying id via facebook api 2.1
https://graph.facebook.com/v2.1/me&fields=id&access_token="+accesstoken
i error 200 no data.
does have illustration how , extract id, name, or info query 2.1?
that's because of me&field=id must me?field=id
https://graph.facebook.com/v2.1/me?fields=id&access_token=accesstoken
for public user info
https://graph.facebook.com/v2.1/me?access_token=accesstoken
i recommend utilize facebook sdk. see using graph api
example graph api me request facebook sdk:
new request( session.getactivesession(), "/me", null, httpmethod.get, new request.callback() { @override public void oncompleted(response response) { graphobject graphobject = response.getgraphobject(); if (graphobject != null) { if (graphobject.getproperty("id") != null) { string fbid = graphobject.getproperty("id").tostring(); string username = graphobject.getproperty("name").tostring(); } } } } ).executeasync();
java android facebook-graph-api-v2.0
No comments:
Post a Comment