Phonegap Android SmsSendingPlugin没有返回未发送的短信

时间:2013-05-06 11:38:35

标签: android cordova plugins sms

我正在使用https://github.com/Pyo25/phonegap-sms-sending-plugin发送短信并且发送正常,但是,即使没有网络覆盖/航班模式,插件仍然会返回status.OK虽然没有发送短信。

无论如何要确保或检查消息状态?

我已尝试在sendSMS java中注册广播接收器,但它没有注册

 registerReceiver(new BroadcastReceiver(){
@Override
public void onReceive(Context arg0, Intent arg1) {
  switch (getResultCode())
  {
    case Activity.RESULT_OK:
      Toast.makeText(getBaseContext(), "SMS sent",
        Toast.LENGTH_SHORT).show();
      break;
    case SmsManager.RESULT_ERROR_GENERIC_FAILURE:
      Toast.makeText(getBaseContext(), "Generic failure",
        Toast.LENGTH_SHORT).show();
      break;
    case SmsManager.RESULT_ERROR_NO_SERVICE:
      Toast.makeText(getBaseContext(), "No service",
        Toast.LENGTH_SHORT).show();
      break;
    case SmsManager.RESULT_ERROR_NULL_PDU:
      Toast.makeText(getBaseContext(), "Null PDU",
        Toast.LENGTH_SHORT).show();
      break;
    case SmsManager.RESULT_ERROR_RADIO_OFF:
      Toast.makeText(getBaseContext(), "Radio off",
        Toast.LENGTH_SHORT).show();
      break;
  }
}

},新的IntentFilter(smsSent));

1 个答案:

答案 0 :(得分:1)