roughike / flutter_facebook_login

A Flutter plugin for allowing users to authenticate with native Android & iOS Facebook login SDKs.
BSD 2-Clause "Simplified" License
404 stars 332 forks source link

How to get refresh token as well in result #263

Closed dkansh closed 4 years ago

dkansh commented 4 years ago

Can we get the refresh token as well in the result? I need to call Facebook graph API several time in application and the access token get expired very soon. So need refresh token to refresh the access token.

ncpleslie commented 4 years ago

You can exchange a short-lived token (Few hours) with a long-lived token (60 days). flutter_facebook_login should give you a long-lived token (60 days), but if it doesn't you can follow this guide by Facebook to exchange your token with a long-lived token.

https://developers.facebook.com/docs/facebook-login/access-tokens/refreshing/

dkansh commented 4 years ago

Hey @ncpleslie ,

Thanks for the reply. I when through your given link and for now my issue is solved. But still, I feel that it's good to have feature is refresh token is also returned by this plugin.

cubuspl42 commented 4 years ago

@dkansh How did the link help you? Did you actually receive a short-lived token from flutter_facebook_login? It shouldn't be possible, if I understand correctly.

cubuspl42 commented 4 years ago

I've created a new issue related to token refreshing. See https://github.com/roughike/flutter_facebook_login/issues/289.