dpa99c / cordova-diagnostic-plugin

Cordova/Phonegap plugin to manage device settings
540 stars 361 forks source link

phonegap permission for bluetooth without bluetooth #353

Closed aoreinoso closed 5 years ago

aoreinoso commented 5 years ago

I wrote in https://stackoverflow.com/questions/51230731/phonegap-permission-for-bluetooth-without-bluetooth

Phonegap

config.xml

...
<preference name="android-build-tool" value="gradle" />
...
<preference name="phonegap-version" value="cli-8.0.0" />
...
<preference name="cordova.plugins.diagnostic.modules" value="CAMERA" />
....
<plugin name="cordova.plugins.diagnostic"/>

My app does not work with bluetooth however when installing it requires permission to link with bluetooth devices

phonegap log

...
...
Fetching plugin "cordova.plugins.diagnostic" via npm
...
...

If I erase <preference name="cordova.plugins.diagnostic.modules" value="CAMERA" /> or I write <preference name="cordova.plugins.diagnostic.modules" value="" /> everything remains the same

I work with phonegap... ... I dont install or re-install the plugins..

thanks in advance

dpa99c commented 5 years ago

Duplicate #347

As outlined in the the documentation:

IMPORTANT: Because Phonegap Build does not support npm-scripts hooks (see here for details) the module selection mechanism of this plugin will not work on Phonegap Build. I.e. all modules will be included in the build.

This means all modules (including Bluetooth module) will be installed when using Phonegap Build.

It is a flaw of Phonegap Build that it supports neither npm or Cordova hook scripts so many plugins do not function correctly with it.

aoreinoso commented 5 years ago

Then Why only ask for permission to use bluetooth and not other features? Thanks in advance

dpa99c commented 5 years ago

=

Then Why only ask for permission to use bluetooth and not other features? Thanks in advance

Because the Bluetooth module registers a state change receiver on app startup and this implicitly requests runtime permission to use Bluetooth hence presents the permission dialog.

All other modules are included in the app build when using Phonegap Build but their permissions must be explicitly requested using API methods.

aoreinoso commented 5 years ago

Thank you very much