mcbeav
mcbeav

Reputation: 12275

Get User's News Feed Using Javascript SDK Graph API

I can't seem to find a concrete answer since the Facebook SDK and permissions have changed over time. I am trying to create a Facebook app for webOS. I would be using the Javascript Facebook SDK making graph API calls. The most important part is that I need to get the user's news feed ( The first thing you see when you login to facebook ). Is it possible to get the user's news feed once they log in to my facebook app using the graph API? All of the code I have tried doesn't error out, but it does not return any information.

FB.api( '/me', 'GET', {fields: 'feed.limit(10)'},function( response ){ 

    console.log( response );

});

Upvotes: 0

Views: 606

Answers (1)

andyrandy
andyrandy

Reputation: 73984

Without login, there is no access to ANY data of a user. And there is no way at all to get the feed, you can only get the user wall (his posts and posts of friends on his wall). You need to authorize users with the user_posts permission for that.

the API call: /me/feed?limit=10

with the JS SDK:

FB.api('/me/feed', 'GET', {limit: 10}, function(response) { 
    console.log( response );
});

Upvotes: 2

Related Questions