您无法从您的应用程序向用户发送消息。如果可能的话,我们会看到许多应用程序向每个人发送垃圾邮件。您可以做的是,当您想要通知用户应用程序中的更改时,向他们发送应用程序请求。
\n您可以在此网址阅读有关请求和应用程序请求的更多信息:
\n https://developers.facebook.com/blog/post/464/
向下滚动到“应用程序生成的请求的 PHP 示例”...
<?php \n\n $app_id = YOUR_APP_ID;\n $app_secret = YOUR_APP_SECRET;\n\n $token_url = "https://graph.facebook.com/oauth/access_token?" .\n "client_id=" . $app_id .\n "&client_secret=" . $app_secret .\n "&grant_type=client_credentials";\n\n $app_access_token = file_get_contents($token_url);\n\n $user_id = THE_CURRENT_USER_ID;\n\n $apprequest_url ="https://graph.facebook.com/" .\n $user_id .\n "/apprequests?message=\xe2\x80\x99INSERT_UT8_STRING_MSG\xe2\x80\x99" . \n "&data=\xe2\x80\x99INSERT_STRING_DATA\xe2\x80\x99&" . \n $app_access_token . \xe2\x80\x9c&method=post\xe2\x80\x9d;\n\n $result = file_get_contents($apprequest_url);\n echo(\xe2\x80\x9cRequest id number: \xe2\x80\x9d, $result);\n?>\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
3781 次 |
| 最近记录: |