Reputation: 455
I am trying to get app_data from the facebook canvas.
It's working in page tab.
https://www.facebook.com/something/app_55218516481307?app_data=4B9E753
$signed_request = $facebook->getSignedRequest();
$app_data = $signed_request["app_data"];
app_data contains the value - '4B9E753' So, it's nice.
But there, app_data is not even set.
https://apps.facebook.com/namespace/?app_data=something
signed_request contains only
Array (
[algorithm] => HMAC-SHA256
[issued_at] => 65456446
[user] => Array (
[country] => cz
[locale] => cs_CZ
[age] => Array (
[min] => 21
)
)
)
Why?
Upvotes: 0
Views: 2781
Reputation: 150
It only works in a page tab and not on the canvas page. https://developers.facebook.com/docs/reference/login/signed-request/ to send data to the app on its canvas app page use 'https://apps.facebook.com/yourappname?sk=app_yourapp_id/whatever_you_wish_to_send/' and get it in php with $thisrequest = $_REQUEST['sk']; you can echo it to see what you get back.
Upvotes: 1