SMS

Provides static functions to send SMS messages


Code Example:
<script type="text/javascript">
  blackberry.message.sms.send("hello world", "987654321");

  var listener = function (msg, from, date) {
    alert(from+" "+msg+" "+date);
  }

  blackberry.message.sms.isListeningForMessage = true;
  blackberry.message.sms.addReceiveListener(listener);

  if (blackberry.message.sms.removeReceiveListener()){
    alert("Listener removed successfully.");
    blackberry.message.sms.isListeningForMessage = false;
  }
</script>


Supported Platform(s)

- BlackBerry OS 5.0+
- Ripple Emulator
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
blackberry.message.sms.addReceiveListener Y Y Y      Y
blackberry.message.sms.removeReceiveListener Y Y Y      Y
blackberry.message.sms.send Y Y Y      Y
isListeningForMessage Y Y Y      Y

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:

You must declare the feature element(s) below in your configuration document:

Feature IDBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
<feature id="blackberry.message.sms" /> Y Y Y      Y

Permission Elements (PlayBook and BlackBerry 10+)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.


Properties

Functions

static void blackberry.message.sms.addReceiveListener (listener: function(message : String, sender : String, date : Date))


SMS listener to receive a message when it arrives


Supported Platforms
 - BlackBerry OS 5.0+
 - Ripple Emulator


Parameters
listener Callback function that is invoked when a new SMS message is received. Overwrites the previous callback.

message: The content of the SMS message.
sender: The sender of the SMS message.
date: The date of the SMS message.

static Boolean blackberry.message.sms.removeReceiveListener ()


Remove the registered listener. Return false if there is no listener


Supported Platforms
 - BlackBerry OS 5.0+
 - Ripple Emulator

static void blackberry.message.sms.send (message : String, address : String)


Static function to send out an SMS message


Supported Platforms
 - BlackBerry OS 5.0+
 - Ripple Emulator


Parameters
message The text that should be sent
address Address where the message should be delivered to.

Properties

static Boolean isListeningForMessage


determine whether the message listeners are activated


Supported Platforms
 - BlackBerry OS 5.0+
 - Ripple Emulator

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Feb 11 2013 14:51:10 GMT-0500 (EST)