I got this error when I call GetFriendLeaderboard()
Error validating access token: Session has expired
How should I fix this?
NOTE: I'm retrieving Facebook friends' leaderboard
I got this error when I call GetFriendLeaderboard()
Error validating access token: Session has expired
How should I fix this?
NOTE: I'm retrieving Facebook friends' leaderboard
Session expiration could refer to one of two things:
1. Your PlayFab session ticket has expired. Re-signing into PlayFab using any valid authentication method would resolve this.
2. Your Facebook token has expired. Querying for an updated token, to use for sign-in to PlayFab would resolve this.
I dont understand what u mean in point 2.
Can u elaborate more? perhaps with sample codes?
Everytime when the game starts I will call LoginWithCustomID already. I dont think is PlayFab session ticket expired.
The problem then, if you're asking for the Facebook friends in the GetFriendLeaderboard call, is that Facebook does not provide us with a way to get an unlimited-time token for their service. You will have to use LoginWithFacebook at some point, if you want to use Facebook features, so that we have a token which is current. This would be using the same code you're already using to get the Facebook token in the Login or Link call where you're making Facebook authentication part of the player account.
Meaning after the player linked with Facebook account, next time when the player login with PlayFab I should be calling LoginWithFacebook instead of LoginWithCustomID?
Is that what u mean?
You can use any authentication mechanism you like to get to your player data, but when it comes to using features which are integrated with third-party services like Facebook, you will sometimes need to authenticate with them (using our Login call, yes), so that we have a current token to their service, and can call into it on your behalf, yes.
So if the FB account is ALREADY linked to PF, I can call LoginToFacebook and it won't popup a window if the session is expired? It can be a seamless "reconnection"?
If I have multiple accounts linked, would I have to login to ALL of them for a renewed ticket? I'm still confused by this. This is the closest related post I could find in relation to my question.
If the player is signed into Facebook on the local device, and that device has Facebook integration, the player shouldn't be prompted to sign in.
As to "multiple accounts linked", I'm not sure what you mean. You cannot have more than one PlayFab account in a game linked to the same Facebook account - it can only be linked to one. If you mean across titles, as long as you're using a single Publisher ID across your games (which is the default within a single Studio), you're actually using the same PlayFab account for any sign-in using Facebook, across all games. So in that case, a Facebook sign-in on any of those games updates the token.
2 People are following this question.