检查页面或个人资料上是否安装了画布应用程序

发布于 2024-12-05 03:04:51 字数 1539 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

倒数 2024-12-12 03:04:51

我最近编写了一个应用程序,可以将其作为页面选项卡添加到用户的页面。因此,现在每当有人在用户页面中单击我的应用程序的选项卡时,该应用程序都会获取一个 signed_request 作为 $_POST 参数。它包含大量可以使用的有用信息,例如用户 id 字段、包含页面 id 的页面字段和一些布尔字段来指示用户是否喜欢该页面,或者用户是否是管理员,以及一些更多领域。 (请参阅我提到的链接)。
然后我只是从所述 signed_request 中解码并提取不同的字段。因此,您可能应该做同样的事情,并查明用户或页面是否正在访问应用程序。
我提到的 Facebook 文档中给出了示例代码,其链接位于本答案的末尾.
据我所知,Facebook 总是将此 signed_request 发送到用户访问的任何应用程序,因此您始终可以解析它。
希望这对您有帮助,如果您想要我的代码,请发表评论,我将用代码跟进:)。
您可以参考有关 signed_request 的 Facebook 文档 此处

i recently wrote an app, which can be added to a user's page, as a page tab. So now whenever someone clicks the tab for my app, in the user's page, the app gets a signed_request as a $_POST parameter. It contains loads of useful information, which can be used, like a field for user id, a page field which contains the page id and some boolean fields to indicate if the user has liked the page, or if the user is admin, and some more fields. (See the link i have mentioned).
Then i just decode and extract the different fields from the said signed_request. So you should probably be doing the same, and find out if app is being visited by user or a page.
There is sample code given in the Facebook documentation that i referred, the link to which is at the end of this answer.
As far as i know, Facebook always sends this signed_request to any app a user visits, so u can always parse it.
Hope this helps you, if you want my code, leave a comment, and i shall follow it up with code :) .
You can refer the Facebook documentation regarding signed_request here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文