react-native-map-link 3.10.0 → 3.11.0

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
@@ -35,6 +35,7 @@ on their device. The app supports Apple Maps, Google Maps, Citymapper, Uber, and
35
35
  - Liftago - `liftago`
36
36
  - Petal Maps - `petalmaps` (Android only)
37
37
  - Sygic - `sygic`
38
+ - TomTom GO - `tomtomgo` (IOS only)
38
39
 
39
40
  </details>
40
41
 
package/app.plugin.js CHANGED
@@ -9,6 +9,7 @@ const schemes = [
9
9
  'transit',
10
10
  'truckmap',
11
11
  'waze',
12
+ 'tomtomgo',
12
13
  'yandexnavi',
13
14
  'moovit',
14
15
  'yandextaxi',
@@ -38,18 +39,36 @@ const intents = ['geo', 'waze'].map((app) => {
38
39
  * @type {import('@expo/config-plugins').ConfigPlugin}
39
40
  */
40
41
  module.exports = function withReactNativeMapLink(config) {
41
- // eslint-disable-next-line no-shadow
42
42
  config = withAndroidManifest(config, async (config) => {
43
43
  let intent = config.modResults.manifest.queries[0].intent ?? [];
44
- // @ts-expect-error unnecessary type gymnastics
45
- config.modResults.manifest.queries[0].intent = intent.concat(intents);
44
+ intents.forEach((newIntent) => {
45
+ const newScheme = newIntent.data.$['android:scheme'];
46
+ const existing = intent.some((intentItem) => {
47
+ const existingScheme =
48
+ intentItem.data?.[0]?.$?.['android:scheme'] ||
49
+ intentItem.data?.$?.['android:scheme'];
50
+ return existingScheme === newScheme;
51
+ });
52
+ if (!existing) {
53
+ intent.push(newIntent);
54
+ }
55
+ });
56
+
57
+ config.modResults.manifest.queries[0].intent = intent;
46
58
  return config;
47
59
  });
48
60
 
49
- // eslint-disable-next-line no-shadow
50
- return withInfoPlist(config, (config) => {
51
- config.modResults.LSApplicationQueriesSchemes =
52
- config.modResults.LSApplicationQueriesSchemes?.concat(schemes) ?? schemes;
61
+ config = withInfoPlist(config, (config) => {
62
+ const existing = config.modResults.LSApplicationQueriesSchemes ?? [];
63
+ schemes.forEach((scheme) => {
64
+ if (!existing.includes(scheme)) {
65
+ existing.push(scheme);
66
+ }
67
+ });
68
+
69
+ config.modResults.LSApplicationQueriesSchemes = existing;
53
70
  return config;
54
71
  });
72
+
73
+ return config;
55
74
  };
package/lib/constants.js CHANGED
@@ -29,6 +29,7 @@ const generatePrefixes = ({ alwaysIncludeGoogle, naverCallerName, }) => {
29
29
  petalmaps: 'petalmaps://',
30
30
  sygic: 'com.sygic.aura://',
31
31
  here: 'here-route://',
32
+ tomtomgo: 'tomtomgo://',
32
33
  };
33
34
  };
34
35
  exports.generatePrefixes = generatePrefixes;
@@ -64,6 +65,7 @@ const generateTitles = (titles) => {
64
65
  petalmaps: 'Petal Maps',
65
66
  sygic: 'Sygic',
66
67
  here: 'Here We Go',
68
+ tomtomgo: 'TomTom GO',
67
69
  ...(titles || {}),
68
70
  };
69
71
  };
@@ -93,6 +95,7 @@ exports.icons = {
93
95
  petalmaps: require('./images/petalmaps.png'),
94
96
  sygic: require('./images/sygic.png'),
95
97
  here: require('./images/here.png'),
98
+ tomtomgo: require('./images/tomtomgo.png'),
96
99
  };
97
100
  exports.appKeys = Object.keys(exports.icons);
98
101
  exports.colorsPopup = {
Binary file
package/lib/type.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { ImageRequireSource } from 'react-native';
2
2
  /** id for map application. this is the id that is passed to the `app` option */
3
- export type MapId = 'apple-maps' | 'google-maps' | 'citymapper' | 'uber' | 'lyft' | 'transit' | 'truckmap' | 'waze' | 'yandex' | 'moovit' | 'yandex-maps' | 'yandex-taxi' | 'kakaomap' | 'tmap' | 'mapycz' | 'maps-me' | 'osmand' | 'gett' | 'navermap' | 'dgis' | 'liftago' | 'petalmaps' | 'sygic' | 'here';
3
+ export type MapId = 'apple-maps' | 'google-maps' | 'citymapper' | 'uber' | 'lyft' | 'transit' | 'truckmap' | 'waze' | 'yandex' | 'moovit' | 'yandex-maps' | 'yandex-taxi' | 'kakaomap' | 'tmap' | 'mapycz' | 'maps-me' | 'osmand' | 'gett' | 'navermap' | 'dgis' | 'liftago' | 'petalmaps' | 'sygic' | 'here' | 'tomtomgo';
4
4
  export type DirectionMode = 'car' | 'walk' | 'public-transport' | 'bike';
5
5
  /** options shared across different types */
6
6
  export interface SharedOptions {
package/lib/utils.js CHANGED
@@ -448,6 +448,14 @@ const generateMapUrl = ({ app, directionsMode, appleIgnoreLatLon, googleForceLat
448
448
  url = `https://share.here.com/r/${sourceLat && sourceLng ? `${sourceLat},${sourceLng}/` : ''}${lat},${lng}?m=d`;
449
449
  }
450
450
  break;
451
+ case 'tomtomgo':
452
+ if (address) {
453
+ throw new MapsException('tomtomgo does not support passing the address or has not been implemented yet.');
454
+ }
455
+ else {
456
+ url = `${prefixes.tomtomgo}x-callback-url/navigate?destination=${latlng}`;
457
+ }
458
+ break;
451
459
  }
452
460
  return url;
453
461
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-map-link",
3
- "version": "3.10.0",
3
+ "version": "3.11.0",
4
4
  "description": "Open the map app of the user's choice with a specific location.",
5
5
  "source": "src/index",
6
6
  "main": "lib/index.js",
@@ -65,7 +65,7 @@
65
65
  "react": "^18.2.0",
66
66
  "react-native": "^0.73.4",
67
67
  "react-native-typescript-transformer": "^1.2.13",
68
- "semantic-release": "^23.0.2",
68
+ "semantic-release": "^25.0.2",
69
69
  "ts-jest": "^29.1.2",
70
70
  "typescript": "^5.3.3"
71
71
  },