Skip to content

device.id vs installation.id on Android and iOS #1874

@bencehornak

Description

@bencehornak

Area(s)

area:device

What's missing?

Take a look at the current definition of device.id:

The device identifier MUST only be defined using the values outlined below. This value is not an advertising
identifier and MUST NOT be used as such.
On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor).
On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique
UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids)
on best practices and exact implementation details.
Caution should be taken when storing personal data or anything which can identify a user. GDPR and
data protection laws may apply, ensure you do your own due diligence.

The obligatory recommendation for Android (Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application) mostly mirrors the recommendation for Google

Use a Firebase installation ID (FID) or a privately stored GUID whenever possible for all other use cases, except for payment fraud prevention and telephony. For the vast majority of non-ads use cases, an FID or GUID should be sufficient.

The one for iOS suggests using identifierForVendor.

The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.

Now I have multiple remarks to these recommendations:

  1. None of the two Android recommendations and the one iOS recommendation are really device ids, they are more like installation ids. For consumer apps the difference is probably insignificant, however, for enterprise apps on managed Android/iOS devices it is important. One could have many managed applications on the same device, so the expectation for device.ids would be that they are identical across all apps, which neither the Firebase Installation ID, nor the random generated UUID or the iOS identifierForVendor fulfill.

  2. There is another ID, which fits my use case better on Android, called Settings.Secure.ANDROID_ID, because I don't want to use Firebase, but I want an ID which survives uninstalls, and which is consistent across all my in-house apps.

    ANDROID_ID:
    On Android 8.0 (API level 26) and higher versions of the platform, a 64-bit number (expressed as a hexadecimal string), unique to each combination of app-signing key, user, and device. [...]

  3. Although not recommended by Google for Android, one could still use actual device IDs, such as the IMEI or proprietary APIs provided by the vendor (e.g. Zebra's API), which are bound to the device for its whole lifetime. For enterprise-managed hardware there might be a legitimate use for such actual device ids, so these IDs would rather deserve to be the definition of device.id.

Describe the solution you'd like

I would recommend these 3 changes:

  1. Introduce a new attribute, called installation.id, and recommend it for most use-cases on Android and iOS.
  2. Use a similar description for installation.id, that device.id currently has, but extend it with the possibility to use Settings.Secure.ANDROID_ID
  3. Discourage the usage of device.id due to privacy reasons, but leave it open to custom implementations, such as IMEI or proprietary APIs.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions