From ebc3909b446c5a4edb011e201f3eb997d1263976 Mon Sep 17 00:00:00 2001 From: Zoia Pribytkova Date: Mon, 11 Mar 2019 18:06:34 +0300 Subject: [PATCH] [iOS] "call" method implementation from the MWMActionBarProtocol to fix the "unrecognized selector" crash. https://jira.mail.ru/browse/MAPSME-9551 --- iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm index c604950b89..123b422c8e 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm @@ -462,6 +462,20 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [self.layout reloadBookmarkSection:NO]; } +- (void)call +{ + MWMPlacePageData *data = self.data; + if (!data) return; + NSString *filteredDigits = [[data.phoneNumber componentsSeparatedByCharactersInSet: + [[NSCharacterSet decimalDigitCharacterSet] invertedSet]] + componentsJoinedByString:@""]; + NSString *resultNumber = [data.phoneNumber hasPrefix:@"+"] ? [NSString stringWithFormat:@"+%@", filteredDigits] : filteredDigits; + NSURL *phoneURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel://%@", resultNumber]]; + if ([UIApplication.sharedApplication canOpenURL:phoneURL]) { + [UIApplication.sharedApplication openURL:phoneURL options:@{} completionHandler:nil]; + } +} + - (void)editBookmark { auto data = self.data;