问题
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