Getting Facebook timeline

352 views Asked by At

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

3

There are 3 answers

4
Tobi On BEST ANSWER

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)...

2
Kirit Modi On

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.

7
andyrandy On

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