cordova-plugin-android-permissions
cordova-plugin-android-permissions copied to clipboard
Can't request WRITE_EXTERNAL_STORAGE on android 7
Can't request WRITE_EXTERNAL_STORAGE on android 7, requestPermission simply returns with status.hasPermission set to false.
It does not request for permission.
The same will work if I ask for the CAMERA permission.
I get same with READ_EXTERNAL_STORAGE
Hi there - same is happening with READ_CONTACTS or GET_ACCOUNTS or WRITE_CONTACTS... Thanks
Just want to add. It seems that it is working if you upgrade cordova to the latest version (cli-8.0.0). I removed my other plugins for the build to work - however it did ask me. Will update the current plugins and hopefully all should be good again. Please shout if this also worked for you or not? Thanks and Happy Coding...
@bpocallaghan,
I'm having the same issue, and am currently running cordova 8.0.0. I literally cannot request the permission
Hi @mikeThurmond Seems the hook did not work, honesty not sure if this will work, as I did not work with this package since then (only do phonegap apps every so often) Below is all the packages I have in my config for when I wanted to use the contacts plugin as well.
<preference name="phonegap-version" value="cli-8.0.0" />
<preference name="deployment-target" value="8.0" />
<preference name="android:minSdkVersion" value="16" />
<preference name="android-targetSdkVersion" value="26" />
<preference name="android-build-tool" value="gradle" />
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<engine name="cordova" spec="^8.0.0" />
<engine name="cordova-ios" spec="^4.3.1" />
<plugin name="cordova-plugin-device" spec="^2.0.1" />
<plugin name="cordova-plugin-file" spec="^6.0.1" />
<plugin name="cordova-plugin-geolocation" spec="^4.0.1" />
<plugin name="cordova-plugin-inappbrowser" spec="^2.0.2" />
<plugin name="cordova-plugin-network-information" spec="^2.0.1" />
<plugin name="cordova-plugin-statusbar" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="cordova-plugin-analytics" spec="^1.4.3" />
<plugin name="phonegap-plugin-barcodescanner" spec="^7.1.1" />
<plugin name="cordova-plugin-sms" spec="^1.0.5" />
<plugin name="cordova-plugin-contacts" spec="^3.0.1" />
<plugin name="cordova-plugin-android-permissions" spec="^1.0.0" />
<plugin name="cordova-plugin-camera" spec="^4.0.2" />
<plugin name="cordova-plugin-advanced-http" spec="^1.11.1" />
Hopefully you notice something, or the package owner will be able to assist more. :)
@bpocallaghan, Thanks for responding. I actually edited a hook I found online to request WRITE_EXTERNAL_STORAGE and it works.
This is still an issue. requestPermission acts exactly like checkPermission for CAMERA and MANAGE_EXTERNAL_STORAGE permissions. Not working on Cordova 9.0.1. Fails with no errors or logs output.
Just for information, the WRITE_EXTERNAL_STORAGE can only be requested for API 30+(android 11). The plugin does not support a mechanism for requesting this permission. To solve the issue i developed a plugin, which requests the permission. https://github.com/GAGANsinghmsitece/cordova-manage-external-storage