The Mobile Client makes use of the following plugin:
https://github.com/cordova-sms/cordova-sms-plugin
This plugin allows you to send texts through your mobile applications running in the Mobile client. To do so, you can use javascript code like the following example (you can place it in a separate javascript file that your application loads or in the onload event of a given screen):
var app = {
sendSms: function() {
//'numberTxt' and 'messageTxt' are IDs of fields on your screen
//that contain the number you wish to text and the text message
//you wish to send
var number = get('numberTxt');
var message = get('messageTxt');
//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 opening 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);
}
};
And simply call this code (like from the onclick event of a button) like this:
app.sendSMS();
You can modify the javascript example to fit your needs; for example, modifying the "sendSms" function to accept parameters that contain the IDs of the fields to use so the values are not hardcoded within it.