Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/iphone
diff options
context:
space:
mode:
authorZoia Pribytkova <niakris90@gmail.com>2019-03-11 18:06:34 +0300
committerAleksandr Zatsepin <alexzatsepin@users.noreply.github.com>2019-03-13 12:57:30 +0300
commitebc3909b446c5a4edb011e201f3eb997d1263976 (patch)
treedce4d98584929c0d7864e744be6182df3406c09d /iphone
parent257035c698d608399dc891f8b2a645e3d1a6dd3d (diff)
[iOS] "call" method implementation from the MWMActionBarProtocol to fix the "unrecognized selector" crash.
https://jira.mail.ru/browse/MAPSME-9551
Diffstat (limited to 'iphone')
-rw-r--r--iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm14
1 files changed, 14 insertions, 0 deletions
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;