DevSkim/guidance/DS165348.md

27 строки
1.1 KiB
Markdown

# Do not attempt to access device UDID
## Summary
* Code that references `uniqueIdentifier` was found.
* Replace usage of `uniqueIdentifier` with `identifierForVendor` or if your application has a service component,
use the `DeviceCheck` API.
## Details
Access to the device `UDID` (via [[UIDevice currentDevice] uniqueIdentifier]) is deprecated as of iOS 5 and removed as of iOS7.
## Solution
Replace usage of `uniqueIdentifier` with `identifierForVendor`.
Note that `identifierForVendor` may change if the user uninstalls all applications from a vendor and then re-installs an application from that vendor.
If your application has a service component, consider using the `DeviceCheck` API.
## Severity Considerations
Applications relying on `uniqueIdentifier` can no longer target current, supported iOS versions and must be updated.
## Resources
* [Apple API Documentation: identifierForVendor](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor)
* [Apple API Documentation: DeviceCheck](https://developer.apple.com/documentation/devicecheck)