dev-m
dev-m

Reputation: 460

Refreshing facebook long lived access token without user interaction

My each user generating a long lived (60 days) access token from my site using graph api.But the problem is when it expires after 60 days, user have to generate it again by coming to my website.Sometimes they forget about token expiration and facebook page feed shows error in their websites.

in another post i mentioned about how i generate token long ago here- http://stackoverflow.com/questions/16962486/extending-valid-expired-60-days-access-token-without-user-interaction

Now how do i automatically refresh the long-lived token from code in their site so that user don't need to get token 2nd time by coming to my token generation website page.

in section Generating Long-Lived User Tokens from Server-Side Long-Lived Tokens of facebook help page - https://developers.facebook.com/docs/facebook-login/access-tokens I see ways to refresh token, but is it the way i want that there will be no user interaction while generating token?? I need example codes as it's hard to understand.

Upvotes: 6

Views: 7344

Answers (1)

Giacomo Giorgianni
Giacomo Giorgianni

Reputation: 61

I think so. Try to check this out here:

https://www.sammyk.me/access-token-handling-best-practices-in-facebook-php-sdk-v4

Look at "Best Practices for maintaining long lived access tokens over time". Guess you may find the answer you need.

Upvotes: 5

Related Questions