FB Open Graph 检查登入
我正在投票网站上实现一个简单的 Facebook“点赞”按钮,但想要一个选项,可以使用内部“点赞”系统为没有 Facebook 帐户/不想登录的任何人进行投票(这可能看起来就像一个奇怪的请求,但这是对客户的要求)。
所以基本上我想要一种无需使用图形 API 即可检测某人是否登录的方法 - 只需使用开放图形协议。有什么办法可以做到这一点吗?
I'm implementing a simple Facebook "Like" button on a voting site but want an option which votes using the internal "Like" system for anyone who doesn't have a Facebook account/doesn't want to log in (this may seem like an odd request but this is a requirement for the client).
So basically I'd like a way of detecting if someone is logged in without having to use the graph API - just using Open Graph Protocol. Is there any way of doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您订阅
auth.statusChange 事件,它可能会起作用,如此页面:
返回的
status
将包含connected
、notConnected
(已登录到 facebook,但未登录到您的应用)或unknown
。我不确定这是否会按计划进行,因为我自己还没有尝试过。它可能只会为过去授权过您的应用的用户返回
notConnected
状态,但这似乎是朝着正确方向迈出的一步。If you subscribe to
auth.statusChange
event, it might do the trick, as noted on this page:Returned
status
would contain eitherconnected
,notConnected
(logged in to facebook but not to your app) orunknown
.I am not sure if this would work as planned though as I haven't tried it myself. It might return
notConnected
status only for users that authorized your app in the past, but it seems like a step in the right direction.