hungdev / react-native-instagram-login

a react native instagram login component (support android & ios). Pull requests are welcome!
https://www.npmjs.com/package/react-native-instagram-login
184 stars 103 forks source link

Instagram Token expired soon how to generate new token without credentials #76

Open patelronakp opened 3 years ago

patelronakp commented 3 years ago

I have implemented this package and its working fine but had facing one issue like i have only token which is expired after few minutes of inactivity with instagram. So in that case how could i get new token without again asking for the credentials. Do we have something like refresh token from the API so i can get new token based on that.

Please suggest how to takkle this situation or any other alternative solution are also welcome.

hungdev commented 3 years ago

Sorry for late reply, Im so busy and I don't have much time to investigate this problem. according to the docs, Authorization Codes can be exchanged for short-lived Instagram User Access Tokens. And i exchanged it for a long token by step 2, exchange code to token. You can see: https://developers.facebook.com/docs/instagram-basic-display-api/reference/oauth-access-token https://developers.facebook.com/docs/instagram-basic-display-api/overview#short-lived-access-tokens feel free to comment here.