react-native-map-link 3.10.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 +25 -7
- package/package.json +1 -1
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
|
-
|
|
45
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
};
|