rehy / cordova-plugin-sms-receiver

Cordova SMS Receiver Plugin
MIT License
17 stars 19 forks source link

Can not receive SMS as expected #13

Open ayalpani opened 6 years ago

ayalpani commented 6 years ago

Hi,

I somehow can not receive Messages as expected. Calling the below code, I only get "SMS supported" alert. When my phone receives an SMS, this code just remains silent. Any Ideas are greatly appreciated, thanks!

SmsReceiver.isSupported ((function(supported) {

      if( supported ) {
        alert("SMS supported!")
        SmsReceiver.startReception(({ messageBody, originatingAddress }) => {
          alert(messageBody)
        }, () => {
          alert("Error while receiving messages")
        })
      }
      else {
        alert("SMS not supported")
      }

    }), function() {
      alert("Error while checking the SMS support");
    })