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

[local_auth] The alert should be called in the main thread. #3351

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 9 additions & 3 deletions packages/local_auth/ios/Classes/FLTLocalAuthPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,15 @@ - (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