1

I have a facebook tab app that will be installed in multiple fan pages, but it must show different results. I tried with query strings, but from what I know, the tab link can´t have custom vars.

My idea is to get the id of the current fan page calling the tab app, and then pass it as a variable to define different results.

I tried with Facebook PHP SDK 4:

define('FACEBOOK_SDK_V4_SRC_DIR', 'src/Facebook/');
require 'autoload.php';

use Facebook\FacebookSession;
use Facebook\FacebookPageTabHelper;

FacebookSession::setDefaultApplication('xxx', 'xxx');

$canvasHelper = new FacebookPageTabHelper();
var_dump( $canvasHelper );

but I get:

protected 'pageData' => null
protected 'signedRequest' => null

Any ideas?

SOLUTION: after some hours of work and returning to FB SDK 3, I found this: Facebook iframe tab signed request always empty "After changing my "Tab URL" to 'tab/index.php", the signed request started to show up in the app tab!" It works, even with SDK 4!

Community
  • 1
  • 1
pbs
  • 248
  • 3
  • 9
  • 4
    `$canvasHelper->getPageId()` – WizKid Jul 01 '15 at 19:54
  • yes, i have that two lines below of "var_dump".. and it gives me null.. I think it has something to do with the pageData being null – pbs Jul 01 '15 at 20:33
  • You will only get that when it is rendered in the iframe on the first POST request. After that you need to remember it yourself – WizKid Jul 01 '15 at 20:39

0 Answers0