react-native-map-link 2.11.1 → 2.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -48,7 +48,7 @@ npm i -S react-native-map-link # or yarn add react-native-map-link
48
48
 
49
49
  Based on the platforms your app supports, you also need to:
50
50
 
51
- <details>
51
+ <details id="iOSPostInstall">
52
52
  <summary><strong>iOS – Update Info.plist</strong></summary>
53
53
 
54
54
  To allow your app to detect if any of the directions apps are installed, an extra step is required on iOS. Your app needs to provide the `LSApplicationQueriesSchemes` key inside `ios/{my-project}/Info.plist` to specify the URL schemes with which the app can interact.
@@ -84,7 +84,7 @@ Using Expo? [Read the instructions](docs/expo.md) to make it work on iOS.
84
84
 
85
85
  </details>
86
86
 
87
- <details>
87
+ <details id="androidPostInstall">
88
88
  <summary><strong>Android – Update AndroidManifest.xml</strong></summary>
89
89
 
90
90
  When switching to Android 11/Android SDK 30 (i.e. using Expo SDK 41), this library doesn't work out of the box anymore. The reason is the new [Package Visibilty](https://developer.android.com/training/package-visibility) security feature. We'll have to update our `AndroidManifest.xml` to explicitly allow querying for other apps.
@@ -205,7 +205,7 @@ More info [here](https://stackoverflow.com/a/67383641/1129689).
205
205
  <details>
206
206
  <summary><strong>Expo – Update app.json</strong></summary>
207
207
 
208
- [Read the instructions here](docs/expo.md) to make it work on iOS.
208
+ [Read the instructions here](docs/expo.md)
209
209
 
210
210
  </details>
211
211
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-map-link",
3
- "version": "2.11.1",
3
+ "version": "2.11.2",
4
4
  "description": "Open the map app of the user's choice with a specific location",
5
5
  "main": "index.js",
6
6
  "repository": {
package/src/index.js CHANGED
@@ -43,7 +43,7 @@ export async function showLocation(options) {
43
43
  let sourceLng;
44
44
  let sourceLatLng;
45
45
 
46
- if ('sourceLatitude' in options && 'sourceLongitude' in options) {
46
+ if (options.sourceLatitude != null && options.sourceLongitude != null) {
47
47
  useSourceDestiny = true;
48
48
  sourceLat = parseFloat(options.sourceLatitude);
49
49
  sourceLng = parseFloat(options.sourceLongitude);
@@ -125,12 +125,16 @@ export async function showLocation(options) {
125
125
  case 'apple-maps':
126
126
  const appleDirectionMode = getDirectionsModeAppleMaps();
127
127
  url = prefixes['apple-maps'];
128
- if (useSourceDestiny) {
129
- url = `${url}?saddr=${sourceLatLng}&daddr=${latlng}`;
128
+ if (useSourceDestiny || options.directionsMode) {
129
+ url = `${url}?daddr=${latlng}`;
130
+ url += sourceLatLng ? `&saddr=${sourceLatLng}` : '';
130
131
  } else if (!options.appleIgnoreLatLon) {
131
132
  url = `${url}?ll=${latlng}`;
132
133
  }
133
- url += useSourceDestiny || !options.appleIgnoreLatLon ? '&' : '?';
134
+ url +=
135
+ useSourceDestiny || options.directionsMode || !options.appleIgnoreLatLon
136
+ ? '&'
137
+ : '?';
134
138
  url += `q=${title ? encodedTitle : 'Location'}`;
135
139
  url += appleDirectionMode ? `&dirflg=${appleDirectionMode}` : '';
136
140
  break;