Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cordova diagnostic plugin requestExternalStorageAuthorization is returning DENIES_ALWAYS #507

Closed
1 task
Mahesh-Zeham opened this issue Nov 6, 2023 · 1 comment

Comments

@Mahesh-Zeham
Copy link

Bug report

CHECKLIST

  • [*] I have read the issue reporting guidelines

  • [*] I confirm this is a suspected bug or issue that will affect other users

  • [*] I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.

  • [*] I have read the documentation thoroughly and it does not help solve my issue.

  • I have checked that no similar issues (open or closed) already exist.

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

  • Cordova CLI version
    • cordova -v
      12.0.0 (cordova-lib@12.0.1)
  • Cordova platform version
    android 12.0.1
  • Plugins & versions installed in project (including this plugin)
    • cordova plugin ls
      cordova.plugins.diagnostic 7.1.3 "Diagnostic"

Runtime issue

  • Device details
    - e.g. Oneplus 9R, Redmi 9
  • OS details
    • e.g. Android 13, 12, Android 9.0

Android build issue:

  • Node JS version v16.20.1
    • node -v
  • Gradle version
    • ls platforms/android/.gradle
  • Android SDK version
    "MIN_SDK_VERSION":24,"SDK_VERSION":33,"COMPILE_SDK_VERSION":null,"GRADLE_VERSION":"7.6","MIN_BUILD_TOOLS_VERSION":"33.0.2"

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
Copy link
Owner

dpa99c commented Nov 6, 2023

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

@dpa99c dpa99c closed this as completed Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants