I am working on starting the user authentication flow for my mobile ios unity game and am running into some troubles. Basically I would like to be able to just log the user in using their device ID and prompting them later to link their account to their facebook to save their progress. But what happens after they link their account? Because my main connecting scene has them logged in using their device id... How do you switch to using login with facebook now that the account is linked to their facebook?
My connection screen basically goes like this:
1. PlayFab -> LoginWithIOSDevice() { Create Account = true } //This creates a seamless login experience...
2. Take them to lobby scene.
But say after they go to lobby screen they link their account with facebook. Next time they open the app they will go through the same LoginWithIOSDevice...
I am guessing a fix would be before the LoginWithIOSDevice to check if the user is logged into facebook. If not, go through with IOS Device Login. If they are logged into facebook just call the LoginWIthFacebook() method:
1. Facebook SDK -> Check if user has access token.
2. If yes, PlayFab -> LoginWithFacebook()
3. If no, PlayFab -> LoginWithIOSDevice() { Create Account = true }
But the problem with this approach is say the user, after linking to facebook and closing the app, logs out of facebook on their phone... The next time the user opens the app, it would check if the user is logged into facebook and if not they would just get authenticated using device id even though their account is linked in with facebook! How do you get around this?
,I am working on starting the user authentication flow for my mobile ios unity game and am running into some troubles. Basically I would like to be able to just log the user in using their device ID and prompting them later to link their account to their facebook to save their progress. But what happens after they link their account? Because my main connecting scene has them logged in using their device id... How do you switch to using login with facebook now that the account is linked to their facebook?
My connection screen basically goes like this:
1. PlayFab -> LoginWithIOSDevice() { Create Account = true } //This creates a seamless login experience...
2. Take them to lobby scene.
But say after they go to lobby screen they link their account with facebook. Next time they open the app they will go through the same LoginWithIOSDevice...
I am guessing a fix would be before the LoginWithIOSDevice to check if the user is logged into facebook. If not, go through with IOS Device Login. If they are logged into facebook just call the LoginWIthFacebook() method:
1. Facebook SDK -> Check if user has access token.
2. If yes, PlayFab -> LoginWithFacebook()
3. If no, PlayFab -> LoginWithIOSDevice() { Create Account = true }
But the problem with this approach is say the user, after linking to facebook and closing the app, logs out of facebook on their phone... The next time the user opens the app, it would check if the user is logged into facebook and if not they would just get authenticated using device id even though their account is linked in with facebook! How do you get around this?