0

I want to display a Facebook like button on my webpage. I am using plugin/likes.php Facebook script

I know user access_token. I want the like button to work without user authentication.

Is there a way to give access_token directly to like button ?

Thanks

testpresta
  • 429
  • 5
  • 15

1 Answers1

1

No, the like button login auth has nothing to do with you. When they try to like the object, Facebook will check to see if they are logged into Facebook in that current browser. Unless the user has authorized your application, what you are wanting to do is not possible.

However, if they have logged into your app, and you have the access_token, you can publish an Open Graph action of the built-in type like once they click that button. You can read about how to do that in these docs.

Tommy Crush
  • 2,790
  • 1
  • 15
  • 18
  • Is it possible to automatically logon user with access token and then invoke like button ? – testpresta Mar 02 '13 at 06:57
  • Your logic is flawed. Like I said, if you have the already have the `access_token` then the user is already logged into your app. And again, you cannot "invoke" the like button. You simply send an Open Graph action. Read these docs: https://developers.facebook.com/docs/technical-guides/opengraph/built-in-actions/likes/ – Tommy Crush Mar 02 '13 at 18:20
  • In fact, i am working on an android application. This application is working with the official Facebook SDK for android (3.0). There is no API for like button. If a put a like button in a WebView component, this WebView is not "connected" to the Facebook API. So this like button will ask a login/pass. This is why i want to authenticate user in the webview with access_token. – testpresta Mar 03 '13 at 14:33
  • Yes there is a way to put a like button in the App. You build a custom Like button interface, and when they click on it you publish an Open Graph action. – Tommy Crush Mar 03 '13 at 15:45
  • I tried to call "me/og.likes" or "me/likes" methods. But it does not work. First method gives me this error: "errorMessage: (#100) Like actions are not yet supported against objects of this type.". And second method gives me this error: "errorMessage: (#200) App does not have permission to make this call". – testpresta Mar 03 '13 at 18:22
  • me/likes is an endpoint that lists Pages the user likes. It has nothing to do with your app. Clearly, me/og.likes works, but the OG_OBJECT_URL parameter you are using is the problem. What is that url? The problem lies in what that URL is returning. If you are not comfortable posting that in the question, send it to me via chat. – Tommy Crush Mar 03 '13 at 19:18
  • The url is a Facebook page ("Create a Facebook Page") – testpresta Mar 03 '13 at 20:00
  • You need to read the documentation. You cannot "like" a page on Facebook. You can like a "Page", which is non-user account. But you cannot like just any page on facebook. It's not possible. – Tommy Crush Mar 03 '13 at 21:15
  • Strange because the classic like button can like a Facebook page... – testpresta Mar 03 '13 at 21:22
  • Open Graph actions but perform said action on an Open Graph object. These objects are taken from URL's that may or may not be publicly available online. The documentation is here: https://developers.facebook.com/docs/technical-guides/opengraph/defining-an-object/ – Tommy Crush Mar 03 '13 at 21:36
  • i have another solution is to forge a Facebook cookie from access_token and inject it in my webview. Do you know if it possible ? – testpresta Mar 03 '13 at 21:42
  • Forging Facebook cookies is against Terms of Service. – Tommy Crush Mar 03 '13 at 21:44