Main Question:
When I sent a GET request to retrieve data of someID/POSTS, like
https://graph.facebook.com/microsoft/posts?fields=comments,likes&limit=1&access_token=
, cannot get the "count" in "likes" and "comments" fields using the access token generated by my own facebook registered app, but can get the expected data if using the access token from Facebook Sample apps, e.g. "HelloFacebookSample".
This issue occurs on both Android and FB Graph API Exploer. Also in oder to troubleshoot the possible causes, I used the exactly same codes as FB sample under my registered app_id, but the same problem came out again. So the only possible explanation I can think of is some strange things with FB app_id, not the permission scopes or different users(I've tested using two users).
Here is, the Reponses from GET request of https://graph.facebook.com/microsoft/posts?fields=likes&limit=1&access_token=
:
1.Using access_token generated by my app_id:
{
"data": [
{
"id": "20528438720_10151574758413721",
"created_time": "2013-07-18T18:41:51+0000",
"likes": {
"data": [
{
"id": "701134683",
"name": "Someone's name"
},
{
"id": "113770258795376",
"name": "Someone's name"
}
/****and so on****/
],
"paging": {
"cursors": {
"after": "MTAwMDAwNjkxNDMxMTcz",
"before": "NzAxMTM0Njgz"
},
"next": "https://graph.facebook.com/20528438720_10151574758413721/likes?limit=25&after=MTAwMDAwNjkxNDMxMTcz"
}
}
}
],
"paging": {
"previous": "https://graph.facebook.com/20528438720/posts?fields=likes&limit=1&since=1374172911",
"next": "https://graph.facebook.com/20528438720/posts?fields=likes&limit=1&until=1374172910"
}
}
2.Using access_token generated by FB's sample app_id(here it can get "count" of likes):
{
"data": [
{
"likes": {
"data": [
{
"name": "Someone's name",
"id": "100003531173993"
},
{
"name": "Someone's name",
"id": "100002299390558"
},
{
"name": "Someone's name",
"id": "1038509978"
},
{
"name": "Someone's name",
"id": "1615491698"
}
],
"count": 1071
},
"id": "20528438720_10151574758413721",
"created_time": "2013-07-18T18:41:51+0000"
}
],
"paging": {
"previous": "https://graph.facebook.com/20528438720/posts?fields=likes&limit=1&since=1374172911",
"next": "https://graph.facebook.com/20528438720/posts?fields=likes&limit=1&until=1374172910"
}
}
It really confused me for days, and I've done lots of searches, but cannot find any useful or related info perhaps due to my English:P. Did anyone else face the similar problems?
Thank you for reading.
Any help or alternative solution appreciated! (here, I just want to display the number of likes in my app)