简体   繁体   中英

posting to Facebook page wall as page itself with no user session

This is my first question here, so apologies if asking something trivial - though I didn't find an answer after an hour of digging.

I have a PHP website which needs to connect with a Facebook page in the following method: On certain triggers, the site needs to post to the page's wall as the page itself . This has to be done automatically, even if no user session is available (eg if someone uses the site without actually having a Facebook account).

I found solutions using extended token expiration times (offline access), but in those cases, the post will always appear as the site admin (me, in this case). However, I need the post to be written by the page. When using Facebook as the page, I have no right to request an offline access token.

Is this even possible at the moment?

You need to cache the page access token on your server and use that to make the updates - the page login is pretty well documented here: https://developers.facebook.com/docs/authentication/pages/ -

Store the access_token in your server-side code and use that token to post as the page - the page access token won't expire if you have a long-expiry access token for the page admin, unless the user stops being an admin of the page, removes the app, etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM