Thursday, March 31, 2016

How to identify a user on iOS?

Leave a Comment

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?

3 Answers

Answers 1

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.

Answers 2

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: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/GameKit_Guide/Users/Users.html

Answers 3

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.

https://developer.apple.com/game-center/

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment