0

So I have a CMS for my clients. They can send push notifications to their mobile app users. I got a request from one of my clients to implement support for it to also be able to post to a Facebook page wall directly when sending a push notification.

It works if I get a short-lived page access token manually through the Graph API explorer (manually as in, from my browser) and use it in combination with my (unapproved and unpublished) Facebook app. This token only lasts 60 minutes. Now I can get myself a Facebook app approved and all, but that means I would need to add a separate button that is blue so it conforms to their guidelines. Two buttons would defeat the whole purpose of having this functionality.

Perhaps it's a solution to have a pop-up dialog where the user can post directly to their Facebook page feed, and pre-populate it with the text they were initially entering in the textarea?

It's no issue if I have to manually get access to each Facebook page before it being able to work.

What's the best solution to posting to a Facebook page without having to get my Facebook app approved?

Koby Douek
  • 16,156
  • 19
  • 74
  • 103
  • Do you want to post to the page as the page, or as a user (“visitor posts”)? If you want to post as the page, then simply get an extended page access token. // If your app is not meant to be used by the general public, but only a small number of people, then you don’t necessarily submit for review, see https://developers.facebook.com/docs/apps/faq#faq_180362122361921 – CBroe Mar 23 '17 at 12:51
  • I want to post as the page, yes. So I have to be the owner of the page. Thanks a lot for the help, this sure helped me a lot! – Jasper Rietrae Mar 24 '17 at 14:15
  • @CBroe I'm getting an error stating I have insufficient permission to post to target on behalf of the viewer. It worked with a normal - thus expiring - access token, but with the extended one I get this error. – Jasper Rietrae Mar 30 '17 at 13:36
  • That sounds like you are not really using a page access token here, but a user access token. – CBroe Mar 30 '17 at 16:18
  • It does, yeah. But I followed the steps in this SO post and that is, from what I can tell, an extended page access token: http://stackoverflow.com/questions/10183625/extending-facebook-page-access-token – Jasper Rietrae Mar 31 '17 at 07:52
  • That doesn’t sound completely right, the user token needs to be exchanged for a long-lived one, and then that long-lived user token is used to request the page token. https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension – CBroe Mar 31 '17 at 07:53
  • Hi @CBroe. I was away for a few days, sorry for the late response. I just tried to follow the steps in this shell script, and I still get the insufficient permision error: https://github.com/dncohen/fb_token/blob/master/fb_token.sh. – Jasper Rietrae Apr 12 '17 at 08:12
  • Suggest you follow the flow as it is outlined in the official FB documentation. – CBroe Apr 12 '17 at 10:57

0 Answers0