Facebook 在发送操作发布请求时需要对象的 URL。现在,我的应用程序仅允许授权用户,我将用户重定向到登录页面,并将其重定向回用户请求的页面。
但是我如何区分 Facebook 尝试访问元标记(在发布时)或来 self 必须重定向的 Facebook 的用户?
最佳答案
您错过了 OpenGraph 背后的一些概念。所有对象都应该有一个可公开访问的代表页面。
引用Publishing Objects来自 Facebook's OpenGraph Objects 的部分文档:
Open Graph Objects are simply your web pages with Open Graph meta tags. Before you can publish an Open Graph object, you must define its corresponding object type in the Open Graph section of the Developer App. Once you have defined your object type in the tool, you must create a publicly accessible web page that represents your object using Open Graph metatags. We provide boilerplate metatags that you can use to create this web page in the Developer App (click the Get Code link next to your object definition). With these tags in place, you can publish actions that refer to your object.
When Facebook sees the first action applied to your object, we will scrape your page, read its meta tags and connect the user to your object, via the action. Every 7 days after the initial scrape of your object, we will attempt to re-scrape your object to keep the object data up to date.
关于facebook - 实现开放图的元标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9866380/