diff --git a/iphone/Maps/Categories/UIKitCategories.mm b/iphone/Maps/Categories/UIKitCategories.mm index 5d40cc1639..4fb8ce7065 100644 --- a/iphone/Maps/Categories/UIKitCategories.mm +++ b/iphone/Maps/Categories/UIKitCategories.mm @@ -4,6 +4,7 @@ #import "UIColor+MapsMeColor.h" #import "UIImageView+Coloring.h" +#import #import @implementation NSObject (Optimized) @@ -300,7 +301,16 @@ - (void)openUrl:(NSURL *)url { NSString * scheme = url.scheme; - NSAssert(([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]), @"Incorrect url's scheme!"); + if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]) + { + NSAssert(false, @"Incorrect url's scheme!"); + NSError * err = [[NSError alloc] initWithDomain:kMapsmeErrorDomain + code:0 + userInfo:@{@"Trying to open incorrect url" : url.absoluteString}]; + [[Crashlytics sharedInstance] recordError:err]; + return; + } + if (isIOS8) { UIApplication * app = [UIApplication sharedApplication]; @@ -308,6 +318,7 @@ [app openURL:url]; return; } + SFSafariViewController * svc = [[SFSafariViewController alloc] initWithURL:url]; svc.delegate = self; [self.navigationController presentViewController:svc animated:YES completion:nil]; diff --git a/iphone/Maps/Common/MWMCommon.h b/iphone/Maps/Common/MWMCommon.h index 9cb9eb52fd..2858ab1258 100644 --- a/iphone/Maps/Common/MWMCommon.h +++ b/iphone/Maps/Common/MWMCommon.h @@ -6,6 +6,8 @@ static NSString * const BOOKMARK_CATEGORY_DELETED_NOTIFICATION = static NSString * const BOOKMARK_DELETED_NOTIFICATION = @"BookmarkDeletedNotification"; +static NSString * const kMapsmeErrorDomain = @"com.mapsme.error"; + static CGFloat const kDefaultAnimationDuration = .2; static inline BOOL firstVersionIsLessThanSecond(NSString * first, NSString * second)