Issue with SMS cordova 3.5 plugin for android?

☆樱花仙子☆ 提交于 2020-01-16 18:48:11

问题


I have installed the SMS plugin via CLI, and the installation was done properly. Then I wrote JavaScript code as follows:

function sendsms()
{
    alert("click");
    var number = $("#numberTxt").val();
    var message = $("#messageTxt").val();
    var intent = ""; //leave empty for sending sms using default intent
    var success = function() { alert('Message sent successfully'); };
    var error = function(e) { alert('Message Failed:' + e); };
    sms.send(number, message, intent, success, error);
}

HTML code:

<input name="" id="numberTxt" placeholder="Enter mobile number" value="" type="tel" />
<br/>
<textarea name="" id="messageTxt" placeholder="Enter message"></textarea>
<br/>
<input type="submit" onClick='sendsms()' value="Send SMS" >

After clicking "Send SMS" I get an alert "click", but the message isn't sent and also I don't get any response - whether sms is sent or not.

来源:https://stackoverflow.com/questions/24690858/issue-with-sms-cordova-3-5-plugin-for-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!