From a7fb93c46c0f902a35a7e7da977ba05d0c5164dd Mon Sep 17 00:00:00 2001 From: VladiMihaylenko Date: Tue, 21 Jun 2016 16:07:50 +0300 Subject: [ios] Open urls in system safari. --- iphone/Maps/Categories/UIKitCategories.mm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'iphone') diff --git a/iphone/Maps/Categories/UIKitCategories.mm b/iphone/Maps/Categories/UIKitCategories.mm index 9003883595..31d16587cc 100644 --- a/iphone/Maps/Categories/UIKitCategories.mm +++ b/iphone/Maps/Categories/UIKitCategories.mm @@ -344,8 +344,14 @@ - (void)openUrl:(NSURL *)url { + UIApplication * app = [UIApplication sharedApplication]; + if ([app canOpenURL:url]) + [app openURL:url]; + // TODO(Vlad): Correct implementation of navigation controller's buttons. + /* NSString * scheme = url.scheme; - if ((isIOS7 || isIOS8) && (![scheme isEqualToString:@"http"] || ![scheme isEqualToString:@"https"])) + NSAssert(([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]), @"Incorrect url's scheme!"); + if ((isIOS7 || isIOS8)) { UIApplication * app = [UIApplication sharedApplication]; if ([app canOpenURL:url]) @@ -355,6 +361,7 @@ SFSafariViewController * svc = [[SFSafariViewController alloc] initWithURL:url]; svc.delegate = self; [self.navigationController pushViewController:svc animated:YES]; + */ } @end -- cgit v1.2.3