如何在iOS上识别用户?

时间:2022-01-30 13:18:38

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.

我正在使用LibGDX,对于我的游戏的Android版本,我使用“Get Accounts”权限来通过Gmail地址识别用户。

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

他们是否有类似的方法来识别iOS用户?

3 个解决方案

#1


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:

根据App Store的指导方针,你不应该在没有得到用户的事先许可的情况下获取用户的个人数据。您可以匿名使用的唯一标识符是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.

这个标识符对于用户设备上的所有应用程序都是通用的。如果所有应用程序都从设备中删除,标识符可能会改变。更多。

#2


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.

最好的办法是在iOS上使用GameCenter来识别玩家。这个链接提供了更多关于使用GameCenter处理用户的信息。

#3


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).

就像@Marat说的,你要找的是UUID,但是要记住这个值可能会改变(例如,如果用户删除了你的应用,而没有其他的应用)。

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

一种可能的解决方案是将UUID值保存在keychain中,这样您将始终使用相同的值。

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

编辑:因为你的应用是一个游戏,你可以使用苹果的GameCenter。这将为您标识用户。

#1


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:

根据App Store的指导方针,你不应该在没有得到用户的事先许可的情况下获取用户的个人数据。您可以匿名使用的唯一标识符是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.

这个标识符对于用户设备上的所有应用程序都是通用的。如果所有应用程序都从设备中删除,标识符可能会改变。更多。

#2


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.

最好的办法是在iOS上使用GameCenter来识别玩家。这个链接提供了更多关于使用GameCenter处理用户的信息。

#3


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).

就像@Marat说的,你要找的是UUID,但是要记住这个值可能会改变(例如,如果用户删除了你的应用,而没有其他的应用)。

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

一种可能的解决方案是将UUID值保存在keychain中,这样您将始终使用相同的值。

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

编辑:因为你的应用是一个游戏,你可以使用苹果的GameCenter。这将为您标识用户。