How can I manage a user session in Android using Facebook token?

126 views Asked by At

I created a login Activity using the Facebook sdk. I have access to the user data and I can retrieve the Facebook token. Now I would like to manage the user's session using this token (if the token is invalidated the user is sent to login Activity again). I tried to create an account with Account Manager but I had several problems. Can I have some examples of working code making what I am asking for?

1

There are 1 answers

0
DorAyalon On

You need to save your access token and it's expiry date. You can use the shared preferences for that. And then you can use the Facebook.Session object to reopen the Session using this data.