当前位置: 动力学知识库 > 问答 > 编程问答 >

facebook - How could an app know from which page it is being accessed?

问题描述:

This question already has an answer here:

  • Get Facebook Page Tab ID of current Tab?

    4 answers

网友答案:

Facebook sends a POST variable called "signed_request" to your iframe, you can read and encode it but the easiest way is to use the PHP SDK. It offers a function called "getSignedRequest": https://developers.facebook.com/docs/reference/php/facebook-getSignedRequest

The fields include a page object with the ID: https://developers.facebook.com/docs/reference/login/signed-request

If you don't want to use the PHP SDK, here is an example how to encode signed_request: https://developers.facebook.com/docs/facebook-login/using-login-with-games

分享给朋友:
您可能感兴趣的文章:
随机阅读: