Facebook graph api #15邮寄通知

Facebook graph api #15邮寄通知,facebook-graph-api,post,notifications,Facebook Graph Api,Post,Notifications,我在发布通知时遇到问题。 这是我的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_crede

我在发布通知时遇到问题。 这是我的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>";
    }
试试看{
$id=Fb_Config::get_app_id();
$secret=Fb_Config::get_secret_code();
$url=”https://graph.facebook.com/oauth/access_token?client_id=$id&client\u secret=$secret&grant\u type=client\u凭证”;
$appAccessToken=end(分解(“=”,文件获取内容($url),2));
var\u export(Fb\u Facebook::get()->api\u post(“/”$this->get\u logged\u in\u user()->get\u id()。“/notifications?access\u token=$appAccessToken”,数组(
href=>”http://www.disney.com",
template=>“这太棒了”
)));
}捕获(例外$e){
回声“错误:”;
echo$e->getMessage();
回声“;
}
错误是:


错误:(#15)必须使用应用程序访问令牌调用此方法。

不要让它变得更复杂–应用程序id与应用程序机密(中间的管道符号)的组合可用作应用程序访问令牌