我在同一设备上运行具有相同 API 的不同应用程序。但到服务器的 UUID 不同。如何使用相同的设备和 API 向两个应用程序发送相同的 UUID。我该如何解决这个问题。我希望在同一设备中具有不同应用程序的相同 UUID。
不同的 UUI 在这里:- 1: 0D0B5F8F-9D4D-44E6-ACA2-DF9DA634FA53 2:738927AD-C795-4C4C-9D41-AB0FCD7357E1
let imei = UIDevice.current.identifierForVendor?.uuidString
Print(imei)
最佳答案
以下是 identifierForVendor 中的一些有用摘录文档:
-
If the app was not installed from the app store (such as enterprise apps and apps still in development), then a vendor identifier is calculated based on the app’s bundle ID. The bundle ID is assumed to be in reverse-DNS format.
On iOS 6, the first two components of the bundle ID are used to generate the vendor ID. if the bundle ID only has a single component, then the entire bundle ID is used.
On IOS 7, all components of the bundle except for the last component are used to generate the vendor ID. If the bundle ID only has a single component, then the entire bundle ID is used.
例如,在 iOS 7.x+ 上,给定 bundle ID com.example.app.app1
com.example.app
将用于计算供应商 ID(仅省略最后一个组件)。由于您的目标平台可能是 iOS 7+,因此请确保您的应用程序的 bundle 标识符仅在最后一个组件中有所不同。
- 另一件需要记住的事情如下:
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.
关于ios - 同一设备中的不同 UUID。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49707550/