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

onSMSArrive not working more in adroid 6.0.0

Open PeaceDeveloper opened this issue 8 years ago • 7 comments

Hello,

I had a device with android 4.4.4 kitkat. The event 'onSMSArrive' work in it. But in android 6.0.0 marshmallow this event not work more.

Someone could help me the reason about this.

PeaceDeveloper avatar Jan 06 '17 18:01 PeaceDeveloper

+1

jlerpscher avatar Jan 14 '17 21:01 jlerpscher

Hi @PeaceDeveloper ,

can enableIntercept work on android 4.4.4 kitkat ? thank you for your answer.

onebook0505 avatar Jan 17 '17 01:01 onebook0505

Hi @onebook0505,

I have downgraded my phone to 4.4.4 and everything is ok.

jlerpscher avatar Jan 17 '17 22:01 jlerpscher

+1 on Android 6.0.1 Same issue (device is Xiaomi Redmi Note 3)

denys-glu avatar Feb 27 '17 15:02 denys-glu

any solution? thanx

hawk2017 avatar Mar 06 '17 05:03 hawk2017

hi fellow developers) i find a workaround

  1. You need to install this plugin https://www.npmjs.com/package/cordova-plugin-android-permissions

  2. You need add that code var permissions = cordova.plugins.permissions; permissions.hasPermission(permissions.READ_SMS, checkPermissionCallback, null);

         function checkPermissionCallback(status) {
             if(!status.hasPermission) {
                 var errorCallback = function() {
                     console.warn('SMS permission is not turned on');
                 }
    
                 permissions.requestPermission(
                     permissions.READ_SMS,
                     function(status) {
                         if(!status.hasPermission) errorCallback();
                     },
                     errorCallback);
             }
         }
    

good luck)

denys-glu avatar Mar 11 '17 16:03 denys-glu

Or if you simply want to receive SMS, try this plugin which features newer APIs and has been thoroughly tested: cordova-plugin-sms-receive

andreszs avatar Apr 16 '18 00:04 andreszs