This API is available on Firefox OS for internal applications only.
Note: As of Gecko 25.0, this interface has been removed in favor of MozMobileMessageManager.
Summary
Provides support for sending and managing SMS messages on a device with WebSMS.
Event Handlers
MozSmsManager.ondeliveryerror- A handler for a
deliveryerrorevent; thisMozSmsEventis sent whenever an SMS is not delivered to a recipient. MozSmsManager.ondeliverysuccess- A handler for a
deliverysuccessevent; thisMozSmsEventis sent whenever an SMS is delivered to a recipient. MozSmsManager.onreceived- A handler for a
receivedevent; thisMozSmsEventis sent whenever an SMS is received. MozSmsManager.onsent- A handler for a
sentevent; thisMozSmsEventis sent whenever an SMS is sent. MozSmsManager.onsending- A handler for a
sendingevent; thisMozSmsEventis sent whenever an SMS enters the send flow. MozSmsManager.onfailed- A handler for a
failedevent; thisMozSmsEventis sent when sending an SMS has failed.
Methods
MozSmsManager.delete(param)- Deletes a message and returns a
DOMRequestobject (whereDOMRequest.resultis a Boolean reflecting whether the message was deleted). A messageidor anMozSmsMessageobject can be used as a parameter. MozSmsManager.getMessage(id)- Gets a message with the specified
idand returns aDOMRequestobject whereDOMRequest.resultis aMozSmsMessage. MozSmsManager.getMessages(filter, reverseOrder)- Gets messages, which are specified using a
MozSmsFilterobject. The order can be reversed using a boolean as a second parameter. ADOMCursoris returned. MozSmsManager.getSegmentInfoForText(text)- Returns a
MozSmsSegmentInfowith the information necessary to create a multi-part SMS for a given text (usually 160 characters per SMS). MozSmsManager.markMessageRead(id, isRead)- Marks a message with the specified
idas read or unread depending on the BooleanisRead. ADOMRequestobject is returned. MozSmsManager.send(number, message)- Sends a message to a specified number. If
numberis aDOMString(only one number) aDOMRequestobject is returned. Ifnumberis an array ofDOMStrings(multiple numbers) an array ofDOMRequestobjects is returned. MozSmsManager.getThreads()- Gets a list of
MozMobileMessageThread. ADOMCursoris returned.
MozSmsManager also inherits the methods from EventTarget.
EventTarget.addEventListener()- Register an event handler of a specific event type on the
EventTarget. EventTarget.removeEventListener()- Removes an event listener from the
EventTarget. EventTarget.dispatchEvent()- Dispatch an event to this
EventTarget.
Additional methods for Mozilla chrome code
Mozilla extensions for use by JS-implemented event targets to implement on* properties. See also WebIDL bindings.
- void setEventHandler(DOMString type, EventHandler handler)
- EventHandler getEventHandler(DOMString type)
Specifications
This is a non standard implementation, but it is discussed at W3C as part of the System Application Working Group.
| Specification | Status | Comment |
|---|---|---|
| Messaging API | Editor's Draft | Editor Draft (WIP). |
Browser compatibility
For obvious reasons, support is primarily expected on mobile browsers.
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | No support | No support | No support | No support | No support |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | No support | 12.0 (12.0) Moz | No support | No support | No support |
See also
Document Tags and Contributors
Tags:
Contributors to this page:
chrisdavidmills,
fscholz,
teoli,
SphinxKnight,
kscarfone,
kohei.yoshino,
Jeremie,
Sheppy,
janjongboom
Last updated by:
chrisdavidmills,