dpa99c / cordova-diagnostic-plugin

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

cordova diagnostic plugin requestExternalStorageAuthorization is returning DENIES_ALWAYS #507

Closed Mahesh-Zeham closed 1 year ago

Mahesh-Zeham commented 1 year ago

Bug report

CHECKLIST

Current behavior:

Expected behavior: It should request the external storage permission. For example, If i want to access my photo library/file. It should request the permission.

Steps to reproduce:

Create a sample cordova app. Install the cordova-diagnostic-plugin cordova-diagnostic-plugin. Then try to check and request the externalstorage access using the below code as mentioned in the plugin document.

cordova.plugins.diagnostic.requestExternalStorageAuthorization(function(status){ console.log("Authorization request for external storage use was " + (status == cordova.plugins.diagnostic.permissionStatus.GRANTED ? "granted" : "denied")); }, function(error){ console.error(error); });

Here im always getting the status as "DENIED_ALWAYS"

Screenshots

Environment information

Runtime issue

Android build issue:

Related code:

insert any relevant code here such as plugin API calls / input parameters

Console output

requestExternalStorageAuthorization always returning as DENIED_ALWAYS ``` // Paste any relevant JS/native console output here ```


dpa99c commented 1 year ago

External storage permission is removed in Android 13, so if building with API 33+, you must use the new MEDIA permissions instead - see here