Lets assume I’ve got an authorization token from user,
that I will use later in my cron jobs to send posts to user’s wall.
How to handle case when token expires and I find it out only in future,
when trying to post a scheduled info to users wall?
Does it mean I should fail, and ask user to re-athorize the app manually?
Or there is some way to create a scheduled post using precisely Facebook API?
Lets assume I’ve got an authorization token from user, that I will use later
Share
You actually do not need a user access token to make scheduled posts. Once you acquire the
publish_streamextended permission from the user you can make posts at will using an app access token.If your post fails with an OAuth exception from Facebook, then you know the user did something that revoked your permissions and you can try to get them to re-authenticate with your app. The trick here is how do you contact the user?
If you acquired their email address (after getting the
emailextended permission), then you can send them an email.If they still have your app installed and just revoked the publish_stream permission and your app has a canvas presence, you can use app requests to notify the user they need to take action to resume scheduled posts. Or you can give them some kind of alert message the next time they happen to visit a page from your site.