Search packages, repositories and app categories

Package detailsv4.2.0

flutter_udid

Plugin to retrieve a persistent UDID across reinstalls on iOS and Android

AndroidiOSmacOSWindowsLinux
30-day downloads
144K
Likes
290
Pub points
160

Install package

flutter pub add flutter_udid

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

flutter_udid is a Flutter plugin that provides a persistent unique device identifier (UDID) across app reinstalls on Android, iOS, macOS, Windows, and Linux. It securely generates and stores a consistent ID tied to the device, making it useful for tracking user devices without relying on temporary or volatile identifiers. The plugin leverages platform-specific mechanisms to ensure reliability and privacy compliance. It's particularly helpful in scenarios requiring long-term device identification, such as licensing, analytics, or anti-fraud systems. The source code is publicly available on GitHub for transparency and customization.

Use cases

  • Device tracking across app reinstalls
  • Licensing and activation systems
  • User analytics and attribution
  • Anti-fraud and security monitoring

Key features

  • Persistent across app reinstallation
  • Cross-platform support (Android, iOS, macOS, Windows, Linux)
  • Secure storage of device ID
  • Uses native platform mechanisms
  • Open-source and transparent

Suitable for

  • Apps needing long-term device identification
  • Security-sensitive applications
  • Analytics and licensing platforms
  • Developers prioritizing privacy and compliance

Considerations

  • Requires appropriate permissions on Android and iOS
  • May raise privacy concerns if misused
  • Not suitable for identifying users directly
  • Depends on platform-level persistence mechanisms
  • Should be used with user consent and transparency

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

flutter_udid

pub package

Plugin to retrieve a persistent UDID across app reinstalls on iOS, Android, Mac, Windows & Linux.

Usage

import 'package:flutter_udid/flutter_udid.dart';

String udid = await FlutterUdid.udid;

This provides an UDID using the format of the corresponding platform.

Platform IDs

Platform Format Source
iOS 7946DA4E-8429-423C-B405-B3FC77914E3E identifierForVendor, saved to Keychain for persistence
Android 8af8770a27cfd182 Settings.Secure.ANDROID_ID
Mac 707E990C-D002-520B-ABA6-4216C6D514BF kIOPlatformUUIDKey
Windows 99A4D301-53F5-11CB-8CA0-9CA39A9E1F01 BIOS UUID
Linux 1124435e065241dcae2241e9caab9a6c Machine ID
iOS Keychain Availability

On iOS, the UDID is stored in Keychain with kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly. This means it is available only after the user has unlocked the device once after reboot, including later background launches while the device is locked. Before the first unlock after reboot, requesting the UDID throws a PlatformException.

Consistent Format

To get a consistent formatting on all platforms use:

import 'package:flutter_udid/flutter_udid.dart';

String udid = await FlutterUdid.consistentUdid;

This will result in an UDID of the following format:

984725b6c4f55963cc52fca0f943f9a8060b1c71900d542c79669b6dc718a64b

Persistence Notes

The UDID can change after a factory reset!

Additionally, if a device has been updated to Android 8.0 through an OTA and the app is reinstalled, the UDID may change as well due to security changes in Android 8.0.

On rooted and jailbroken devices the ID can be changed, so please take this into account. However, it should not be possible to identify as a different device through random guessing because of the complexity of the ID.

Furthermore, the UDID may also change if there is a change in the app's signing signature, for both iOS and Android. Ensure that you always use the same digital signature to sign your app.

Flutter Resources

For help getting started with Flutter, view the online documentation.

For help on editing plugin code, view the documentation.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package