添加到时间轴插件的回调?
当用户访问我的网站并尝试允许publish_action权限时,他将点击'添加到时间线'插件按钮。
然后出现一个弹出对话框,用户将允许所需的权限。
我想知道的是,我们是否可以指定在用户允许权限后调用的任何回调函数。
我知道我们可以通过 FB.Event.subscribe 订阅“edge.create”事件,但我找不到“add-to-timeline”的类似解决方案。
至少,据我所知,它没有写在其文档中。
有人可以帮助我吗?
When a user comes to my website and tries to allow publish_action permission, he will click on the 'add-to-timeline' plugin button.
Then a popup dialog appears and user will allow the required permission.
What I want to find out is that if we can specify any callback function to invoke after user allows the permission.
I know we can subscribe to 'edge.create' event through FB.Event.subscribe, but I couldn't find a similar solution for 'add-to-timeline'.
At least, it wasn't written on its document as far as I read.
Can somebody help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以订阅全局事件来完成此任务。
如果您订阅 auth.login、auth.authResponseChange 或 auth.statusChange,它们将在用户通过 '< 授权您的应用程序后被调用a href="https://developers.facebook.com/docs/reference/plugins/add-to-timeline/" rel="nofollow">添加到时间线'。
因此,例如您可以这样做...
但是我猜您想要的与我想要的相同,即在用户第一次单击“添加到时间线”后将操作添加到时间线中,并且然后在后续访问您的网站时,只需将其自动添加到时间线中即可。
要做到这一点,你会这样做......
You can subscribe to the global events to accomplish this.
If you subscribe to auth.login, auth.authResponseChange, or auth.statusChange they will be called after the user authorized your application via 'add-to-timeline'.
So for example you could do this...
However I'm guessing what you want is the same thing that I wanted which is to have the action added to the timeline after the user clicks 'add-to-timeline' the first time and then on subsequent visits to your site just have it added to the timeline automatically.
To do that you would do this...