Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/facebook-graph-api/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Facebook无法发送通知_Facebook_Facebook Graph Api - Fatal编程技术网

Facebook无法发送通知

Facebook无法发送通知,facebook,facebook-graph-api,Facebook,Facebook Graph Api,用户通过symfony2.1中的fosfacebookbundle成功登录 与本主题相关: 我想向用户发送通知。访问令牌如下所示…234 | asdf… $token_url = 'https://graph.facebook.com/oauth/access_token?grant_type= client_credentials&client_id=' . $app_id . '& clien

用户通过symfony2.1中的fosfacebookbundle成功登录

与本主题相关:

我想向用户发送通知。访问令牌如下所示
…234 | asdf…

$token_url = 'https://graph.facebook.com/oauth/access_token?grant_type=
                     client_credentials&client_id=' . $app_id . '&
                     client_secret=' . $app_secret;
$access_token = file_get_contents($token_url);
//After that I do a preg_split. Or for testing I print out the access token 
  and I define it manual in the php file `$access_token = '...234|asdf...';`

$userid = 12345;
$inviteMessage = 'Test_message';
$inviteMessage = urlencode($inviteMessage);
$url = "https://graph.facebook.com/" . $userid . "/notifications?access_token=" . 
                $access_token . "&template=" . $inviteMessage;
$c = curl_init($url);
// necessary so CURL doesn't dump the results on your page
curl_setopt($c, CURLOPT_POST, true);
$result = curl_exec($c);
curl_close($c);
$r = json_decode($result);
print_r($r);
print\r告诉我:对不起,出了点问题!Facebook公司

如果我直接把这个写在地址行:

https://graph.facebook.com/12345/notifications?access_token=access_token=...234|asdf...&template=Test_message
错误消息: { “错误”:{ “消息”:“无效的OAuth访问令牌签名。”, “类型”:“OAutheException”, “代码”:190 } }

怎么了

更新
developers.facebook.com/docs/concepts/notifications中href的含义是什么?

您是否使用了访问令牌linter来确保访问令牌正常?因为错误正在抱怨令牌。对不起,linter是什么?我从来没有听说过。这是Facebook提供的一个调试访问令牌的工具:好的,当我输入
https://graph.face...
出现错误消息“此调试器无法删除Facebook URL。请尝试您自己的。”。这是什么意思?该工具只接受
access\u令牌
而不是整个url。