0

In my Node application, I store in the DB a long-lived user facebook access token and run a cron periodically.

There's a way to renew that access token after the 60 days without asking the user to renew it in my mobile app? I use fbgraph node module to communicate with the graph API, so maybe there's a way to renew that token from the backend itself without going to the mobile app, ask for status and login again with the JavaScript SDK.

MarBVI
  • 811
  • 2
  • 12
  • 34

1 Answers1

1

Tokens always need to be refreshed with user interaction, there is no way to auto-refresh them.

But you don´t need to login again, you just need to use this function to refresh the User Token: https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • can you give a code example to renew it given the old access token? – MarBVI Jul 24 '16 at 18:42
  • just open the link in my answer, there is a code example. it´s really easy. you don´t need the old token, just call the function. – andyrandy Jul 24 '16 at 18:51