6

I try to fetch user's feeds via graph api from my Android application. It generally works but some feeds that I can see on the wall are missing in the json response.

I call the url http://graph.facebook.com/someUserId/feed, by using the Android Facebook SDK methods, so the access token should be provided automatically, but it's not really relevant I think in my case. Nevertheless fyi, the user of my app is authenticated via OAuth.

I already checked the following:

  • all the user's feeds are visible to everyone / public (set in privacy settings)
  • the json response is not cached by my browser
  • I am aware of paging, but this is not an issue. The problem is not that I am not getting the very oldest feeds but that some feeds are just missing in between.
  • I registered a new facebook user which is not connected to the user I want to retrieve the wall feeds from, and when I open the respective wall I see all the feeds there, as expected, since they're all public to everyone. Yet, when I open the same related json url unter http://graph.facebook.com/someUserId/feed, some feeds are missing.

This is an example of the problem - since all my posts are public, I can just call the json url directly in a browser to do a test.

I want to get wall feeds from user: http://www.facebook.com/mathias.lin

Screenshot1: note the 3 marked postings, all posted by myself

alt text

and here the json response, as you can see, the 1st and 3rd wall posts are included in the json, but the 2nd post is not. Why?

The related json url is: http://graph.facebook.com/mathias.lin/feed

alt text

I am getting the 'missing' feed when I add an access_token to the url - but why? The posted feed has a privacy setting for 'everyone'?!

This is the missing feed that I get when using the access_token:

{"id":"504063796_485195138796","from":{"name":"Mathias Lin","id":"504063796"},"message":"Photo test upload from Android","picture":"http:\/\/photos-e.ak.fbcdn.net\/hphotos-ak-snc6\/hs021.snc6\/165194_485195123796_504063796_6062399_1841907_s.jpg","link":"http:\/\/www.facebook.com\/photo.php?fbid=485195123796&set=a.485195118796.256450.504063796","name":"Torres Photos","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/yz\/r\/StEh3RhPvjk.gif","actions":[{"name":"Comment","link":"http:\/\/www.facebook.com\/504063796\/posts\/485195138796"},{"name":"Like","link":"http:\/\/www.facebook.com\/504063796\/posts\/485195138796"}],"privacy":{"description":"Everyone","value":"EVERYONE"},"type":"photo","created_time":"2011-01-06T05:10:43+0000","updated_time":"2011-01-06T09:00:23+0000","likes":6,"comments":{"data":[{"id":"504063796_485195138796_3607414","from":{"name":"Mathias Lin","id":"504063796"},"message":"Awesome, photo upload now works as well. Not so much fun working with the Facebook SDK for Android, would have expected more functionality beyond that just very very simple graph api wrapper. But need to be considered that the android sdk development was part of an internship - but since it's it's open source, it can luckily be modified. Which has to be done due to some bugs (mixing up the bundle parameters for a post, getString, getByteArray). Api documentation could be improved.","created_time":"2011-01-06T05:26:04+0000"},{"id":"504063796_485195138796_3608020","from":{"name":"Renate Hermanns","id":"628810487"},"message":"Wow
, how fast time passes by. Your daughter is nearly grown up ;-).","created_time":"2011-01-06T09:00:23+0000"}],"count":2},"attribution":"Torres"}

I've already posted the question to the FB dev forum, awaiting response.

Related threads:

http://forum.developers.facebook.net/viewtopic.php?id=81365

http://forum.developers.facebook.net/viewtopic.php?id=75984

Facebook Graph API "/userid/feed" returning Blank

Community
  • 1
  • 1
Mathias Conradt
  • 28,420
  • 21
  • 138
  • 192
  • 1
    I think you might find this answer useful - http://stackoverflow.com/questions/4617606/facebook-graph-api-does-not-return-all-feed-items-on-facebook-page/4622608#4622608. It's practically the same question. – Bartek Jan 07 '11 at 13:28
  • Thanks for the link! It's indeed interesting, although my case is slightly different, because all the posts incl. the one missing are all from me and on my own wall. I don't see what makes the 'missing' post different from the others. Afaik in the case you linked, all own posts by realplayer are shown, all foreign are hidden. But in my case, even my one own post is not displayed without the access_token. – Mathias Conradt Jan 07 '11 at 16:23
  • Ah, my bad, sorry - didn't notice that the missing post was also created by you. Strange, indeed. On a different note - I had a look at your wall and what I noticed is that the photo is not really a post - when you click on the time beneath each post you can find its ID, whereas the link below the photo takes you directly to the album. After analysing a few walls it seems to me that only photos are causing the problem you're experiencing – Bartek Jan 08 '11 at 00:14
  • Hi Mathias... I added an update to my question/answer... still can't figure it out. FQL isn't working for me. seems that FB just will not show some people's posts through the API... some uber-security setting that they have? wish I could figure it out – Nicholas Franceschina Jan 11 '11 at 03:56

3 Answers3

5

Your approach is correct, I've seen the JSON and yes it's missing the second one, I think it's upload app form adroid, try checking the application settings for this app. Or If your trying to retrieve the wall FQL is a much better way

SELECT post_id, actor_id, target_id, message FROM stream WHERE source_id in (SELECT target_id FROM connection WHERE source_id=<uid> AND is_following=1) AND is_hidden = 0 
Gerard Banasig
  • 1,703
  • 13
  • 20
  • Yes, the post was done via my Android application, but I'm not sure - which application settings should I check? I didn't find anything regarding privacy settings or whether to in/exclude feeds that have been posted via my app. Ok, I will also look into FQL, unfortunately this needs some custom implementation then again, since the Android Facebook SDK uses the regular graph api by default. – Mathias Conradt Jan 07 '11 at 05:00
  • btw: and the album where the photo is being posted (auto-created by the FB api) is set to privacy = Everyone – Mathias Conradt Jan 07 '11 at 05:36
  • 1
    With FQL I'm getting the feeds that were missed out by the regular graph api. Thanks for the hint. – Mathias Conradt Jan 07 '11 at 06:28
  • Ohh thats great, The andoid app settings should be in your applications and pages tab, Yes the albums created automatically by the app is public, I'm not sure is the same goes to wall feeds. – Gerard Banasig Jan 07 '11 at 08:01
  • Yes, I know where the app settings are, but there's nothing to configure. I noticed that when I add an access_token to the graph url, I get the 'missing' feed, which doesn't make much sense to me, since it's privacy is set to 'everyone'. – Mathias Conradt Jan 07 '11 at 09:05
0

I had a similar problem. But for me, the problem was related to not setting the scope properly on first login (to authorize the app). I posted a similar question and got an answer that worked for me here:

Facebook API how to get all wall items

Community
  • 1
  • 1
John
  • 32,403
  • 80
  • 251
  • 422
0

I've been through this, the way Facebook is categorizing their permissions is somehow misleading, for example Publicly available may sounds like Available to everyone on Facebook but apperantly it's not.

Now in your case, if you already authenticated the user, then try using:

/me/feed

I guess this is the only case where access_token is not needed in the URL.

ifaour
  • 38,035
  • 12
  • 72
  • 79
  • /me/feed would return only my own posts, I want to use any userId/feed. What I don't quite understand is that some feeds are returned and some not when I don't use any access_token, even though they all of them have the same privacy settings. But me/feed isn't the only case where you don't need an access token - just try to open http://graph.facebook.com/mathias.lin/feed in a browser - you will get my feeds (with some missing, for unknown reasons), right? – Mathias Conradt Jan 07 '11 at 11:03
  • no, what I'm saying..is if you follow the authentication process and have a valid session...would `/me/feed` returns all the feeds? I suppose it should, this is why *I guess* `/user_id/feed?access_token=xxx` = `/me/feed` – ifaour Jan 07 '11 at 11:26