This API is available on Firefox OS for internal applications only.
Summary
Provides support for sending and managing both MMS and SMS messages on a device with WebSMS.
Event Handlers
MozMobileMessageManager.ondeliveryerror- A handler for a
deliveryerrorevent; thisMozMmsEventorMozSmsEventis sent whenever an MMS or SMS is not delivered to a recipient. MozMobileMessageManager.ondeliverysuccess- A handler for a
deliverysuccessevent; thisMozMmsEventorMozSmsEventis sent whenever an MMS or SMS is delivered to a recipient. MozMobileMessageManager.onreceived- A handler for a
receivedevent; thisMozMmsEventorMozSmsEventis sent whenever an MMS or SMS is received. MozMobileMessageManager.onretrieving- A handler for a
retrievingevent; thisMozMmsEventorMozSmsEventis sent whenever an MMS or SMS enters the retrieving flow. MozMobileMessageManager.onsent- A handler for a
sentevent; thisMozMmsEventorMozSmsEventis sent whenever an MMS or SMS is sent. MozMobileMessageManager.onsending- A handler for a
sendingevent; thisMozMmsEventorMozSmsEventis sent whenever an MMS or SMS enters the send flow. MozMobileMessageManager.onfailed- A handler for a
failedevent; thisMozMmsEventorMozSmsEventis sent when sending an MMS or SMS has failed.
Methods
MozMobileMessageManager.delete(param)- Deletes a message and returns a
DOMRequestobject (whereDOMRequest.resultis a Boolean reflecting whether the message was deleted). A messageid, an array of message id, aMozSmsMessageobject or an array of this, or aMozMmsMessageobject or an array of this can be used as a parameter. MozMobileMessageManager.getMessage(id)- Gets a message with the specified
idand returns aDOMRequestobject whereDOMRequest.resultis aMozSmsMessage. MozMobileMessageManager.getMessages(filter, reverseOrder)- Gets messages, which are specified using an
MozSmsFilterobject. The order can be reversed using a boolean as a second parameter. ADOMCursoris returned. MozMobileMessageManager.getSegmentInfoForText(text)- Returns a
MozSmsSegmentInfowith the information necessary to create a multi-part SMS for a given text (usually 160 characters per SMS). MozMobileMessageManager.markMessageRead(id, isRead)- Marks a message with the specified
idas read or unread depending on the BooleanisRead. ADOMRequestobject is returned. MozMobileMessageManager.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. MozMobileMessageManager.sendMMS(param)- Send an MMS to a list of receivers. A
DOMRequestobject is returned The param object is a regular JavaScript object with four properties:receivers: An array of strings, each string representing the phone number of a receiver.subject: A string representing the subject of the MMS.smil: A stringified version of the SMIL document defining the MMS.attachments: An array of attachment objects used by the SMIL document. Those objects contain anid, alocation, and acontentwhich is aBlob.
MozMobileMessageManager.getThreads()- Gets a list of
MozMobileMessageThread. ADOMCursoris returned. MozMobileMessageManager.retrieveMMS(id)- Gets a message with the specified
idand returns aDOMRequestobject whereDOMRequest.resultis aMozMmsMessage. MozMobileMessageManager.getSmscAddress()- Gets the number of the SMS center for the specificed SIM card and returns a
DOMRequestobject whereDOMRequest.resultis the number.
Specifications
This is a nonstandard 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,
KumarRishav,
teoli,
fscholz,
MHasan,
Colin,
Jeremie,
kscarfone
Last updated by:
chrisdavidmills,