using cordova-diagnostic-plugin modules with Ionic 4 + Capacitor
See original GitHub issueThe only details I can find around this issue is an unanswered question on the forum here.
The documentation for cordova-diagnostic-plugin
says that you can add the following line to your config.xml
to only import the modules you need from the diagnostic plugin:
<preference name="cordova.plugins.diagnostic.modules" value="[list of modules]" />
However unlike Cordova, Capacitor doesn’t have the equivalent config.xml
file. If I modify the file ios/App/App/config.xml
to remove the additional modules, they are automatically re-added when I re-run the npx cap copy
/npx cap sync
commands.
The issue with this is that I have to declare additional keys in my Info.plist
file requesting permission for features I am not going to use (Bluetooth for example). Once I add the keys, my app gets rejected by Apple because I am requesting permissions to use Bluetooth in the background but my binary does not use Apple’s Bluetooth Module.
Does anyone have any ideas or suggestions on how to import selected modules only from the cordova-diagnostic-plugin
when using Capacitor?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
I have managed to update it with the following steps:
Create an empty
config.xml
file in the project root directory then add only the following line to it:<preference name="cordova.plugins.diagnostic.modules" value="LOCATION" />
That work for me. config.xml.zip