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 {
|
- (void)openUrl:(NSString *)urlString withPromise:(DoricPromise *)promise {
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
NSURL *url = [NSURL URLWithString:urlString];
|
NSURL *url = [NSURL URLWithString:urlString];
|
||||||
if ([[UIApplication sharedApplication] canOpenURL:url]) {
|
[UIApplication.sharedApplication openURL:url options:@{} completionHandler:^(BOOL success) {
|
||||||
[[UIApplication sharedApplication] openURL:url];
|
if (success) {
|
||||||
[promise resolve:nil];
|
[promise resolve:nil];
|
||||||
} else {
|
} else {
|
||||||
[promise reject:@"Cannot open"];
|
[promise reject:@"Cannot open"];
|
||||||
}
|
}
|
||||||
|
}];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@end
|
@end
|
Reference in New Issue
Block a user