johntube
started a topic on Fri, 11 September 2015 at 6:39 AM
Each time I need to connect a player completely to the game I have to do the following:
Call one of PlayFab's sign in API endpoints
Get CloudScript URL
Get Photon Token
Call RunCloudScript with an initialization action/handler
Set Photon AppVersion from CloudScript (Version & Environment) or (Version & Revision) : this will be useful in the future when versioning with webhooks is available...appversion could be used as URL tag.
Connect to Photon ==> finally the loader animation/spinner is removed, player is on main screen and can play !
I need to simplify this process.
I already implemented the friction free, device signin best practice from LoginPathways sample. I don't know if I should be doing that if application regains focus or unpaused: is foreground again.
Now I need to cache the following:
- PlayFab's session token
- CloudScript URL
- Photon token
The problem is that I'm afraid the 24 hours lifetime of tokens get in the way of things. So I need to save the tokens timestamps and repeat the whole process even if the app is running and foreground with totally transparency to the player.
I'm already struggling with resuming Photon Rooms when the app goes to background when the player is joined to a Room. I don't want to do this even if the app does not go to background !