Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

How can I publish an article on a public page via the Facebook API? #1015

Open
ampleeve opened this issue Jun 22, 2018 · 1 comment
Open

Comments

@ampleeve
Copy link

My code:

`public function post()
{
$fb = new Facebook(array(
'app_id' => $this->app_id,
'app_secret' => $this->app_secret,
'default_graph_version' => 'v2.2',
));
$fb->setDefaultAccessToken($this->access_token);

    $data = [
        'message' => $this->message,
        'source' => $fb->fileToUpload([путь до картинки]),
    ];

    $batch = [
        'photo' => $fb->request('POST', "/{$this->page_id}/photos", $data),
    ];

    $responses = $fb->sendBatchRequest($batch);
    return $responses;

}`

I tried both to publish the application and to remove it from the publication so that at least admins could see the post ... in both cases it does not work ..

@ampleeve
Copy link
Author

What amI doing wrong?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant