question

Jon avatar image
Jon asked

iOS Unique Identifier

Is there a recommended way on dealing with the iOS unique identifiers?

Looking at this page:

https://docs.microsoft.com/en-us/gaming/playfab/features/authentication/login/login-basics-best-practices

It mentions:

"One way to make sure you have a consistent ID on iOS is to save the device ID for the player to the iTunes KeyChain, so that you can read it from there on game start, and use it to sign in."

However, isn't it possible that the user has a conflicting device ID or are they unique? It says "For iOS devices, the player ID changes if they uninstall your game, and then re-install it."

I was going to do something like this:

1) first time player logs on, checks for existing device id in keychain

2) new player account is created (device id is stored in keychain)

3) player deletes app

4) player re-installs app, device id changes

5) login again, check for existing device id in keychain - found one - use that to recover old player account

But it seems if the player ID changes, it's possible to generate on that is already used? Or is that not the case?

Thanks

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

·
Sarah Zhang avatar image
Sarah Zhang answered

>> But it seems if the player ID changes, it's possible to generate on that is already used? Or is that not the case?

In step 5, when you use a new device Id to log a player in, the player gets a new PlayFabID. It means a new player account has been generated. When you use the old device Id to recover the old player account. It means you log in to the old account again. But the new account still exists, it won’t be deleted automatically or be merged to the new account. If your expected target is “merging” these two accounts. It isn’t the expected result. You can try to check the keychain first, then log the player in, only login once.

The following points could be helpful. The field “CreateAccount” In the API LoginWithIOSDeviceID can control the generation of new accounts. If you don’t want to generate a new account when you call this API, you can set it to “false”. Besides, we would suggest you add the recoverable login mechanism. It can provide an option for users to re-login their first player accounts.

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.