android - Restore Facebook Session with a token from Shared preferences that has been revoked -


i'm integrating facebook sdk 3.0 in android app.

let's imagine user opened session in android device. if using default token strategy token persisted in sharedpreferences.

then, user revokes token in web or in facebook app.

next, let's imagine create new session , set active (this uilifecyclehelper there no active session.

next open session with:

session.openactivesession(this, true, mcallback); 

according https://developers.facebook.com/docs/reference/android/current/session#openactivesessionfromcache(context)

create new session, , if token cache available, open session , make active without user interaction.

so, flow, open session token revoked...

is true? missing something? how treat this? if try open new session, same invalid token used again...

i've realised can clear token with:

session#closeandcleartokeninformation();

so, seems developers expected open session session.openactivesession(). if there cached token in sharedpreferences , works, perfect. if token revoked won't know until receive auth error when calling facebook api. if happens, clear token , re-authenticate again.


Comments