0

I am fetching my timeline from Facebook and I successfully able to get my timeline but when I login with my friend's Facebook account I received the following error-

{
  "error": {
    "message": "(#200) Requires extended permission: read_stream", 
    "type": "OAuthException", 
    "code": 200
  }
}

I am the admin of the application on Facebook developer but my friend is not. I have already approved following permissions from Facebook(see attached screen shot)

enter image description here And below is the permission which I am using in my code-

FBSession* sess = [[FBSession alloc] initWithPermissions:[NSArray arrayWithObjects:@"public_profile",@"user_friends",@"user_birthday",@"email",@"user_education_history",@"user_work_history",@"user_hometown",@"read_stream",@"user_about_me",@"user_posts",@"publish_actions",nil]];

And here is the code to getting the timeline-

 NSString *urlStringFacebook = [NSString stringWithFormat:@"https://graph.facebook.com/me/home?format=json&&access_token=%@&&limit=90",[[FBSession activeSession] accessTokenData]];

If I submit the read_stream permission to Facebbok for review the reject it due to the following reason(see screenshot below)-

enter image description here

And one more thing when I login with my account they ask me to allow for news feed(read_stream) permission but when my friend login they don't ask for that permission.

When I try to get the same thing on Graph API explorer then the data comes fine. Please let me know what I am missing in the whole process. Thanks

andyrandy
  • 72,880
  • 8
  • 113
  • 130
Ravi Gautam
  • 960
  • 2
  • 9
  • 20

3 Answers3

2

You can get Home Timeline post using user_posts.

enter image description here

Using /me/feed you can get all post from others and you. go to Developer graph API Explorer Graph API Explorer.

Kirit Modi
  • 23,155
  • 15
  • 89
  • 112
  • But I didn't get any timeline feeds from non develper facebook. I have all these permission from facebook. – Ravi Gautam May 20 '15 at 09:25
  • Yes I agree, but I tested with /me/feed but this provides me the feeds which is posted by me or in which I tagged in and I need all feeds. – Ravi Gautam May 20 '15 at 10:09
2

You are trying to use /me/home, which needs read_stream as you can read in the docs: https://developers.facebook.com/docs/graph-api/reference/user/home

...and that permission will not get approved: https://developers.facebook.com/docs/facebook-login/permissions/v2.3#reference-read_stream

Use /me/posts or /me/feed instead, those endpoints need user_posts and you got that permission approved already: https://developers.facebook.com/docs/graph-api/reference/v2.3/user/feed

Btw, this is explained very well in the changelog: https://developers.facebook.com/docs/apps/changelog#v2_3_new_features

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • `/me/posts` only returns the user's own posts, right? I think `/me/feed` would be the right call. – Tobi May 20 '15 at 09:38
  • Yes this will return only post by me. – Ravi Gautam May 20 '15 at 09:41
  • oh, my mistake. will change it. i got confused, it´s still early...or so :) – andyrandy May 20 '15 at 09:50
  • Yes I agree, and I tested with /me/feed but this provides me the feeds which is posted by me or which posted on my wall but I need all feeds like home. – Ravi Gautam May 20 '15 at 10:09
  • 1
    that´s not possible anymore, for privacy reasons. as you can read in my answer, you would need read_stream for that, and you will not get it approved. – andyrandy May 20 '15 at 10:24
  • what about development of custom application embedded web browser that will login to FB like any web browser and strip down the HTML feed ? use http://jsoup.org/ to remove strip down data from HTML , might use apcahe common http lib to siumlate a browser behavior ? – Mohamed Magdy May 31 '15 at 13:32
  • please stick to your thread, no need to comment in several other threads with the same question. – andyrandy May 31 '15 at 13:43
1

Use /me/feed instead of /me/home, with the already granted user_posts permission this should work. This endpoint also returns other posts from the user's timeline, not only those from the user himself (/me/posts)...

Tobi
  • 31,405
  • 8
  • 58
  • 90
  • There is any difference between /me/home and /me/feed. As I run the command on graph explorer these both are giving me the different feeds. – Ravi Gautam May 20 '15 at 09:42
  • Yes, but you can't use `/me/home` without `read_stream` as outlined by @luschn. And as this permission is no longer granted, you need to fall back to `/me/feed` IMHO. There is no way to get the complete newsfeed via an App anymore. – Tobi May 20 '15 at 09:47
  • Tobi, I tested with /me/feed but this provides me the feeds which is posted by me or in which I tagged in. – Ravi Gautam May 20 '15 at 09:59
  • I know, that's what I wrote. `/me/home` is not an option anymore I guess because of the granting policy of the necessary permission `read_stream`: https://developers.facebook.com/docs/graph-api/reference/v2.3/user/home#readperms You will not be able to get the whole newsfeed anymore. – Tobi May 20 '15 at 10:31