Liking a page on behalf of a user?
Asked Answered
B

4

8

I'm trying to get a user to 'Like' a page via the SDK. User is signed in and I get a valid access tokken form the cookie. My APP has asked for permissions read_stream and publish_stream. I can successfully do things like post to their wall, etc. But when my APP tries to 'Like' a page, I get the error back:

OAuthException: (#3) Application does not have the capability to make this API call.

Am I missing some other permission, or is there a setting I have to turn on in my APP? I'm at a loss here.

Bobbi answered 29/4, 2011 at 20:22 Comment(0)
B
23

You can't like a Page on behalf of a user (Bugzilla discussion). You can, however, like posts, comments, and photos on behalf of a user.


Edit 7/9/2012

Since bugzilla no long exists, the bug linked above is inaccessible. Google doesn't have a cached version of the page, so I ran another search. The best thing I could come up with was this Google Code Discussion regarding the ActionScript API.

Facebook makes brief mention of Publishing likes via the Graph API in the documentation, but doesn't say one way or another whether you can like a Page on behalf of a user - just "Objects" which (probably arguably) are not "objects" in Facebook-lingo.

My thought is, the API to like page is available, but is only offered to white listed applications (such as, the Facebook iOS and Android applications) written by "special" publishers. There's obvious reasons why Facebook wouldn't want/allow developers to create like connections on the graph. It would be taken advantage of by spammers and other nefarious developers and would deteriorate the meaning of what a "like" represents for a page on Facebook.

My guess is, you'd have to make a pretty strong case to Facebook about why you need/want access to the Page's Like connection (for publishing) before they'd even consider giving you access. I'd also guess that they'd want to verify that you're doing only user initiated like creations (in such a way that the iOS application would handle it) so as to protect the reptutation/meaning of a "like" action.

Borisborja answered 29/4, 2011 at 20:24 Comment(3)
haha, thank you facebook for killing off bugzilla ): ugh. let me see if i can find a more recent discussion link.Borisborja
@DarkXphenomenon: I added some more answer contextBorisborja
@JimRubenstein! Thanks for detailed explaination. as per your 3rd paragraph of answer!! Did u come across any solution or api to like facebook page of any app. I've native ios app integrated with facebook. their is official facebook page of that app, i want to like that page programmatically when user hits like button within app. here is my detailed question: #14932001Loydloydie
C
2

Actually this is NOT true, but you have to do a complicated Javascript / UIWebView process in order to display a Facebook 'page' of JUST the like button on your view, and this like button you can configure in the JavaScript / Objective-C (using string replacement) to be any Facebook page url you like.

Chirlin answered 15/11, 2011 at 14:34 Comment(0)
S
1

Facebook's platform policies don't allow for a web-based like button aside from using the officially supported options

Those options doesn't require using OAuth or the Open Graph api. However, facebook just added support for mobile apps to send like actions through opengraph.

I'm not sure if they intend to allow sites to customize their like buttons or just apps...

Sibie answered 26/6, 2012 at 18:47 Comment(0)
T
-1

Liking works for me with the iOS SDK using the graph api:

https://developers.facebook.com/docs/opengraph/actions/builtin/likes/

Touchy answered 5/9, 2012 at 23:10 Comment(1)
This does not work for Facebook Pages, that restriction is mentioned on that page: ` For Facebook Pages or websites that do not integrate with Facebook Authentication, developers should continue to use the Like button social plugin.`Mesencephalon

© 2022 - 2024 — McMap. All rights reserved.