Added Moovit to available Open In options

This commit is contained in:
Ilya Laktyushin 2019-07-11 02:39:52 +02:00
parent f5e2d58a84
commit d28e6ebe57
2 changed files with 15 additions and 2 deletions

View File

@ -228,9 +228,7 @@
<false/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>dbapi-3</string>
<string>instagram</string>
<string>googledrive</string>
<string>comgooglemaps-x-callback</string>
<string>foursquare</string>
<string>here-location</string>
@ -257,6 +255,7 @@
<string>opera-https</string>
<string>firefox-focus</string>
<string>ddgQuickLink</string>
<string>moovit</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>

View File

@ -192,6 +192,20 @@ private func allOpenInOptions(context: AccountContext, item: OpenInItem) -> [Ope
return .openUrl(url: "yandexnavi://build_route_on_map?lat_to=\(lat)&lon_to=\(lon)")
}))
}
options.append(OpenInOption(application: .other(title: "Moovit", identifier: 498477945, scheme: "moovit", store: nil), action: {
if withDirections {
let destName: String
if let title = location.venue?.title.addingPercentEncoding(withAllowedCharacters: .urlQueryValueAllowed), title.count > 0 {
destName = title
} else {
destName = ""
}
return .openUrl(url: "moovit://directions?dest_lat=\(lat)&dest_lon=\(lon)&dest_name=\(destName)&partner_id=Telegram")
} else {
return .openUrl(url: "moovit://nearby?lat=\(lat)&lon=\(lon)&partner_id=Telegram")
}
}))
if !withDirections {
options.append(OpenInOption(application: .other(title: "HERE Maps", identifier: 955837609, scheme: "here-location", store: nil), action: {