[iOS]Initial WunderLINQ Support

This commit is contained in:
keithconger 2020-06-03 19:15:26 -06:00 committed by Aleksey Belousov
parent a502f1873e
commit 508e104adf
3 changed files with 33 additions and 0 deletions

View file

@ -832,4 +832,30 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
[[MWMAlertViewController activeAlertController] presentInfoAlert:L(@"load_kmz_title") text:L(@"load_kmz_failed")];
}
- (BOOL)canBecomeFirstResponder {
return YES;
}
- (NSArray *)keyCommands {
return @[[UIKeyCommand keyCommandWithInput:UIKeyInputDownArrow modifierFlags:0 action:@selector(zoomOut) discoverabilityTitle:@"Zoom Out"],
[UIKeyCommand keyCommandWithInput:UIKeyInputUpArrow modifierFlags:0 action:@selector(zoomIn) discoverabilityTitle:@"Zoom In"],
[UIKeyCommand keyCommandWithInput:UIKeyInputEscape modifierFlags:0 action:@selector(goBack) discoverabilityTitle:@"Go Back"]];
}
- (void)zoomOut {
GetFramework().Scale(Framework::SCALE_MIN, true);
}
- (void)zoomIn {
GetFramework().Scale(Framework::SCALE_MAG, true);
}
- (void)goBack {
NSString *backURL = [DeepLinkHandler.shared getBackUrl];
BOOL canOpenURL = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:backURL]];
if (canOpenURL){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:backURL] options:@{} completionHandler:nil];
}
}
@end

View file

@ -106,6 +106,12 @@ class DeepLinkURL {
deeplinkURL = nil
}
func getBackUrl() -> String {
guard let urlString = deeplinkURL?.url.absoluteString else { return "" }
guard let url = URLComponents(string: urlString) else { return "" }
return (url.queryItems?.first(where: { $0.name == "backurl" })?.value ?? "")
}
private func convertUniversalLink(_ universalLink: URL) -> URL {
let convertedLink = String(format: "mapsme:/%@?%@", universalLink.path, universalLink.query ?? "")
return URL(string: convertedLink)!

View file

@ -116,6 +116,7 @@
<string>maximzakaz</string>
<string>vzt</string>
<string>mytaxi</string>
<string>wunderlinq</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>