从应用程序发送消息到Facebook用户
答
您不能从您的应用程序发送用户消息。如果可能的话,我们会看到很多应用程序向所有人发送垃圾邮件。当你想通知他们你的应用程序有变化时,你可以做的就是向你的用户发送应用程序请求。
您可以通过以下网址了解更多关于请求和应用程序请求:
https://developers.facebook.com/blog/post/464/
向下滚动到“应用程序生成的请求的PHP榜样” ......
<?php
$app_id = YOUR_APP_ID;
$app_secret = YOUR_APP_SECRET;
$token_url = "https://graph.facebook.com/oauth/access_token?" .
"client_id=" . $app_id .
"&client_secret=" . $app_secret .
"&grant_type=client_credentials";
$app_access_token = file_get_contents($token_url);
$user_id = THE_CURRENT_USER_ID;
$apprequest_url ="https://graph.facebook.com/" .
$user_id .
"/apprequests?message=’INSERT_UT8_STRING_MSG’" .
"&data=’INSERT_STRING_DATA’&" .
$app_access_token . “&method=post”;
$result = file_get_contents($apprequest_url);
echo(“Request id number: ”, $result);
?>
THX你的答案先生.. .hehehe ..:D – 2011-12-14 12:59:42