cordova-plugin-sms icon indicating copy to clipboard operation
cordova-plugin-sms copied to clipboard

Permission Denial

Open manufuentescr opened this issue 8 years ago • 5 comments

permissions error on android 6.0.1

error list sms: Permission Denial: reading com.android.providers.telephony.SmsProvider uri content ://sms/inbox requires android.permission.READ_SMS , or grantUriPermission()

manufuentescr avatar Apr 26 '16 14:04 manufuentescr

@manufuentescr Same here. Have you fixed it yet?

bralat avatar May 10 '16 02:05 bralat

It would be nice to know if this plugin will be updated to handle changes in the latest Android versions and if that is the case when that updated plugin will be released.

ostdt avatar May 10 '16 21:05 ostdt

schermannj avatar Jun 29 '16 20:06 schermannj

Quick fix from http://stackoverflow.com/questions/37803513/android-6-permission-denied-for-reading-sms

Install cordova-plugin-android-permissions

cordova plugin add cordova-plugin-android-permissions

 function checkPermissionCallback(status) { 
          if (!status.hasPermission) {
          var errorCallback = function () {
            console.log('no sms permisions');
            ionic.Platform.exitApp();
          }
          permissions.requestPermission(permissions.READ_SMS, function (status) {
            if (!status.hasPermission) errorCallback();
          }, errorCallback);
        }
      }
  var permissions = window.plugins.permissions;
  permissions.hasPermission(permissions.READ_SMS, checkPermissionCallback, null);

radumardale avatar Jul 04 '16 12:07 radumardale

I am not using Ionic . Working at Cordova .But Not working. Any Possible way to Declare device Ready function to Set a Permission to Read the SMS in Cordova

Imam-N avatar Feb 11 '19 06:02 Imam-N