react-native-map-link 3.9.0 → 3.10.1

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/app.plugin.js CHANGED
@@ -38,18 +38,36 @@ const intents = ['geo', 'waze'].map((app) => {
38
38
  * @type {import('@expo/config-plugins').ConfigPlugin}
39
39
  */
40
40
  module.exports = function withReactNativeMapLink(config) {
41
- // eslint-disable-next-line no-shadow
42
41
  config = withAndroidManifest(config, async (config) => {
43
42
  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);
43
+ intents.forEach((newIntent) => {
44
+ const newScheme = newIntent.data.$['android:scheme'];
45
+ const existing = intent.some((intentItem) => {
46
+ const existingScheme =
47
+ intentItem.data?.[0]?.$?.['android:scheme'] ||
48
+ intentItem.data?.$?.['android:scheme'];
49
+ return existingScheme === newScheme;
50
+ });
51
+ if (!existing) {
52
+ intent.push(newIntent);
53
+ }
54
+ });
55
+
56
+ config.modResults.manifest.queries[0].intent = intent;
46
57
  return config;
47
58
  });
48
59
 
49
- // eslint-disable-next-line no-shadow
50
- return withInfoPlist(config, (config) => {
51
- config.modResults.LSApplicationQueriesSchemes =
52
- config.modResults.LSApplicationQueriesSchemes?.concat(schemes) ?? schemes;
60
+ config = withInfoPlist(config, (config) => {
61
+ const existing = config.modResults.LSApplicationQueriesSchemes ?? [];
62
+ schemes.forEach((scheme) => {
63
+ if (!existing.includes(scheme)) {
64
+ existing.push(scheme);
65
+ }
66
+ });
67
+
68
+ config.modResults.LSApplicationQueriesSchemes = existing;
53
69
  return config;
54
70
  });
71
+
72
+ return config;
55
73
  };
@@ -1,3 +1,4 @@
1
+ import { type ImageRequireSource } from 'react-native';
1
2
  import type { MapId } from './type';
2
3
  export declare const isIOS: boolean;
3
4
  export declare const generatePrefixes: ({ alwaysIncludeGoogle, naverCallerName, }: {
@@ -6,7 +7,7 @@ export declare const generatePrefixes: ({ alwaysIncludeGoogle, naverCallerName,
6
7
  }) => Record<MapId, string>;
7
8
  export declare const prefixForGoogleMaps: (alwaysIncludeGoogle?: boolean) => string;
8
9
  export declare const generateTitles: (titles?: Record<string, string>) => Record<string, string>;
9
- export declare const icons: Record<string, number>;
10
+ export declare const icons: Record<string, ImageRequireSource>;
10
11
  export declare const appKeys: string[];
11
12
  export declare const colorsPopup: {
12
13
  black: string;
package/lib/type.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ImageSourcePropType } from 'react-native';
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
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';
4
4
  export type DirectionMode = 'car' | 'walk' | 'public-transport' | 'bike';
@@ -12,7 +12,7 @@ export interface SharedOptions {
12
12
  export type GetAppsResponse = {
13
13
  id: MapId;
14
14
  name: string;
15
- icon: ImageSourcePropType;
15
+ icon: ImageRequireSource;
16
16
  /** function to link user to map app */
17
17
  open: () => Promise<string | null | undefined>;
18
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-map-link",
3
- "version": "3.9.0",
3
+ "version": "3.10.1",
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",
@@ -44,7 +44,7 @@
44
44
  "@babel/core": "^7.23.9",
45
45
  "@babel/eslint-parser": "^7.23.10",
46
46
  "@babel/eslint-plugin": "^7.23.5",
47
- "@babel/runtime": "^7.23.9",
47
+ "@babel/runtime": "^7.28.4",
48
48
  "@expo/config-plugins": "^7.8.4",
49
49
  "@react-native-community/eslint-config": "^3.2.0",
50
50
  "@types/jest": "^29.5.12",