question

Seth avatar image
Seth asked

Session and Facebook Token lifetime?

As I understand both session tickets and facebook tokens does expire after a while so I got two questions to this. 

Facebook: Do i need to fetch a facebook token everytime I start the app? What happens when it expires? Do I need to link the newly refreshed one to the account ?

 

Playfab: What happens when users don't close their app and let them run more than 24 hours. Do I need to connect once again using eg. LoginWithAndroidDeviceID as soon as I get an auth error?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

In many cases, titles store the Session Ticket locally for re-use, which is also fine. But it any case - whether you keep it between times the game is run or not - yes, you do need to get a new Session Ticket once the local one has expired (at which point you'll get errors when making Client API calls, indicating that the ticket isn't valid).

For the Facebook case, the token you pass to us authorized us to make calls to Facebook on behalf of the user for a period of time determined by Facebook. Once that period has expired, any call into our service which requires us to call Facebook on your behalf will return the FacebookAPIError error message from our service, and in the error details we provide the specific error response from Facebook. Because Facebook returns the same code and type for expired tokens, invalid tokens, and de-authorized applications, you do need to check the error details if you want to get the specific reason from their service. Attempting a new Facebook login using the player's token on a FacebookAPIError would be the simplest approach, though you should check to make sure that if the same error occurs on re-try, that you don't then loop constantly on signing in and re-trying.

Re-logging in the player using their Facebook token would indeed be the right thing to do on title start, if you regularly need Facebook information (friends list, for example).

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.