Issue
I've read a lot and this is the only solution I get to:
- The first time the user logs in the app (with publish-actions) you get the token
- Convert the token to Long-Lived Token
- You can use it to publish for the next 2 months
- If the user clicks on a post you send, the token is reset to another 2 months
Am I right? Is that the best solution?
Solution
all correct. I am not sure about the user click (didn't find that in the documentation https://developers.facebook.com/docs/facebook-login/access-tokens). You should be ready to handle errors in case the token expires earlier or in case of app uninstalls. I check if the token is still valid by getting the user basic info with the access token I have. If the call is successful, I use the token. If not, I redirect the user app authorization again, get another token, exchange it with another long-lived token, and use that one.
Answered By - tattvamasi
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.