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

* Migrate to null safety.
* Allow pin, passcode, and pattern authentication with `authenticate` method.
* Fix incorrect error handling switch case fallthrough.
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