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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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_requestas a$_POSTparameter. 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_requestto 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_requesthere.