1

I'm trying to set a "like" for a page object on facebook using their ios sdk.

Connecting is all working nicely, but when I submit my graph api call:

[[myDelegate facebook] requestWithGraphPath:@"PAGE_ID/likes" 
                       andParams:[NSMutableDictionary dictionaryWithObjectsAndKeys:
                       [[myDelegate facebook] accessToken],@"access_token",nil],
                       andHttpMethod:@"POST" andDelegate:myDelegate];

(Note that PAGE_ID is the valid id of the page I'm trying to like)

the request fails and the NSError contains the message.

"(#3) Application does not have the capability to make this API call." of type "OAuth exception"

The permissions I asked for when authorizing were "publish_stream" and "offline_access". Should those be what I need to like a page? Am i perhaps buggering up submitting my access token?

wallacer
  • 12,855
  • 3
  • 27
  • 45
  • This may be a duplicate of this http://stackoverflow.com/questions/5837010/facebook-api-liking-page-on-behalf-of-user-extended-permissions But i know apps that manage to like a page for a user, so it must be possible – wallacer Sep 01 '11 at 15:46

3 Answers3

4

It appears this functionality is not supported. According to this bug report, the status is "CLOSED WONTFIX" without any real explanation from Facebook on why they are not supporting this.

http://bugs.developers.facebook.net/show_bug.cgi?id=10714#c46

Joel
  • 15,654
  • 5
  • 37
  • 60
  • Ya I should've updated this with my own answer long ago. This is indeed not supported. Likely to avoid applications spamming likes. It would be nice if an application was allowed to like itself and only itself (its own application profile page) since that's all I was trying to do. – wallacer Mar 07 '12 at 00:15
  • I suspect if you could like yourself in code, many apps would instantly have a huge amount of bot generated likes. But I agree it would be nice to have the ability to legitimately do that. – Joel Mar 09 '12 at 17:53
  • well in order to give yourself a large number of bot generated likes you would have to have a large number of facebook accounts since there can only be one like per valid facebook account. – wallacer Apr 24 '12 at 16:08
  • Generating thousands of fb accounts is not that hard. People would do it. – Joel Apr 24 '12 at 18:45
  • 2
    You would need to generate the same number of emails, then follow the authentication links that facebook sends when you sign up (all thousands of them, each in their own email account), then have all the thousands of fb accounts set to like your app. Honestly, if all of that is so easy, it would be just as easy to have a bot sign into all of your facebook accounts and legitimately like your app. Your argument is flawed ;) – wallacer Apr 26 '12 at 21:14
2

Facebook just recently added this functionality. See http://developers.facebook.com/docs/opengraph/actions/builtin/likes/

Stan Kurdziel
  • 5,476
  • 1
  • 43
  • 42
  • Stan Kurdziel, the second paragraph of the page that you linked says that: "The og.likes action can refer to any open graph object or URL, **except for Facebook Pages** or Photos. – Emiliano Carlo Ricci Azpíroz Jul 24 '13 at 21:12
  • Yeah, after having used the API, it doesn't make sense. Liking facebook objects (pages, photos, etc) is *the* interesting application for an Open Graph like API. But as you mention they don't allow that. Not only that but the og.like button can't reference facebook or even a thumbs up! The app can't even query how many likes the OG object has! So you end up with a non-FB looking button that FB gets to track and not tell anyone about. I actually think the wires got crossed somewhere inside FB - I can't think of a valid useful application of this API as it stands now. – Stan Kurdziel Jul 30 '13 at 03:49
0

I am facing the same problem. I see that your asked permissons are right and i dont know anything about object c but looks like my ActinScript method...

I think (i read it in lot of pages and posts) that the API doesnt let you like a page, but you can like coments and other things with id, but i am afraid that liking pages is maybe not imposible but not easy...

melli-182
  • 1,216
  • 3
  • 16
  • 29