Releases: thongvo109/did_change_biometric
Releases Β· thongvo109/did_change_biometric
Release list
v1.0.0 - Real-time Native Stream & Persistent State
Breaking Changes
- Dart SDK: Minimum SDK bumped to
>=3.0.0 <4.0.0(Dart 3 with sound null safety) - Flutter: Minimum Flutter version bumped to
>=3.10.0 - Android: Minimum SDK bumped to API 23 (Android 6.0)
- iOS: Minimum deployment target bumped to iOS 12.0
- Internal platform-specific methods are now private (
_checkBiometricIOS,_checkBiometricAndroid)
New Features
onBiometricChangedstream β β Real-time biometric monitoring via nativeEventChannelon both iOS and Android. No Dart-side polling or lifecycle hacks needed.- Android: Uses Kotlin Coroutines
StateFlow+DefaultLifecycleObserver.onResume+ periodic polling fallback (5s) - iOS: Uses
NotificationCenter.willEnterForegroundNotification+LAContext.evaluatedPolicyDomainStatetoken comparison - Both platforms implement
distinctUntilChangednatively β Dart only receives events when status actually changes
- Android: Uses Kotlin Coroutines
- Swift Package Manager support (Issue #9) β Added
Package.swiftfor SPM compatibility, migrating the iOS plugin to Pure Swift Architecture and resolving module conflicts. - Android face recognition note (Issue #7) β Clarified that Android KeyStore invalidation natively detects Face Recognition changes only if the device manufacturer implements it as a Class 3 (Strong) biometric (e.g. Pixel 4).
- Persistent AuthLocalStatus binding (Feature Request) β The
AuthLocalStatus.changedstate now stays bound (locked) across app restarts until explicitly released by calling the newacknowledgeChange()API. - iOS
checkmethod β iOS now supports the samecheckMethodChannel call as Android, enabling consistent cross-platform one-shot checks - iOS
BiometricStreamHandlerβ Full nativeFlutterStreamHandlerimplementation with lifecycle observation, baseline token tracking, and automatic cleanup
Bug Fixes
- Fixed Android plugin running unreachable code after
result.success()/result.error() - Fixed iOS
authenticateBiometricusing deprecatedbase64EncodedData()instead ofbase64EncodedString() - Fixed example app missing
dispose()forWidgetsBindingObserver(memory leak) - Fixed example app typo
HomwPageβHomePage
Improvements
- Platform-agnostic Dart code: Both iOS and Android now emit through the same
EventChannelwith identical status strings β the Dart layer is completely platform-agnostic - No more WidgetsBindingObserver: All lifecycle monitoring is handled natively (Kotlin + Swift), eliminating Dart-side workarounds
- Added comprehensive dartdoc comments throughout the API
- Added
@visibleForTestingannotation formethodChannelandeventChannel - Used Dart 3 switch expressions instead of switch statements
- Used typed
invokeMethod<String>calls for type safety - Upgraded Android Kotlin from 1.6.10 β 1.9.22
- Upgraded Android Gradle Plugin from 4.1.0 β 7.4.2
- Upgraded Android compileSdk from 31 β 34
- Upgraded Android Java target from 1.8 β 17
- Added Kotlin Coroutines 1.7.3 and AndroidX Lifecycle 2.7.0 dependencies
- Added
namespaceinbuild.gradle(required by AGP 7+) - Removed deprecated
packageattribute fromAndroidManifest.xml - Upgraded
flutter_lintsto v5