Skip to content

2.0.0

Latest

Choose a tag to compare

@maeltoukap maeltoukap released this 11 Jul 07:46
· 1 commit to main since this release

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.0 and Flutter >=3.41.0 are now required, and the iOS deployment target moves from 12.0 to 13.0.

Changed

  • Raised the package SDK floor to Dart ^3.11.0 and Flutter >=3.41.0.
  • Routed the Dart API through the platform interface (removed the scaffolded getPlatformVersion template code).
  • Updated AndroidX Security Crypto to the stable 1.1.0 release; lowered Android minSdk to 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 null instead 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 getDeviceId and 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.0 and Flutter >=3.41.0 are 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 null result 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