mattermoran / map_launcher

Flutter plugin for launching maps
MIT License
259 stars 116 forks source link

A few pointers to add support for "dbnavigator", "lyft", "moovit", "com.sygic.aura", "tomtomgo", "transit" and "uber" app schemes #99

Closed androidseb closed 2 years ago

androidseb commented 2 years ago

Looking at the Info.plist sample from the install instructions, I see a few items that we could add: "dbnavigator", "lyft", "moovit", "com.sygic.aura", "tomtomgo", "transit" and "uber".

Current Info.plist:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>comgooglemaps</string>
    <string>baidumap</string>
    <string>iosamap</string>
    <string>waze</string>
    <string>yandexmaps</string>
    <string>yandexnavi</string>
    <string>citymapper</string>
    <string>mapswithme</string>
    <string>osmandmaps</string>
    <string>dgis</string>
    <string>qqmap</string>
    <string>here-location</string>
</array>

Suggested update:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>comgooglemaps</string>
    <string>baidumap</string>
    <string>iosamap</string>
    <string>waze</string>
    <string>yandexmaps</string>
    <string>yandexnavi</string>
    <string>citymapper</string>
    <string>mapswithme</string>
    <string>osmandmaps</string>
    <string>dgis</string>
    <string>qqmap</string>
    <string>here-location</string>
    <string>dbnavigator</string>
    <string>lyft</string>
    <string>moovit</string>
    <string>com.sygic.aura</string>
    <string>tomtomgo</string>
    <string>transit</string>
    <string>uber</string>
</array>

Here is a copy paste from my iOS react native app's code regarding those new map apps, along with links to the code/docs where I got this from:

let latLonStrComma = _poi.latitude + ',' + _poi.longitude;
let lonLatStrPipe = _poi.longitude + '|' + _poi.latitude;

//...

{
    // Source: https://github.com/kiliankoe/Karte/blob/master/Sources/App.swift
    name: 'DB Navigator',
    url: 'dbnavigator://query?ZKOORD=1&ZY=' + Math.round(_poi.latitude * 1000000) + '&ZX=' + Math.round(_poi.longitude * 1000000),
},
{
    // Source: https://github.com/kiliankoe/Karte/blob/master/Sources/App.swift
    name: 'Lyft',
    url: 'lyft://ridetype?id=lyft&destination[latitude]=' + _poi.latitude + '&destination[longitude]=' + _poi.longitude,
},
{
    // Source: https://github.com/kiliankoe/Karte/blob/master/Sources/App.swift
    name: 'Moovit',
    url: 'moovit://directions?dest_lat=' + _poi.latitude + '&dest_lon=' + _poi.longitude,
},
{
    // Source: https://www.sygic.com/developers/professional-navigation-sdk/ios/custom-url
    name: 'Sygic',
    url: 'com.sygic.aura://coordinate|' + lonLatStrPipe + '|show',
},
{
    // Source: https://discussions.tomtom.com/en/discussion/1118783/url-schemes-for-go-navigation-ios
    name: 'TomTom',
    url: 'tomtomgo://x-callback-url/navigate?destination=' + latLonStrComma,
},
{
    // Source: https://github.com/kiliankoe/Karte/blob/master/Sources/App.swift
    name: 'Transit App',
    url: 'transit://directions?to=' + latLonStrComma,
},
{
    // Source: https://developer.uber.com/docs/riders/ride-requests/tutorials/deep-links/introduction
    name: 'Uber',
    url: 'uber://?action=setPickup&pickup=my_location&dropoff[latitude]=' + _poi.latitude + '&dropoff[longitude]=' + _poi.longitude,
},

I hope these pointers help, I might submit a PR to help with implementing these in the future, although I don't have any timeline or commitment. Before I work on a PR though, could you confirm that adding those is something you would approve, even if some map providers don't support something as basic as a display title for the marker being opened?

mattermoran commented 2 years ago

@androidseb yeah we def could add those. Thanks for providing the reference for deeplinking into those maps. Title and others don't matter much and are not supported in most of the maps as long as there latlong then should be ok :) PRs are always welcome. I will also take a look at those today, may add some :)

mattermoran commented 2 years ago

Created https://github.com/mattermoran/map_launcher/issues/111 for tracking new map requests.