dpa99c / react-native-launch-navigator

A React Native module for launching today's most popular navigation/ride apps to navigate to a destination.
143 stars 34 forks source link

In ios getAvailableApps() returning only apple maps as true... #34

Closed gilshaan closed 3 years ago

gilshaan commented 4 years ago

Even though i have Uber and Google Maps in my iphone, its returning only apple maps as true..

Working fine in android.. the issue is only in ios

let appNames = [] LaunchNavigator.getAvailableApps() .then((apps) => { for (let app in apps) { if (apps[app] === true) appNames.push({ name: LaunchNavigator.getAppDisplayName(app), available: apps[app] }) }

dcosmin2003 commented 4 years ago

Hello, I'm facing the same problem. Any solution?

dcosmin2003 commented 4 years ago

I found the solution. You have to add these permissions in the Info.plist file (keep only the apps you need - in my case, only waze and google maps):

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>comgooglemaps</string>
    <string>citymapper</string>
    <string>uber</string>
    <string>lyft</string>
    <string>transit</string>
    <string>truckmap</string>
    <string>waze</string>
    <string>yandexnavi</string>
    <string>moovit</string>
    <string>yandextaxi</string>
    <string>yandexmaps</string>
    <string>kakaomap</string>
    <string>szn-mapy</string>
    <string>mapsme</string>
</array>

This should be added in the documentation.

amirulasrof commented 3 years ago

Thank you @dcosmin2003

dpa99c commented 3 years ago

The URL schemes were automatically added to the Info.plist by the postlink hook script but since autolinking was introduced in React Native v0.60, postlink/postunlink hooks are no longer supported so these are not getting executed. I'll need to see if there's another way these entries can be automatically added to the plist on module installation.

theoduong05 commented 1 year ago

I found the solution. You have to add these permissions in the Info.plist file (keep only the apps you need - in my case, only waze and google maps):

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>comgooglemaps</string>
    <string>citymapper</string>
    <string>uber</string>
    <string>lyft</string>
    <string>transit</string>
    <string>truckmap</string>
    <string>waze</string>
    <string>yandexnavi</string>
    <string>moovit</string>
    <string>yandextaxi</string>
    <string>yandexmaps</string>
    <string>kakaomap</string>
    <string>szn-mapy</string>
    <string>mapsme</string>
</array>

This should be added in the documentation.

Thanks