skipperbent / tinder-php-sdk

Easy to use PHP SDK for accessing Tinder data.
19 stars 7 forks source link

Refresh access token #18

Open NetoBraghetto opened 7 years ago

NetoBraghetto commented 7 years ago

How do i refresh the Facebook access-token in order to communicate to the Tinder SDK?

skipperbent commented 7 years ago

I'm not sure, normally you would just redirect to the Facebook authentication dialog - and as we don't know the redirect-uri, I don't think we can request a long-lived access_token.

You could try asking for the offline_access permission and see if that gives you a token that doesn't expire:

https://developers.facebook.com/docs/roadmap/completed-changes/offline-access-removal

Then you should be able to call:

https://graph.facebook.com/oauth/access_token?
client_id=APP_ID&
client_secret=APP_SECRET&
grant_type=fb_exchange_token&
fb_exchange_token=EXISTING_ACCESS_TOKEN 

to refresh your token periodically.

NetoBraghetto commented 7 years ago

we dont have the client_secret also =(

joykalyanguru commented 6 years ago

We can Use 'api_token' token instead of access-token. access-token lives 2 hours & api_token lives 24 hours.