diff --git a/iphone/CoreApi/CoreApi/DeepLink/DeepLinkParser.mm b/iphone/CoreApi/CoreApi/DeepLink/DeepLinkParser.mm index a83037313..7896b15e4 100644 --- a/iphone/CoreApi/CoreApi/DeepLink/DeepLinkParser.mm +++ b/iphone/CoreApi/CoreApi/DeepLink/DeepLinkParser.mm @@ -24,7 +24,11 @@ static inline DeeplinkUrlType deeplinkUrlType(url_scheme::ParsedMapApi::UrlType + (DeeplinkUrlType)parseAndSetApiURL:(NSURL *)url { Framework &f = GetFramework(); - return deeplinkUrlType(f.ParseAndSetApiURL(url.absoluteString.UTF8String)); + if ([url.scheme isEqual: @"geo-navigation"]) { + return deeplinkUrlType(f.ParseGeoNav(url.absoluteString.UTF8String, f)); + } else { + return deeplinkUrlType(f.ParseAndSetApiURL(url.absoluteString.UTF8String)); + } } + (void)executeMapApiRequest { diff --git a/iphone/Maps/CoMaps-Debug.entitlements b/iphone/Maps/CoMaps-Debug.entitlements index d09ed271a..fb32a8168 100644 --- a/iphone/Maps/CoMaps-Debug.entitlements +++ b/iphone/Maps/CoMaps-Debug.entitlements @@ -19,6 +19,8 @@ CloudDocuments CloudKit + com.apple.developer.navigation-app + com.apple.developer.ubiquity-container-identifiers iCloud.app.comaps.debug diff --git a/iphone/Maps/CoMaps-Release.entitlements b/iphone/Maps/CoMaps-Release.entitlements index 0e96a0801..c5ffab09a 100644 --- a/iphone/Maps/CoMaps-Release.entitlements +++ b/iphone/Maps/CoMaps-Release.entitlements @@ -19,6 +19,8 @@ CloudDocuments CloudKit + com.apple.developer.navigation-app + com.apple.developer.ubiquity-container-identifiers iCloud.app.comaps diff --git a/iphone/Maps/CoMaps.plist b/iphone/Maps/CoMaps.plist index b8e7f4a8e..7505d2689 100644 --- a/iphone/Maps/CoMaps.plist +++ b/iphone/Maps/CoMaps.plist @@ -65,6 +65,7 @@ mapsme ge0 geo + geo-navigation om mapswithmepro @@ -89,7 +90,7 @@ NSExceptionDomains - comaps.at + comaps.app NSExceptionAllowsInsecureHTTPLoads @@ -98,7 +99,7 @@ NSThirdPartyExceptionRequiresForwardSecrecy - comaps.app + comaps.at NSExceptionAllowsInsecureHTTPLoads diff --git a/iphone/Maps/Core/DeepLink/DeepLinkHandler.swift b/iphone/Maps/Core/DeepLink/DeepLinkHandler.swift index aed08970f..35c3b9b72 100644 --- a/iphone/Maps/Core/DeepLink/DeepLinkHandler.swift +++ b/iphone/Maps/Core/DeepLink/DeepLinkHandler.swift @@ -91,7 +91,7 @@ switch urlType { case .route: if let adapter = DeepLinkRouteStrategyAdapter(url) { - MWMRouter.buildApiRoute(with: adapter.type, start: adapter.p1, finish: adapter.p2) + MWMRouter.buildApiRoute(with: adapter.type, start: adapter.pStart, intermediatePoint: adapter.pIntermediate, finish: adapter.pFinish) MapsAppDelegate.theApp().showMap() return true } diff --git a/iphone/Maps/Core/DeepLink/Strategies/DeepLinkRouteStrategyAdapter.h b/iphone/Maps/Core/DeepLink/Strategies/DeepLinkRouteStrategyAdapter.h index 7d42ead31..3d2df43fa 100644 --- a/iphone/Maps/Core/DeepLink/Strategies/DeepLinkRouteStrategyAdapter.h +++ b/iphone/Maps/Core/DeepLink/Strategies/DeepLinkRouteStrategyAdapter.h @@ -6,8 +6,9 @@ NS_ASSUME_NONNULL_BEGIN @class MWMRoutePoint; @interface DeepLinkRouteStrategyAdapter : NSObject -@property(nonatomic, readonly) MWMRoutePoint* p1; -@property(nonatomic, readonly) MWMRoutePoint* p2; +@property(nonatomic, readonly) MWMRoutePoint* pStart; +@property(nonatomic, readonly) MWMRoutePoint* pIntermediate; +@property(nonatomic, readonly) MWMRoutePoint* pFinish; @property(nonatomic, readonly) MWMRouterType type; - (nullable instancetype)init:(NSURL*)url; diff --git a/iphone/Maps/Core/DeepLink/Strategies/DeepLinkRouteStrategyAdapter.mm b/iphone/Maps/Core/DeepLink/Strategies/DeepLinkRouteStrategyAdapter.mm index 00e758e97..678301a10 100644 --- a/iphone/Maps/Core/DeepLink/Strategies/DeepLinkRouteStrategyAdapter.mm +++ b/iphone/Maps/Core/DeepLink/Strategies/DeepLinkRouteStrategyAdapter.mm @@ -11,11 +11,29 @@ auto const parsedData = GetFramework().GetParsedRoutingData(); auto const points = parsedData.m_points; - if (points.size() == 2) { - _p1 = [[MWMRoutePoint alloc] initWithURLSchemeRoutePoint:points.front() + for (auto point: points) { + if (point.m_type == RouteMarkType::Start) { + _pStart = [[MWMRoutePoint alloc] initWithURLSchemeRoutePoint:point + type:MWMRoutePointTypeStart + intermediateIndex:0]; + } else if (point.m_type == RouteMarkType::Finish) { + _pFinish = [[MWMRoutePoint alloc] initWithURLSchemeRoutePoint:point + type:MWMRoutePointTypeFinish + intermediateIndex:0]; + } else if (point.m_type == RouteMarkType::Intermediate) { + _pIntermediate = [[MWMRoutePoint alloc] initWithURLSchemeRoutePoint:point + type:MWMRoutePointTypeIntermediate + intermediateIndex:0]; + } + } + + if (_pStart && _pFinish) { + _type = routerType(parsedData.m_type); + } else if (points.size() == 2) { + _pStart = [[MWMRoutePoint alloc] initWithURLSchemeRoutePoint:points.front() type:MWMRoutePointTypeStart intermediateIndex:0]; - _p2 = [[MWMRoutePoint alloc] initWithURLSchemeRoutePoint:points.back() + _pFinish = [[MWMRoutePoint alloc] initWithURLSchemeRoutePoint:points.back() type:MWMRoutePointTypeFinish intermediateIndex:0]; _type = routerType(parsedData.m_type); diff --git a/iphone/Maps/Core/Routing/MWMRouter.h b/iphone/Maps/Core/Routing/MWMRouter.h index 86d8f5798..cc8f98ee8 100644 --- a/iphone/Maps/Core/Routing/MWMRouter.h +++ b/iphone/Maps/Core/Routing/MWMRouter.h @@ -56,6 +56,7 @@ typedef void (^MWMImageHeightBlock)(UIImage *, NSString *, NSString *); + (void)buildToPoint:(MWMRoutePoint *)finish bestRouter:(BOOL)bestRouter; + (void)buildApiRouteWithType:(MWMRouterType)type startPoint:(MWMRoutePoint *)startPoint + intermediatePoint:(MWMRoutePoint *)intermediatePoint finishPoint:(MWMRoutePoint *)finishPoint; + (void)rebuildWithBestRouter:(BOOL)bestRouter; diff --git a/iphone/Maps/Core/Routing/MWMRouter.mm b/iphone/Maps/Core/Routing/MWMRouter.mm index 9d2bdaceb..51bcf5cf6 100644 --- a/iphone/Maps/Core/Routing/MWMRouter.mm +++ b/iphone/Maps/Core/Routing/MWMRouter.mm @@ -255,6 +255,7 @@ char const *kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeIm + (void)buildApiRouteWithType:(MWMRouterType)type startPoint:(MWMRoutePoint *)startPoint + intermediatePoint:(MWMRoutePoint *)intermediatePoint finishPoint:(MWMRoutePoint *)finishPoint { if (!startPoint || !finishPoint) return; @@ -264,6 +265,9 @@ char const *kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeIm auto router = [MWMRouter router]; router.isAPICall = YES; [self addPoint:startPoint]; + if (intermediatePoint) { + [self addPoint:intermediatePoint]; + } [self addPoint:finishPoint]; router.isAPICall = NO; diff --git a/libs/map/framework.hpp b/libs/map/framework.hpp index 5b8f5c61e..a21808376 100644 --- a/libs/map/framework.hpp +++ b/libs/map/framework.hpp @@ -585,6 +585,13 @@ public: return m_parsedMapApi.SetUrlAndParse(url); } +#if defined(OMIM_OS_MAC) || defined(OMIM_OS_IPHONE) + url_scheme::ParsedMapApi::UrlType ParseGeoNav(std::string const & raw, Framework & fm) + { + return m_parsedMapApi.ParseGeoNav(raw, fm); + } +#endif + struct ParsedRoutingData { ParsedRoutingData(std::vector const & points, routing::RouterType type)