简体   繁体   English

在Swift中识别iPhone UID的最佳方法是什么?

[英]What's the best way to identify an iPhone UID in Swift?

I want to know the unique ID of that iPhone. 我想知道该iPhone的唯一ID。 How can I get that in Swift? 我怎样才能在Swift中得到它? Is it allowed by Apple to store it? 苹果可以存储吗? We use it to ensure that people don't create multiple accounts. 我们使用它来确保人们不会创建多个帐户。

You can use this to get an unique string identifier in Swift: 您可以使用它在Swift中获取唯一的字符串标识符:

UIDevice.currentDevice().identifierForVendor.UUIDString

This code returns a identifier that is unique for the device. 此代码返回设备唯一的标识符。 Please note it does not return Apple's Unique Device Identifier (UDID), which is a sequence of 40 letters and numbers as Apple has hidden the UDID from all public APIs, starting with iOS 7. 请注意,它不会返回Apple的唯一设备标识符(UDID),该IDID由40个字母和数字组成,因为Apple从iOS 7开始已对所有公共API隐藏了UDID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM