Fan-Gate、Like-Gate、show-to-connections、带有 javascript 和 Like 框?
我的网站上有一个 facebook Likebox(不是 iframe 应用程序),我需要在其中创建门控内容。我了解使用edge.create和edge.remove的FB.Event.subscribe,但我真正需要的是知道用户是否已经喜欢该页面,而不仅仅是他们成为粉丝或不再是粉丝。有什么我可以看到的回调可能来自 xfbml.render 吗?
我(被我的公司)限制使用前端语言,这意味着 javascript 实际上是我目前唯一的选择。我很乐意使用“signed_request”选项,但据我所知,这似乎只能通过服务器端语言访问。
有什么方法可以让我仅使用 javascript 来确定某人是否已经“喜欢”某个页面?
I have a facebook likebox on my site (not an iframe app) where I need to create gated content. I understand the FB.Event.subscribe using edge.create and edge.remove but what I really need is to know if a user already likes the page not simply if they became a fan or stopped being a fan. Is there anything I can see as a callback maybe from the xfbml.render?
I am limited (by my company) to using front end languages, meaning javascript is really my only option at this point. I would gladly use the "signed_request" option but best I can tell that seems to be only accessible via server side languages.
Is there any way for me to determine whether someone already "Likes" a page using only javascript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,您可以使用 FB Javascript sdk 在 javascript 中完全完成此操作。
现在假设您已经让用户登录并拥有正确的权限。
Yes, you can do this completely in javascript using the FB Javascript sdk.
Now this is assuming that you already have the user logged in and have the correct permissions.
下面是一些额外的示例 javascript 代码,用于实现不需要 FB.api 调用的点赞门(但确实需要用户每次访问页面时重新点赞)。
http://linksy.me/viral-gate
Here is some additional sample javascript code for implementing a like gate that does not require the FB.api call (but does require the user to re-like every time they visit the page).
http://linksy.me/viral-gate