0 Replies Latest reply on Jan 8, 2017 9:14 PM by sethup51656429

    how to send sms in phonegap

    sethup51656429 Level 1

      hi i'm using this code to send sms in my android phone .....

      Android version :4.4.2

      i used the plugin cordova-sms-plugin

       

      my code is;

       

      <script>

      var app = { sendSms: function() { var number = document.getElementById('numberTxt').value; var message = document.getElementById('messageTxt').value; console.log("number=" + number + ", message= " + message); //CONFIGURATION var options = { replaceLineBreaks: false, // true to replace \n by a new line, false by default android: { intent: 'INTENT' // send SMS with the native android SMS messaging //intent: '' // send SMS without open any other app } }; var success = function () { alert('Message sent successfully'); }; var error = function (e) { alert('Message Failed:' + e); }; sms.send(number, message, options, success, error); } };

      </script>

      <html>

      <input type="text" id="numberTxt">

      <input type="text"id="messageTxt">

      <input type="button" onclick="app.sendSms()">

      </html>

      pls give me solution