facebookarchive / php-graph-sdk

The Facebook SDK for PHP provides a native interface to the Graph API and Facebook Login. https://developers.facebook.com/docs/php
Other
3.17k stars 1.95k forks source link

Scheduled Post aren't visible to public! #1194

Open RiadOkba opened 4 years ago

RiadOkba commented 4 years ago

Hello,

I'm using php sdk to scheduled my posts (only images) to my facebook pages. My script was working one year ago just fine... I have updated since then because of the modification...

After I run my scripts, I can see it's working because the scheduled posts of my page reflect what I have done. However, when the post is published, only me can see the posts and nobody else! it's not visible to the public

Please, can you help me?

The code I'm using I got it from Facebook Doc:

... $helper = $fb->getRedirectLoginHelper(); $permissions = ['email', 'user_posts', 'pages_read_user_content', 'pages_manage_posts' ]; $callback = 'http://localhost/fb_bulk_posting/callback.php' ; $loginUrl = $helper->getLoginUrl($callback, $permissions);

... $data = array( 'source' => $fb->fileToUpload($path_to_image), 'scheduled_publish_time' => $time_of_publication, 'message' => '', 'published' => 'false' );

$request = $fb->post($page_id.'/photos', $data, $acc_token); $response = $request->getGraphNode()->asArray();