cordova-plugin-android-permissions icon indicating copy to clipboard operation
cordova-plugin-android-permissions copied to clipboard

Storage permission not showing up

Open pixellet14 opened this issue 2 years ago • 2 comments

We have been trying this plugin on all versions from 7 to 14 and we have found that specifically in android version 13, Samsung models, the permission pop up for writing on the external storage isn't showing up. It doesn't even show an option to allow the storage in the phone settings > app > permissions

pixellet14 avatar Oct 09 '23 14:10 pixellet14

I'm also having the same problem.

const tryGetPermission = async () => {
  return new Promise((resolve, reject) => {
    const permissions = cordova.plugins.permissions;
    if (!permissions) {
      return resolve(false)
    }
    permissions.checkPermission(
      permissions.WRITE_EXTERNAL_STORAGE,
      async function(status) {
        if (status.hasPermission) {
          resolve(true);
        } else {
          permissions.requestPermission(// the permission pop up does not work.
            permissions.WRITE_EXTERNAL_STORAGE,
            async function(status) {
              resolve(status.hasPermission)//status.hasPermission = false
            },
            function() {
              reject(false);
            }
          );
        }
      },
      function() {
        reject(false);
      }
    );
  });
}

nomori7010 avatar Oct 10 '23 06:10 nomori7010

I'm also having the same problem.

const tryGetPermission = async () => {
  return new Promise((resolve, reject) => {
    const permissions = cordova.plugins.permissions;
    if (!permissions) {
      return resolve(false)
    }
    permissions.checkPermission(
      permissions.WRITE_EXTERNAL_STORAGE,
      async function(status) {
        if (status.hasPermission) {
          resolve(true);
        } else {
          permissions.requestPermission(// the permission pop up does not work.
            permissions.WRITE_EXTERNAL_STORAGE,
            async function(status) {
              resolve(status.hasPermission)//status.hasPermission = false
            },
            function() {
              reject(false);
            }
          );
        }
      },
      function() {
        reject(false);
      }
    );
  });
}

This is what I found https://developer.android.com/training/data-storage/manage-all-files

pixellet14 avatar Oct 10 '23 09:10 pixellet14