Reputation: 20178
After lots of try I'm still stuck, I wanted to confirm one thing when passing parameters to a facebook application.
Does every parameters gets passed to the application, for e.g. if i've an application running
https://apps.facebook.com/example/index.php, and I do this https://apps.facebook.com/example/index.php?app_data={"para1":"para1"}, will this be passed??
Upvotes: 2
Views: 6590
Reputation: 20178
To get the parameter, I'm simply doing $_GET and retrieving the parameter from a typical URL like apps.facebook.com//index.php?var=
so, on index.php, I'm simply doing
$_GET['var'] and thus getting the var
Upvotes: 3
Reputation: 7289
Yes, In canvas apps, every parameter is passed.
For fan page apps, you will get data in app_data parameter as json string. https://www.facebook.com/YourPage?v=app_1234567890&app_data=any_string_here
FYI: Signed Request
$signed_request = $facebook->getSignedRequest();
$app_data = '';
if(isset($signed_request["app_data"])){
$app_data = $signed_request["app_data"];
}
Upvotes: 2