Read the original article:How Quick Apps Obtain Device ID
Context
Developers working with HarmonyOS Quick Apps need device identification capabilities similar to traditional applications, but face limitations due to privacy protection measures that restrict access to OAID and ODID identifiers.
Description
HarmonyOS applications can obtain device identifiers through OAID and ODID, but Quick Apps do not support these methods. The system provides different types of device identifiers, each serving specific purposes:
AAID (Application Anonymous Identifier)
- 32-character application instance identifier that exists only during installation period
- Enhanced privacy attributes with the following characteristics:
- Anonymous with no privacy risks - AAID is not associated with any existing identifiers
- Each application can only access its own AAID
- Different applications from the same developer on the same device have different AAID values
- Applications from different developers on the same device have different AAID values
- Applications from the same developer on different devices have different AAID values
- Applications from different developers on different devices have different AAID values
OAID (Open Anonymous Device Identifier)
- Non-permanent open anonymous device identifier
- Protects user privacy while enabling personalized advertising and supports advertising conversion analysis
ODID (Developer Anonymous Device Identifier)
- Device identifier specifically for developers
- Same ODID for applications from the same developer running on the same device
- Helps developers understand user behavior across different applications for personalized services and recommendations
Solution / Approach
HarmonyOS prioritizes user privacy protection by not exposing OAID and ODID to Quick Apps. Developers should use AAID as the primary device identifier, keeping in mind that it regenerates with each application reinstallation.
For scenarios requiring cross-application data correlation:
- Local Data Sharing: Applications and Quick Apps are treated as separate entities by the OS, so local data sharing is not recommended
- Cloud-Based Solutions: Use cloud-based capabilities with account identifiers like OpenID and UnionID for user correlation through Huawei Account Unified Authentication Service
- Session Management: AAID cannot bind sessions across different applications on the same device due to its unique-per-application nature
Key Takeaways
- HarmonyOS restricts access to persistent device identifiers in Quick Apps to protect user privacy
- AAID provides anonymized identification but changes with each reinstallation and differs between applications from the same developer
- AAID cannot be used to bind sessions across different applications on the same device
- For data sharing between applications and Quick Apps, use cloud-based approaches with account-based identifiers
- ODID is generated by the system's underlying layer and cannot be modified by ordinary tools or third-party applications
Top comments (0)