I am trying to achieve the following: Read comments on an specific feed
I have:
- Create an app account
- Create test users (temporary facebook account)
- On login I have ask/grant all permissions for that users
Then, I have add a feed with "User A" by doing the following:
//Execute login
function myFacebookLogin() {
FB.login(function(){}, {scope: 'public_profile,user_friends,email,user_about_me,user_actions.books,user_actions.fitness,user_actions.music,user_actions.news,user_actions.video,user_birthday,user_education_history,user_events,user_games_activity,user_hometown,user_likes,user_location,user_managed_groups,user_photos,user_posts,user_relationships,user_relationship_details,user_religion_politics,user_tagged_places,user_videos,user_website,user_work_history,read_custom_friendlists,read_insights,read_audience_network_insights,read_page_mailboxes,manage_pages,publish_pages,publish_actions,rsvp_event,pages_show_list,pages_manage_cta,pages_manage_leads,ads_read,ads_management'});
}
//Then Post feed
function postOnWall() {
FB.api(
'/me/feed',
'post',
{message: 'Hello, world!'},
function (response) {
console.log(response);
//object id: 111040869259526_111040872592859
}
);
}
Once I did this I get the object_id code for it. Using facebook add a comment and then check it with "User A" by:
//Execute login
function getComments() {
FB.api(
"/111040869259526_111040872592859/comments", //object_id is hardcoded
function (response) {
if (response && !response.error) {
console.log(response);
} else {
console.log(response);
}
}
);
}
As a result I have get the comment on a json response. My problem now, is when trying to read the comments by using another user account. Let's say I logged in with other test account "User B" (Also all privileges granted) and execute the same code to getComments. The result is an empty array
Do you have any idea on what could I be doing wrong?