开发者

Facebook api offline message send

开发者 https://www.devze.com 2023-02-17 02:19 出处:网络
How to send a message to a user who is offline using开发者_开发问答 Facebook API?Since there\'s no details, I\'m assume you\'ll be using PHP-SDK. So just grant the publish_stream permission and use so

How to send a message to a user who is offline using开发者_开发问答 Facebook API?


Since there's no details, I'm assume you'll be using PHP-SDK. So just grant the publish_stream permission and use something like:

require 'src/facebook.php';

$facebook = new Facebook(array(
  'appId'  => 'APP_ID',
  'secret' => 'APP_SECRET',
  'cookie' => true,
));
$post_id = $facebook->api("/USER_ID/feed","POST",array("message"=>"Hello Offline!"));
if(!empty($post_id["id"]))
    echo $post_id["id"];


Irrespective of user online or offline, you can not send message to a user. If you have offline_access and read_mailbox permissions you can read mails.

But there are few workaround for this. One is to send a normal email as example@facebook.com. This will work only if that user has enabled Facebook email for the account.

Other-one is to write on their wall. But this is not private.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号