Closed confile closed 11 years ago
You should debug you tokens to check their validity.
Use this to check if they are valid: https://developers.facebook.com/tools/debug
By default, token are only valid during 1 hour. You need to exchange it to get longer one (valid during 2 months) if you want to persist to DB.
@benorama how do I get longer tokens with your plugin? And how can I refresh the token?
Use facebookContest.user.exchangeToken(), it will replace the current token (short term) by a long term (2 month) token.
@benorama The problem is that after I loggin with facebook and use facebookClient.publish the error occurs. The token cannot be to old. When I user facebookClient.publish the second time as I wrote above it worked fine.
Do have any idea? Thank you for your help.
I tried to upload an image to the users facebook wall. The problem is that the first time I try it I get the error below. The second time went fine. The problem seems to be in the userAccessToken which is not set correctly the first time by:
What is wrong here?
The code I use is:
This is the error I got the first time: