From 31491f824ab8cc7cf1d76da53a4ada6a624b9c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phile=CC=81mon=20Merlet?= Date: Fri, 3 Oct 2025 17:21:58 +0200 Subject: [PATCH 1/3] Add support for expo plugin --- app.plugin.js | 1 + package.json | 3 +++ plugin/withDidomi.js | 48 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 app.plugin.js create mode 100644 plugin/withDidomi.js diff --git a/app.plugin.js b/app.plugin.js new file mode 100644 index 00000000..97f2aaff --- /dev/null +++ b/app.plugin.js @@ -0,0 +1 @@ +module.exports = require("./plugin/withDidomi"); diff --git a/package.json b/package.json index 09d74e29..708732fe 100644 --- a/package.json +++ b/package.json @@ -86,5 +86,8 @@ } ] ] + }, + "dependencies": { + "@expo/config-plugins": "^54.0.2" } } diff --git a/plugin/withDidomi.js b/plugin/withDidomi.js new file mode 100644 index 00000000..e842e021 --- /dev/null +++ b/plugin/withDidomi.js @@ -0,0 +1,48 @@ +const { + withAndroidManifest, + withAppBuildGradle, + withInfoPlist, + createRunOncePlugin, +} = require("@expo/config-plugins"); + +const packageInfo = require("../package.json"); + +/* +const withMyLibraryAndroidManifest = (config) => { + return withAndroidManifest(config, (config) => { + const application = config.modResults.manifest.application[0]; + + // Example: add a permission + if (!config.modResults.manifest["uses-permission"]) { + config.modResults.manifest["uses-permission"] = []; + } + config.modResults.manifest["uses-permission"].push({ + $: { "android:name": "android.permission.CAMERA" }, + }); + + return config; + }); +} + + +// Modify Info.plist +const withDidomiInfoPlist = (config) => { + return withInfoPlist(config, (config) => { + config.modResults.NSLocationWhenInUseUsageDescription = + "This app uses location for ..."; + return config; + }); +}; +*/ + +const withDidomi = (config) => { +// config = withMyLibraryAndroidManifest(config); +// config = withMyLibraryInfoPlist(config); + return config; +}; + +module.exports = createRunOncePlugin( + withDidomi, + packageInfo.name, + packageInfo.version +) \ No newline at end of file From ce769c89540ad5d32c638604dd00b4afe09efe96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phile=CC=81mon=20Merlet?= Date: Wed, 8 Oct 2025 10:54:02 +0200 Subject: [PATCH 2/3] Cleanup --- package.json | 9 ++++++++- plugin/withDidomi.js | 37 +------------------------------------ 2 files changed, 9 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 708732fe..ed886cbe 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,9 @@ "!ios/build", "!**/__tests__", "!**/__fixtures__", - "!**/__mocks__" + "!**/__mocks__", + "app.plugin.js", + "plugin/" ], "workspaces": [ ".", @@ -89,5 +91,10 @@ }, "dependencies": { "@expo/config-plugins": "^54.0.2" + }, + "expo": { + "plugins": [ + "./plugin/withDidomi.js" + ] } } diff --git a/plugin/withDidomi.js b/plugin/withDidomi.js index e842e021..6ec86b60 100644 --- a/plugin/withDidomi.js +++ b/plugin/withDidomi.js @@ -1,43 +1,8 @@ -const { - withAndroidManifest, - withAppBuildGradle, - withInfoPlist, - createRunOncePlugin, -} = require("@expo/config-plugins"); +const { createRunOncePlugin } = require("@expo/config-plugins"); const packageInfo = require("../package.json"); -/* -const withMyLibraryAndroidManifest = (config) => { - return withAndroidManifest(config, (config) => { - const application = config.modResults.manifest.application[0]; - - // Example: add a permission - if (!config.modResults.manifest["uses-permission"]) { - config.modResults.manifest["uses-permission"] = []; - } - config.modResults.manifest["uses-permission"].push({ - $: { "android:name": "android.permission.CAMERA" }, - }); - - return config; - }); -} - - -// Modify Info.plist -const withDidomiInfoPlist = (config) => { - return withInfoPlist(config, (config) => { - config.modResults.NSLocationWhenInUseUsageDescription = - "This app uses location for ..."; - return config; - }); -}; -*/ - const withDidomi = (config) => { -// config = withMyLibraryAndroidManifest(config); -// config = withMyLibraryInfoPlist(config); return config; }; From 6f7a42252615b4c31309384472fd942b87b35374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phile=CC=81mon=20Merlet?= Date: Wed, 8 Oct 2025 11:00:12 +0200 Subject: [PATCH 3/3] Missing EOL --- plugin/withDidomi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/withDidomi.js b/plugin/withDidomi.js index 6ec86b60..ba3383d8 100644 --- a/plugin/withDidomi.js +++ b/plugin/withDidomi.js @@ -10,4 +10,4 @@ module.exports = createRunOncePlugin( withDidomi, packageInfo.name, packageInfo.version -) \ No newline at end of file +)