Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[local_auth] support localizedFallbackTitle in IOSAuthMessages #2616

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/local_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.4

* Add support `localizedFallbackTitle` in authenticateWithBiometrics on iOS.

## 0.6.3+3

* Update android compileSdkVersion to 29.
Expand Down
5 changes: 5 additions & 0 deletions packages/local_auth/ios/Classes/FLTLocalAuthPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ - (void)authenticateWithBiometrics:(NSDictionary *)arguments
self.lastCallArgs = nil;
self.lastResult = nil;
context.localizedFallbackTitle = @"";
if (arguments[@"localizedFallbackTitle"] != (NSString *)[NSNull null]) {
context.localizedFallbackTitle = arguments[@"localizedFallbackTitle"];
} else {
context.localizedFallbackTitle = @"";
}

if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
error:&authError]) {
Expand Down
3 changes: 3 additions & 0 deletions packages/local_auth/lib/auth_strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ class IOSAuthMessages {
this.goToSettingsButton,
this.goToSettingsDescription,
this.cancelButton,
this.localizedFallbackTitle,
});

final String lockOut;
final String goToSettingsButton;
final String goToSettingsDescription;
final String cancelButton;
final String localizedFallbackTitle;

Map<String, String> get args {
return <String, String>{
Expand All @@ -74,6 +76,7 @@ class IOSAuthMessages {
'goToSettingDescriptionIOS':
goToSettingsDescription ?? iOSGoToSettingsDescription,
'okButton': cancelButton ?? iOSOkButton,
'localizedFallbackTitle': localizedFallbackTitle,
};
}
}
Expand Down
3 changes: 2 additions & 1 deletion packages/local_auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: local_auth
description: Flutter plugin for Android and iOS device authentication sensors
such as Fingerprint Reader and Touch ID.
homepage: https://github.com/flutter/plugins/tree/master/packages/local_auth
version: 0.6.3+3
version: 0.6.4


flutter:
plugin:
Expand Down