I want to use the same PHP script to handle the display for being viewed as a canvas application and as an tab in the user profile. However, there are slight difference in the content to be displayed. So, how can I tell distinguish these cases in runtime?




Appreciate if you can like this page if you find it useful! - Click "Like"

To distinguish the cases, you can make use of the "fb_sig_in_profile_tab" parameter in the $_REQUEST object when your page is being loaded. This parameter will be set and has a value of 1 if the page is being displayed as an application tab in the user profile.

However, at this moment, to have these "fb_sig_*" parameter available, you should disable the "Canvas Session Parameter" option in the "Migration" page of your application settings.

Note: Earlier, we should disable the "New SDKs" option in order to get these "fb_sig_*" parameter. However, the "New SDKs" option was gone and got replaced by this "Canvas Session Parameter" option.... though I am not sure if there are any differences between them.



Find my FAQ on Facebook Development useful? Download the PDF for all the FAQs HERE!