开发者

How to get thumbnail images from Facebook news feed using graph api?

开发者 https://www.devze.com 2023-03-04 02:50 出处:网络
I am getting facebook news feed in my iPhone application.But its not complete for some types of news feeds. If the type of news feed is \"photo\" i can\'t get thumbnail image.I tr开发者_如何学Cied by

I am getting facebook news feed in my iPhone application.But its not complete for some types of news feeds. If the type of news feed is "photo" i can't get thumbnail image.I tr开发者_如何学Cied by calling such url..

https://graph.facebook.com/801013079_144997952238328 where "801013079_144997952238328" is the news feed id.. But it was not returning a picture to show thumbnails..

Please help me to solve this problem.

Thanks in advance.


The news feed from graph itself isn't a photo. A simple way to do it is to parse the feed itself, get the picture url from the feed where the type=photo

To clear out some of the clutter you can add fields=type,object_id,picture

https://graph.facebook.com/me/home?access_token=youraccesstoken&fields=type,object_id,picture

Note that the object_id is the id of the news feed item. If you use graph to get the object id, you'll get a number of links to the image in various sizes, but if you really want the thumbnail, the picture value from the feed is just fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消