2

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??

4

2 に答える 2

3

パラメータを取得するには、単純に $_GET を実行し、apps.facebook.com//index.php?var= のような一般的な URL からパラメータを取得します。

だから、index.phpで、私は単純にやっています

$_GET['var'] したがって、変数を取得します

于 2012-06-05T05:32:11.810 に答える
2

はい、キャンバス アプリでは、すべてのパラメーターが渡されます。

ファン ページ アプリの場合、app_data パラメーターのデータを json 文字列として取得します。 https://www.facebook.com/YourPage?v=app_1234567890&app_data=any_string_here

参考:署名済みリクエスト

    $signed_request = $facebook->getSignedRequest();

$app_data = '';
if(isset($signed_request["app_data"])){
    $app_data = $signed_request["app_data"];
    }
于 2012-05-24T14:17:38.217 に答える