SmsManager

« Gecko DOM Reference

Non-standard

Provides support for sending and managing SMS messages on a device with WebSMS. Currently implemented as MozSmsManager.

Methods

delete(jsval param)
Deletes a message and returns an SmsRequest object (where SmsRequest.result is a Boolean reflecting whether the message was deleted). A message id or an SmsMessage object can be used as a parameter.
getMessage(long id)
Gets a message with the specified id and returns an SmsRequest object where SmsRequest.result is an SmsMessage.
getMessages(SmsFilter filter, boolean reverse)
Gets messages, which are specified using an SmsFilter object. The order can be reversed using a boolean as a second parameter. An SmsRequest object where SmsRequest.result is an SmsCursor is returned.
getNumberOfMessagesForText(DOMString text)
Returns the number of multi-part SMS needed for a given text (160 characters for one SMS).
markMessageRead(long id, boolean aValue)
Marks a message with the specified id as read or unread depending on the Boolean aValue. An SmsRequest object is returned.
send(DOMString[] number, DOMString message)
Sends a message to a specified number. If number is a DOMString (only one number) an SmsRequest object is returned. If number is an array of DOMStrings (multiple numbers) an array of SmsRequest objects is returned.

Events

ondelivered
A handler for a "delivered" event; this SMSEvent is sent whenever an SMS is delivered to a recipient.
onreceived
A handler for a "received" event; this SMSEvent is sent whenever an SMS is received.
onsent
A handler for a "sent" event; this SMSEvent is sent whenever an SMS is sent.

Browser compatibility

For obvious reasons, support is primarily expected on mobile browsers.

Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support Not supported 12.0 (12.0) moz Not supported Not supported Not supported
markMessageRead method Not supported 15.0 (15.0) Not supported Not supported Not supported

Specification

Not part of any specification; however, a proposal is expected based on the WebSMS design document.

See also

Tags (4)

Contributors to this page: Elchi3
Last updated by: Elchi3,