两个设备是否具有相同的"UUID" [英] Does two device will have the same 'UUID'

查看:105
本文介绍了两个设备是否具有相同的"UUID"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的iOS应用中,我必须限制用户在每台设备上使用iOS应用.为此,我找到了一个解决方案,我们可以使用 UUID(通用唯一标识符) identifierForVendor方法它将生成一个唯一的ID,以唯一地标识设备上的应用.(在这里,我没有使用 UDID(唯一设备标识符),因为如果应用程序使用UDID,Apple会拒绝该应用程序).

In my iOS app, I have to restrict the user to use iOS app per device. To do this I found a solution that we can use the identifierForVendor method of UUID (Universally Unique Identifier) which will generate a unique ID to uniquely identify an app on a device. (Here, I am not using UDID (Unique Device Identifier) because Apple rejects apps if the app uses UDID).

所以我的问题是,这两个设备是否有可能具有相同的 UUID .有什么主意吗?

So my question as is there any possibilities that the two devices will have the same UUID. any idea?

我还有一个疑问,就好像我在不同的两个设备上安装了同一个应用程序并将其 UUID 字符串保存到设备 KeyChain 中一样.这两台设备具有相同的 iCloud 帐户.现在,在对这两个设备进行 iCloud 同步时,我的设备 KeyChain 会被覆盖吗?

I have one more doubt as if I installed the same app on different two devices and save its UUID string into the device KeyChain. Both devices have same iCloud account. Now while doing iCloud sync for this two devices, is one my device KeyChain will gets overwritten?

我发现EDIT 1的答案是是的,通过 iCloud钥匙串 keychain 将被同步到我的另一台设备上,我得到了相同的设备标识符从这里,也从下面回答'

I have found answer for EDIT 1 as 'Yes, through iCloud Keychain, the keychain would be synced to another one of my devices, and I’d get the same device identifier from here and from below answer too'

要与 iCloud钥匙串同步的商品,我需要明确设置 kSecAttrSynchronizable 属性.使用 SecItem API,我们可以在添加钥匙串项目时设置此属性.

For the item to be synced with iCloud keychain, I’d need to explicitly set the kSecAttrSynchronizable attribute. Using the SecItem API, we can set this attribute while adding a keychain item.

有没有教程如何在 Keychain 中添加项目(没有第三方库)?

Is there any tutorial how to add item in Keychain (Without third party libraries)?

推荐答案

否,两个设备没有相同的 UUID .我对此100%肯定.因此,请使用 identifierForVendor 方法.

No, Two device does not have the same UUID. I am 100% Sure about it. So go with identifierForVendor method.

但是,当您在设备中重新安装应用程序时, UUID 可能会更改(如果同一供应商没有其他应用程序).

But, The UUID may be changed when you reinstall the the application in your device (If there is not other application for the same vendor).

在iOS设备上安装了该应用程序(或来自同一供应商的另一个应用程序)时,此属性中的值保持不变.当用户从设备上删除该供应商的所有应用程序,然后重新安装其中一个或多个应用程序时,该值将更改.使用Xcode安装测试版本或使用临时发行版在设备上安装应用程序时,该值也会更改.因此,如果您的应用将此属性的值存储在任何位置,则应妥善处理标识符更改的情况.

The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. The value can also change when installing test builds using Xcode or when installing an app on a device using ad-hoc distribution. Therefore, if your app stores the value of this property anywhere, you should gracefully handle situations where the identifier changes.

编辑

您的问题

我还有一个疑问,就好像我在不同的两个设备上安装了相同的应用程序并将其UUID字符串保存到设备KeyChain中一样.这两台设备具有相同的iCloud帐户.现在,在为这两个设备进行iCloud同步时,我的设备KeyChain会被覆盖吗?

I have one more doubt as if I installed the same app on different two devices and save its UUID string into the device KeyChain. Both devices have same iCloud account. Now while doing iCloud sync for this two devices, is one my device KeyChain will gets overwritten?

答案

是.您的钥匙串将被覆盖.因此,两个设备的UUID相同.

YES. Your keychain will gets overwritten. So you have same UUID for both 2 devices.

这篇关于两个设备是否具有相同的"UUID"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆