开发者

Checking if canvas app is installed on page or profile [closed]

Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_运维知识库

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 5 years ago.

Improve this question

I would like to check if my app is installed on a profile or on a page, because I like to it to behave differently on each type. Is there an api for this?



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.


Correct link for signed_request: http://developers.facebook.com/docs/authentication/signed_request/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜