I have a Facebook Page with some friend, our fans send us texts we have to post on our page.
At the moment we are using a Google Form, it's good but copy paste is very boring...
So I coded a little website where our fans could post texts and with an administration interface, we can validate them and it post it automatically on our Facebook Page (as the page).
I requested these permissions : 'manage_pages'
, 'publish_pages'
(No problem)
But when I click to validate a text and post it as a page I have this error : "(#200) The user hasn't authorized the application to perform this action"
My code :
public function update($id, UpdatePostRequest $request, LaravelFacebookSdk $fb)
{
$post = $this->postRepository->findWithoutFail($id);
if (empty($post)) {
Flash::error('Askip non trouvé');
return redirect(route('posts.index'));
}
$post = $this->postRepository->update($request->all(), $id);
Flash::success('Mis à jour avec succès.');
$user = User::find(Auth::id());
if($request['state']) {
$fb->post('/AskipNamur/feed', ['message' => 'test'], $user->fb);
}
//return redirect(route('posts.index'));
}
$user->fb
is my access token
I read that I have to publish our Facebook app in order to post as a Page, I tried but I had this response :
You don’t need any extended permissions for an app that you admin. App admins, and any account listed as a ‘role’ in the App Settings page, can access the permissions without submitting for review. https://developers.facebook.com/docs/apps/security You only need to submit for review if the users/customers of your app are using the permissions to enhance their experience in-app
I'm using Laravel 5.2 and LaravelFacebookSDK ( https://github.com/SammyK/LaravelFacebookSdk )