Refresh access token without user intervention
I am using facebook sdk for android to fetch the FB data. The access_token that is received after successful login expires after a certain time. I want to refresh the token token in the background. ie; the user should nt be prompted for the credentials 开发者_运维问答again. Thanx in advance
I hope you can not refresh the access token without the user prompt, becuase it means everybody able to do things without request permission.
If you call the auth process after the access token timedout, it takes just 1 sec, and usualy just a blink on the screen.
Please note that the access token could expire before the expire date. For example the user just logout in another window. Moreover the offline token could expires if the user changes her/his password.
So just call the standard auth url, and your access token will be refreshed.
You can get a token that doesn't expire. Just add offline_access
to the requested facebook permissions of your app.
Check the permissions documentation.
As pointed out by Kostadin, this way seems to be gone now.
精彩评论