getDeviceId method

Future<String?> getDeviceId()

Retrieves a unique identifier for the device.

On Android, this attempts to use a hardware-backed Widevine DRM ID, falling back to the Android ID (device_info_plus) if unavailable. On iOS, this generates a unique UUID or uses the vendor ID, and securely persists it in the iOS Keychain across app reinstalls.

Returns a Future<String?> containing the device ID, prefixed with either android_ or ios_.

Implementation

Future<String?> getDeviceId() {
  return DeviceSecurityPlatform.instance.getDeviceId();
}