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

[local_auth] Fix iOS app crash issue: alerts should be alled in the m… #3352

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
3 changes: 1 addition & 2 deletions packages/local_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
## 1.1.0

* Migrate to null safety.
* Allow pin, passcode, and pattern authentication with `authenticate` method.
* Fix incorrect error handling switch case fallthrough.
* Fix crash on biometric lockout
* Update README for Android Integration.
* Update the example app: remove the deprecated `RaisedButton` and `FlatButton` widgets.
* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276)).
Expand Down
11 changes: 8 additions & 3 deletions packages/local_auth/ios/Classes/FLTLocalAuthPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ - (void)alertMessage:(NSString *)message
}];
[alert addAction:additionalAction];
}
[[UIApplication sharedApplication].delegate.window.rootViewController presentViewController:alert
animated:YES
completion:nil];
@try {
dispatch_async(dispatch_get_main_queue(), ^{
[[UIApplication sharedApplication].delegate.window.rootViewController presentViewController:alert animated:YES completion:nil];
});
} @catch (NSException *exception) {
NSLog(@"Exception presentViewController: %@", exception);
} @finally {
}
}

- (void)getAvailableBiometrics:(FlutterResult)result {
Expand Down