检查用户是否将操作添加到时间轴
我有一个包含文章的网站。当用户验证了应用程序并转到一篇文章时,它会在他们的个人资料/时间线上发布“X 已在 Z 上读取 Y”
这一切都很好,但如果他们回来几次,这种情况会发生几次,但我只想做一次。有什么想法吗?
如何检查用户是否已将某些内容添加到时间线?
I have a website with articles. When a user has authenticated an application and gone to an article, it posts that "X has read Y on Z" to their profile/timeline
This is all well and good but if they come back several times, this will happen several times but I just want it to be done once. Any ideas?
How do I check if a user has added something to the timeline already?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过自定义操作,您可以进入高级设置并使该操作唯一 - 这意味着它只能针对每个对象发布一次。
如果您尝试在同一对象上发布多个操作,则对 Graph API 的每个后续请求都将导致错误,并且不会存储任何操作。
内置 news.reads 操作已启用此属性。在《独立报》或《卫报》上,您只能“阅读”每篇文章一次。
目前无法通过 API 来查看用户是否拥有 .如果您想在不使用上述唯一性属性的情况下强制执行此操作,则需要将其存储在自己这边,并在发布到 Facebook 之前进行此检查。
With a custom action, you can go into the advanced setting and make the action unique - which means it can only be posted against each object once.
If you attempt to post multiple actions on the same object, each subsequent request to the Graph API will result in an error and no action will be stored.
The built-in news.reads action already has this property enabled. On The Independent or The Guardian, you can only 'read' each article once.
There is currently no way via the API to see if a user has an . If you want to enforce this without using the uniqueness property described above, you need to store this on your own side, and make this check before you post to Facebook.