get facebook likes count in iphone-sdk

2019-03-02 16:59发布

问题:

I don't want to show Like button... I just want to get the Number of count that has been liked for particular link... Just Cont.. No like button No dialogue Nothing

回答1:

Just do a simple url request to the Graph API:

http://graph.facebook.com/[FULL URL]

Example:
http://graph.facebook.com/http://www.stackoverflow.com

Edit: (an example with "LIKES")
http://graph.facebook.com/http://www.imdb.com/title/tt0117500/

Awesome, isn't it?



回答2:

Just wanted to mention that if your URL has any question marks or ampersands in it, you will need to use a different notation:

http://graph.facebook.com/?id=[PROPERLY ENCODED FULL URL]

For example: http://graph.facebook.com/?id=http://mydomain.com/viewsomething.php%3Fid%3D2