Good afternoon. I need to know how to adapt the script below so that I make the post on the page that the logged in user is an administrator. For example, if my user admin is 3 pages in the face, I want to post directly through the page and not as if my user had made the post on the page.
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' });