The Profound UI Mobile Client makes use of the following plugin:
...
This plugin allows you to send texts through text messages from your mobile applications running in the Mobile client. To do so. If you are not using the Profound UI Mobile Client, and are packaging your mobile application manually with Cordova PhoneGap, the above plugin must be included.
To send SMS messages, you can use javascript JavaScript code like as in 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):
...
:
Code Block | ||
---|---|---|
| ||
// 'number' and ' |
...
message' are |
...
ID's of fields on your screen |
...
// that contain the number you wish to text and the text message |
...
|
...
// you wish to send |
...
|
...
var number = get( |
...
"number"); |
...
|
...
var message = get( |
...
"message"); |
...
// |
...
|
...
Configuration |
...
var options = { |
...
|
...
replaceLineBreaks: false, // set to 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
|
...
|
...
} |
...
}; |
...
|
...
function success |
...
() { |
...
|
...
alert('Message sent successfully'); |
...
|
...
} |
...
|
...
function failure (e) { |
...
|
...
alert('Message Failed:' + e); |
...
|
...
} |
...
|
...
|
...
sms.send(number, message, options, success, |
...
failure); |
...
|
...
And simply call this code (like from the onclick event of a button) like this:
app.sendSMS();
...