I currently have an Application on the Facebook Tab, and am wondering if there is a way for me to deep link into an item on that app tab. Example:
User is in the applic
Here's how we deep link to subpages within our app's Page Tab.
When your application lives inside a Page Tab, Facebook will strip out all GET params except for app_data
. It passes app_data
inside the signed_request
parameter of the POST data.
More info in the docs: https://developers.facebook.com/docs/authentication/signed_request/
So when we build links to subpages, it will look something like
http://www.facebook.com/myfanpage?sk=app_XXXXXX&app_data=%2Fmainpage%2Fsubpage
Then, in our index page code, we check for the app_data
param. If it exists, then a simple 302 redirect does the trick.
$request = parse_signed_request($_POST['signed_request']);
if ($request['app_data'])
{
header('HTTP/1.1 302 Found');
header('Location: {$request['app_data']}');
exit;
}
Note: you can pass more than 1 param inside of app_data
using a URL-encoded, JSON-array or something like that.