這短信插件是PhoneGap的2.3.0
SendSmsCordovaPlugin
樣品:
<script type="text/javascript">
sendSmsDemo = function() {
cordova.exec(function(winParam) {
// Use the following line if json2 library is present.
// Available from Douglas Crockford's github page here:
// https://github.com/douglascrockford/JSON-js/blob/master/json2.js
console.log(JSON.stringify(winParam));
alert(winParam.sms_send);
}
, function(error) {
alert("An error has occurred");
console.log("An error has occurred");
// Please refer to previous comment about json2 library.
console.log(JSON.stringify(error));
}
, "SendSms"
,"SendSms"
, ["TESTNUM", "This is random text."]);
}
</script>
請你給我任何示例代碼使用這個插件發送短信。 – cheliyan
添加了示例,它位於資產/ www內 – jcesarmobile