Question:

How can I publish a post to an offline user?

 

 

 

Answer:

Appreciate if you can like this page if you find it useful! - Click "Like"

First of all, you need to have the followings done:

  • Obtain the publish_stream and offline_access extended permissions.
    If you can new to offline_access extended permission, read this article.

  • Store the access_token when the user login to your appl

Then when you want to publish a post to an offline user (the code below is written based on the PHP SDK),

  • Format the $attachment array object as usual.

  • Specific the user token inside the $attachment, as something like

$attachment['access_token'] = $stored_accessToken;

  • Publish the post as usual via the Graph API:

$facebook->api('/'.$offline_user_uid.'/feed', 'POST', $attachment);

 

 

Find my FAQ on Facebook Development useful? Download the PDF for all the FAQs HERE!