JAM*_*MES 41 php facebook facebook-graph-api facebook-messages facebook-friends
任何人都可以帮助我使用图形api向Facebook朋友发送消息.
我试过了
$response = $facebook->call_api("/me/feed", "post", "to=john","message=You have a Test message");
Run Code Online (Sandbox Code Playgroud)
它不起作用.我手里拿着用户的accessstoken.only我很困惑发送过程.
Bob*_*ger 29
您可以在弹出窗口中打开" 发送"对话框.
$parameters = array(
'app_id' => $facebook->getAppId(),
'to' => $facebookUserId,
'link' => 'http://google.nl/',
'redirect_uri' => 'http://my.app.url/callback'
);
$url = 'http://www.facebook.com/dialog/send?'.http_build_query($parameters);
echo '<script type="text/javascript">window.open('.json_encode($url).', ...
Run Code Online (Sandbox Code Playgroud)
有关详细选项,请参阅:https: //developers.facebook.com/docs/reference/dialogs/send/
$attachment = array(
'access_token' => $access_token,
'message' => "$msg",
'name' => "$name",
'link' => "$link",
'description' => "$desc",
);
facebook->api('/'.$uesr_id.'/feed', 'POST', $attachment);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
95967 次 |
| 最近记录: |