persistent_device_id
A Flutter plugin that provides a persistent app-scoped device ID for Android and iOS.
2.0.0
2.9K downloads/mo
#4680 most downloaded on pub.dev
maeltoukap/persistent_device_id
What this package is like to depend on
Last release 1 months ago
11 Jul 2026
Too new to tell
only 2 release windows
Nearly every release is documented
notes for 3 of 3 stable releases
Nothing withdrawn
no release was ever pulled
1 years old
3 releases · first in 2025
1 release in the last 12 months
see the full history below
Release timeline
3 releases · Jun 2025 to Jul 2026Releases
latest 3-
2.0.011 Jul 2026Release notes
Open source →persistent_device_id v2.0.0
This release raises the minimum SDK floor, strengthens ID persistence and migration on Android and iOS, and modernizes the plugin structure (Swift Package Manager). The public API
PersistentDeviceId.getDeviceId()remains unchanged.⚠️ Breaking change: Dart
^3.11.0and Flutter>=3.41.0are now required, and the iOS deployment target moves from 12.0 to 13.0.Changed
- Raised the package SDK floor to Dart
^3.11.0and Flutter>=3.41.0. - Routed the Dart API through the platform interface (removed the scaffolded
getPlatformVersiontemplate code). - Updated AndroidX Security Crypto to the stable
1.1.0release; lowered AndroidminSdkto 21. - Android: fallback writes are now synchronous and checked, with automatic migration from app-private fallback storage into encrypted preferences; the plaintext entry is only removed after a successful encrypted write.
- iOS: moved source into a Swift Package Manager-friendly layout (CocoaPods support retained).
- iOS: Keychain storage now uses a service-scoped item and automatically migrates the legacy account-only identifier from earlier releases; the migrated scoped entry is preferred on reads, and the legacy item is only removed once migration is safe.
- iOS: Keychain reads are now status-aware, so a temporary storage failure returns
nullinstead of creating a second identifier. - Rewrote the README with clearer guarantees, platform differences, and persistence limitations.
- Refreshed package metadata, tests, and the example app for publish readiness.
Added
- Swift Package Manager manifest for iOS.
- Privacy manifest bundled through both Swift Package Manager and CocoaPods.
- Dart tests for API stability, repeated calls, method-channel forwarding, and nullable platform responses.
- Android native unit tests for
getDeviceIdand unknown method handling. - Native persistence tests for failed writes, fallback migration, corrupted values, legacy Keychain migration, and unavailable storage.
Migration from 1.x
- The Dart API remains
PersistentDeviceId.getDeviceId()— no application code changes required. - Dart
^3.11.0and Flutter>=3.41.0are now required. - The iOS deployment target increases from 12.0 to 13.0.
- Existing iOS account-only Keychain IDs are migrated automatically on the first call after upgrading. A readable legacy ID remains valid even if the migration write cannot complete. The migrated scoped entry is preferred on later reads, while the legacy item remains until it can be removed safely.
- Android app-private fallback IDs are migrated into encrypted preferences once encrypted storage becomes available. The plaintext fallback entry is removed only after a successful encrypted write.
- A
nullresult means the native implementation could not obtain or durably persist an ID. Method channel registration errors continue to throw.
Full Changelog: 1.1.0...2.0.0
Release notes
Open source →Changed
- Raised the package SDK floor to Dart
^3.11.0and Flutter>=3.41.0. - Kept the public API stable as
PersistentDeviceId.getDeviceId(). - Routed the Dart API through the platform interface and removed scaffolded
getPlatformVersioncode. - Updated AndroidX Security Crypto to stable
1.1.0. - Lowered Android minSdk to 21.
- Changed Android fallback writes to synchronous, checked persistence and added migration from app-private fallback storage into encrypted preferences, removing the plaintext fallback entry after a successful encrypted write.
- Moved iOS source into a Swift Package Manager-friendly layout while keeping CocoaPods support.
- Updated iOS Keychain storage to use a service-scoped item and migrate the legacy account-only item from earlier releases while preferring the new service-scoped entry on subsequent reads.
- Made iOS Keychain reads status-aware so temporary storage failures return
nullinstead of creating a second identifier. - Rewrote README documentation with clearer guarantees, platform differences, and persistence limitations.
- Refreshed package metadata, tests, and the example app for publish readiness.
- Kept the example integration-test plugin available to Flutter 3.44 release builds so the generated Android plugin registrant compiles successfully.
Added
- Swift Package Manager manifest for iOS.
- Privacy manifest bundling through both Swift Package Manager and CocoaPods.
- Dart tests for API stability, repeated calls, method-channel forwarding, and nullable platform responses.
- Android native unit tests for
getDeviceIdand unknown method handling. - Native persistence tests for failed writes, fallback migration, corrupted values, legacy Keychain migration, and unavailable storage.
Migration from 1.x
- The Dart API remains
PersistentDeviceId.getDeviceId(). - Dart
^3.11.0and Flutter>=3.41.0are now required. - The iOS deployment target increases from 12.0 to 13.0.
- Existing iOS account-only Keychain IDs are migrated automatically on the first call after upgrading. A readable legacy ID remains valid even if the migration write cannot complete. The migrated scoped entry is preferred on later reads, while the legacy item remains until it can be removed safely.
- Android app-private fallback IDs are migrated into encrypted preferences when encrypted storage becomes available. The plaintext fallback entry is removed only after a successful encrypted write.
- A
nullresult means the native implementation could not obtain or durably persist an ID. Method channel registration errors continue to throw.
- Raised the package SDK floor to Dart
-
1.1.012 Jun 2025Release notes
Open source →Release notes
Open source →Added
- iOS support using Keychain for persistent device identification.
- Automatic fallback to a generated UUID stored in the Keychain on iOS.
- Improved platform abstraction layer.
- Updated README and documentation.
-
1.0.012 Jun 2025Release notes
Open source →Added
- Initial release of
persistent_device_id. - Android support using
MediaDrm.deviceUniqueIdwhere available. - Fallback UUID storage using Android Keystore and encrypted shared preferences.
- Public method:
PersistentDeviceId.getDeviceId(). - Example app demonstrating usage.
- Initial release of