Reputation: 825
I am new with Facebook API. I use Facebook Android SDK in order to get the newsfeed of user using the facebook graph API.
In the emulator android: I use my own account, and everything went well: I can get the newsfeed and the paging next.
However, When I log in to another account which is a tester, I can retrieve data newsfeed only the first and second call of the facebook Graph API: https://graph.facebook.com/v2.0/me/home For the Third call, the return json data is empty
{
"data": [
]
}
Has anyone experience the same issue?
Upvotes: 3
Views: 1068
Reputation: 89
similiar to iOS refer answer to Access paging in Facebook - JSON previous and next link
You are getting blank as the access token might have expired or you accesing a page with no result, I faced this situation while coding in iOS and accessin the result in a web browser;
Page information has the current access token, and also depending up different limits restriction paging values and access token will change time to time , so; its best to use the url and fetch the result.
I am sure in Android we have methods to obtain data from URL
Result of next will also have pointer to both previous and next , best method to parse the result obtained is by calling it through a recursive function
Upvotes: 0
Reputation: 353
This is happening to me. I'm using a test group and querying /feed and I deleted several posts to test the API. What seems to be happening is that when you make an API call to retrieve a list of posts, facebook gets a list of the first 25 posts (or the limit you specified), including the deleted posts and also the ones that for some reason you don't have permission to see. But because I deleted the last 25 posts, a filter removes all of them leaving me with an empty response.
You can try to raise the limit to 500 include a querystring ?limit=500. I'm not sure what's the max number of posts you can retrieve, but if you use 500 you are probably getting all the posts you can in one call.
This behavior is documented here: https://developers.facebook.com/blog/post/478/
Upvotes: 0