How to identify a user on iOS?
Asked Answered
D

3

5

I am using LibGDX and for the Android version of my game I use the "Get Accounts" permission to identify a user by their Gmail address.

Is their a similar way to identify a user for iOS?

Deloresdeloria answered 22/3, 2016 at 18:56 Comment(0)
S
14

According to the App Store Guidelines, you shouldn't get user's personal data without obtaining the user's prior permission. The only identifier you can use anonymously is identifierForVendor:

UIDevice.currentDevice().identifierForVendor?.UUIDString

This identifier is common for all your apps on the user's device. If all the apps were deleted from the device, the identifier may change. More.

Sombrero answered 25/3, 2016 at 9:14 Comment(2)
That sounds just great. Is this also available in Java via RoboVM? And can I ask for a permission in a way similar to Android? That would be greatDeloresdeloria
This is a public API, so I guess it's available via RoboVM too. And you don't need a permission for it, it's open to use an anonymous id. (We are using this id to link up the session on a backend with a user, without requesting any sign up via Facebook or email.)Sombrero
C
6

Your best bet is to use GameCenter on iOS for identifying the players. This link provides a little more info on handling users with GameCenter.

Crumpet answered 29/3, 2016 at 21:17 Comment(0)
U
4

According to Apple, you shouldn't identify your users, unless you have a good reason to do so.

Like @Marat said, what you are looking for is the UUID, but keep in mind that this value may change (for example, if the user delete your app and have none of your other apps).

A possible solution would be to keep the UUID value in the keychain, and that way you will always use the same value.

Edit: Since your app is a game, you can use Apple's GameCenter. This will identify the users for you.

Unspoiled answered 29/3, 2016 at 8:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.