Read Public Timeline from Facebook

2019-05-28 13:12发布

问题:

I am new on iOS Facebook sdk. I am using version version 3.1.1. I can reach my profile's information via sdk. But I am wondering How can I access and read from other user's public timeline? I search on web but I couldn't find anything. Thanks for answers

回答1:

All roads lead to Rome.

You can find other users' IDs by many ways on quite any API objects (likes and comments from photos and posts of friends or pages).

Example of a request that gets many users, from a Facebook page post:

https://graph.facebook.com/20531316728_107148006126775?fields=likes.fields(id)



回答2:

At Facebook, you have a USER_ID and an alias. You can get the alias by accessing their public profile. For example- https://www.facebook.com/shireesh.asthana which gives you the alias shireesh.asthana

Now you can get the actual User_Id by going to:

https://graph.facebook.com/shireesh.asthana

which gives you my User_id as 631951716

Now you can just do a GET request on 631951716/feed which will help you get the posts of that user(which of course you can see as a non friend).

Hope that helps!