Search code examples
facebookfacebook-graph-apifacebook-likefacebook-ios-sdk

Can I "like" a page with Facebook Graph API?


Possible Duplicate:
'Like' a page using facebook graph api

I want to let users sign-in with my iOS application, and click button to like a page.

But I don't use web-view that showing facebook fan page. I'm just have a button, and access token.

Users allow my app to have permissions "offline_access", "read_stream", "publish_stream".

And I read a document that there's a "/OBJECT_ID/likes" API to like an object. (https://developers.facebook.com/docs/reference/api/)

I tried to do that, but I can see only errors.

Error : The operation couldn’t be completed. (facebookErrDomain error 10000.)

What can I do? can I do this action? or else, should I show a web-view, and let user to push the "facebook like button" ?

One more question.

I want to like a post in written in a page that I didn't like via graph API.

Can I do that?


Solution

  • You can't like something via the Open Graph API: (not official source but you get the idea) http://blah.thetuttroom.com/you-cannot-programatically-like-something-usi. The link to the facebook forum seems to be down but its referenced in other places too.

    Second if you want to find out more about that error or other errors in the future look at this post: https://stackoverflow.com/a/6150251/540339