iOS:openUrl do not check canOpenUrl
This commit is contained in:
parent
c1f71ba4dc
commit
a8cbdc0c1d
@ -53,12 +53,13 @@ - (void)pop:(NSDictionary *)params {
|
||||
- (void)openUrl:(NSString *)urlString withPromise:(DoricPromise *)promise {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
if ([[UIApplication sharedApplication] canOpenURL:url]) {
|
||||
[[UIApplication sharedApplication] openURL:url];
|
||||
[UIApplication.sharedApplication openURL:url options:@{} completionHandler:^(BOOL success) {
|
||||
if (success) {
|
||||
[promise resolve:nil];
|
||||
} else {
|
||||
[promise reject:@"Cannot open"];
|
||||
}
|
||||
}];
|
||||
});
|
||||
}
|
||||
@end
|
Reference in New Issue
Block a user