0

I have fetched the facebook feeds using facebook graph api. I want to get comments count and likes count for each feed. I don't want to call another url to get comment count and like count for example, pass post id to fetch comment count and like count like following url: https://graph.facebook.com//comments?access_token=...

Please let me know if there is any way to get all facebook feeds including comments count and like count in single API call.

Thanks in advance.

Gagan Joshi
  • 3,347
  • 2
  • 21
  • 32

1 Answers1

0

You can use the FQL statement for fetching User Feed. I have an example of FQL, You can remove the things which you don't need from this FQL query (like conditions).

NSString *query =
    @"{'posts':'SELECT actor_id,post_id, created_time,likes,comment_info,attachment FROM stream WHERE filter_key IN (SELECT filter_key FROM stream_filter WHERE uid = me()) AND (attachment.fb_object_type=\"photo\" OR attachment.fb_object_type=\"video\" OR strpos(attachment.href, \"youtu\") >= 0) LIMIT 20','userinfo':'SELECT uid, name, pic_square FROM user WHERE uid IN (SELECT actor_id FROM #posts)','pageinfo':'SELECT name,page_id, pic_square FROM page WHERE page_id IN (SELECT  actor_id FROM  #posts)',}";

Hope that helps.

Rajan Balana
  • 3,775
  • 25
  • 42