UIDevice uniqueIdentifier deprecated - What to do now?
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
In recent years, privacy and data security have become paramount within the tech industry, leading to significant changes in how devices and apps handle user data. A notable evolution in Apple's iOS platform is the deprecation of UIDevice uniqueIdentifier. This article explores the implications of this deprecation, alternatives you can use, and guidelines for handling user identification more securely and responsibly.
Understanding UIDevice uniqueIdentifier
UIDevice uniqueIdentifier was an API used in iOS to obtain a unique identifier for an iOS device. Until its deprecation, it was commonly used by developers to track devices for analytics, personalization, and user-related activities. The identifier provided by this API was unique to each device and remained constant across app installs and system reboots, making it a reliable means of identifying a specific device.
Deprecation Reasons
The primary reason for deprecating UIDevice uniqueIdentifier relates to privacy concerns. A constant device identifier could lead to persistent tracking of users without their explicit consent, violating user privacy. Apple recognized these risks and decided that the drawbacks outweighed the benefits, particularly as GDPR and similar legislations require more stringent data privacy practices.
What to Do Now?
With the deprecation of UIDevice uniqueIdentifier, developers need to adapt their apps to use alternatives that align with privacy standards. Several options are available, each with its own use cases, benefits, and limitations.
1. Use identifierForVendor
identifierForVendor is provided by the UIDevice class and returns a unique UUID that identifies a device to the app's vendor. Here's how you can use it:
- Pros: It changes if the user deletes all apps from the same vendor and reinstalls them, aligning with user expectations of privacy.
- Cons: Not suitable for identifying the same device across apps from different vendors.
2. App-Specific UUIDs
Developers can generate and store their own UUIDs within the app's sandbox. This identifier will remain unique to the app unless the user deletes and reinstalls the app.
- Pros: Fully under developer control and app-specific, preventing cross-app tracking.
- Cons: The identifier is lost if the user deletes the app.
3. Advertising Identifier (IDFA)
For apps that specifically need to track users for advertising, the Advertising Identifier (IDFA) can be used. However, users have the ability to limit ad tracking, and IDFA access is stricter.
- Pros: Designed for advertising and allows tracking with user consent.
- Cons: Subject to user opt-out, making it unreliable as a sole identifier.
Key Considerations
| Identifier | Use Cases | Pros | Cons |
identifierForVendor | Intra-vendor app tracking | Changes if all apps are deleted/reinstalled. | Cannot track across different vendors. |
| App-Specific UUID | Unique per-app identification | Developer controlled, ensures privacy. | Deletes with the app. |
| IDFA | Advertising and tracking | Tracks users across apps, conforms to ad industry standards. | Subject to user opt-out, privacy concerns. |
Additional Considerations
- User Consent: It is crucial to obtain explicit user consent before tracking or storing any form of device or user identifier. This aligns with legal standards and reinforces trust.
- Transparency: Inform users why their data is being collected and how it will be used. Transparency should be part of an app’s core design philosophy.
- Data Security: Implement robust security measures to protect the identifiers and any associated data stored within your app.
- Regular Updates: Stay informed about platform changes and be ready to update your app as new privacy guidelines are established or old methods become obsolete.
Conclusion
The deprecation of UIDevice uniqueIdentifier reflects Apple's commitment to enhancing user privacy by limiting device tracking capabilities. While this creates challenges for developers, several viable alternatives facilitate user identification compliant with new privacy norms. Adjusting to these changes is not only necessary for compliance but also beneficial for cultivating a positive user relationship based on respect and transparency.
Related reading
- Unable to communicate with kafka server using kafka Producer API
- Unable to configure UDP on ingress-nginx-controller
- Unable to connect to the server dial tcp i/o time out
- Unable to connect to the server net/http TLS handshake timeout
- Unable to connect to Postgres DB due to the authentication type 10 is not supported
- Unable to export Apple production push SSL certificate in .p12 format
- UIFont - how to get system thin font
- UIGestureRecognizer blocks subview for handling touch events

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.