react-native-map-link 3.2.1 → 3.2.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/app.plugin.js ADDED
@@ -0,0 +1,52 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
2
+ const {withAndroidManifest, withInfoPlist} = require('@expo/config-plugins');
3
+
4
+ const schemes = [
5
+ 'comgooglemaps',
6
+ 'citymapper',
7
+ 'uber',
8
+ 'lyft',
9
+ 'transit',
10
+ 'truckmap',
11
+ 'waze',
12
+ 'yandexnavi',
13
+ 'moovit',
14
+ 'yandextaxi',
15
+ 'yandexmaps',
16
+ 'kakaomap',
17
+ 'tmap',
18
+ 'szn-mapy',
19
+ 'mapsme',
20
+ 'osmandmaps',
21
+ 'gett',
22
+ 'nmap',
23
+ 'dgis',
24
+ 'lftgpas',
25
+ ];
26
+
27
+ const intents = ['geo', 'waze'].map((app) => {
28
+ return {
29
+ action: {$: {'android:name': 'android.intent.action.VIEW'}},
30
+ data: {$: {'android:scheme': app}},
31
+ };
32
+ });
33
+
34
+ /**
35
+ * @type {import('@expo/config-plugins').ConfigPlugin}
36
+ */
37
+ module.exports = function withReactNativeMapLink(config) {
38
+ // eslint-disable-next-line no-shadow
39
+ config = withAndroidManifest(config, async (config) => {
40
+ let intent = config.modResults.manifest.queries[0].intent ?? [];
41
+ // @ts-expect-error unnecessary type gymnastics
42
+ config.modResults.manifest.queries[0].intent = intent.concat(intents);
43
+ return config;
44
+ });
45
+
46
+ // eslint-disable-next-line no-shadow
47
+ return withInfoPlist(config, (config) => {
48
+ config.modResults.LSApplicationQueriesSchemes =
49
+ config.modResults.LSApplicationQueriesSchemes?.concat(schemes) ?? schemes;
50
+ return config;
51
+ });
52
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-map-link",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
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",
@@ -37,7 +37,8 @@
37
37
  "react-native": ">=0.40.0"
38
38
  },
39
39
  "files": [
40
- "lib"
40
+ "lib",
41
+ "app.plugin.js"
41
42
  ],
42
43
  "devDependencies": {
43
44
  "@babel/core": "^7.23.9",
@@ -1,2 +0,0 @@
1
- declare const _exports: import('@expo/config-plugins').ConfigPlugin;
2
- export = _exports;
package/lib/app.plugin.js DELETED
@@ -1,49 +0,0 @@
1
- "use strict";
2
- // eslint-disable-next-line @typescript-eslint/no-var-requires
3
- const { withAndroidManifest, withInfoPlist } = require('@expo/config-plugins');
4
- const schemes = [
5
- 'comgooglemaps',
6
- 'citymapper',
7
- 'uber',
8
- 'lyft',
9
- 'transit',
10
- 'truckmap',
11
- 'waze',
12
- 'yandexnavi',
13
- 'moovit',
14
- 'yandextaxi',
15
- 'yandexmaps',
16
- 'kakaomap',
17
- 'tmap',
18
- 'szn-mapy',
19
- 'mapsme',
20
- 'osmandmaps',
21
- 'gett',
22
- 'nmap',
23
- 'dgis',
24
- 'lftgpas',
25
- ];
26
- const intents = ['geo', 'waze'].map((app) => {
27
- return {
28
- action: { $: { 'android:name': 'android.intent.action.VIEW' } },
29
- data: { $: { 'android:scheme': app } },
30
- };
31
- });
32
- /**
33
- * @type {import('@expo/config-plugins').ConfigPlugin}
34
- */
35
- module.exports = function withReactNativeMapLink(config) {
36
- // eslint-disable-next-line no-shadow
37
- config = withAndroidManifest(config, async (config) => {
38
- let intent = config.modResults.manifest.queries[0].intent ?? [];
39
- // @ts-expect-error unnecessary type gymnastics
40
- config.modResults.manifest.queries[0].intent = intent.concat(intents);
41
- return config;
42
- });
43
- // eslint-disable-next-line no-shadow
44
- return withInfoPlist(config, (config) => {
45
- config.modResults.LSApplicationQueriesSchemes =
46
- config.modResults.LSApplicationQueriesSchemes?.concat(schemes) ?? schemes;
47
- return config;
48
- });
49
- };