2
Good afternoon. I need to know how to adapt the script below for me to post on the page that the logged in user is administrator. For example, if my user is a 3-page admin on the face, I want to post directly from the page and not as if my user had done the post on the page.
Note: I already changed the '/me/photos' by 'page-id/feed' but it appears as a post of mine on the page and not as if the page itself had posted.
FB.login(function () {
FB.api('/page-id?fields=access_token', 'GET', function (response) {
FB.api('/' + response.id + '/photos', 'POST', { message: mensagem, url: imagem }, function (response) {
if (!response || response.error) {
console.log(response);
alert('Error occured');
} else {
alert('Post ID: ' + response.id);
}
$("#post-face-action").modal('hide');
});
});
}, { scope: 'publish_actions, publish_pages, manage_pages' });
I adjusted my script with these permissions, and added a method that searches the page id to pass to the method it posted, even so goes with my username and not as if the page had posted.
– Daniel Gregatto
I followed the documentation, https://developers.facebook.com/docs/pages/publishing
– Daniel Gregatto