0

我无法发布通知。这是我的 PHP 代码:

    try {
        $id = Fb_Config::get_app_id();
        $secret = Fb_Config::get_secret_code();
        $url = "https://graph.facebook.com/oauth/access_token?client_id=$id&client_secret=$secret&grant_type=client_credentials";
        $appAccessToken = end(explode("=", file_get_contents($url), 2));
        var_export(Fb_Facebook::get()->api_post("/".$this->get_logged_in_user()->get_id()."/notifications?access_token=$appAccessToken", array(
            href => "http://www.disney.com",
            template => "this is awesome"
        )));
    } catch (Exception $e) {
        echo "<pre>Error: ";
        echo $e->getMessage();
        echo "</pre>";
    }

错误是:

错误:(#15) 必须使用应用程序 access_token 调用此方法。

4

1 回答 1

1

不要让这变得比它必须的更复杂 - app_id|app_secret(中间的管道符号)的组合用作应用访问令牌。

于 2013-06-30T15:47:08.423 回答