mozilla

MozMobileMessageManager

This article is in need of a technical review.

この記事はまだ日本語に翻訳されていません。MDN の翻訳はボランティアによって行われています。是非 MDN に登録し、私たちの力になって下さい。

Non-standard
This feature is not on a current W3C standards track, but it is supported on the Firefox OS platform. Although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to Firefox OS apps.

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 deliveryerror event; this MozMmsEvent or MozSmsEvent is sent whenever an MMS or SMS is not delivered to a recipient.
MozMobileMessageManager.ondeliverysuccess
A handler for a deliverysuccess event; this MozMmsEvent or MozSmsEvent is sent whenever an MMS or SMS is delivered to a recipient.
MozMobileMessageManager.onreceived
A handler for a received event; this MozMmsEvent or MozSmsEvent is sent whenever an MMS or SMS is received.
MozMobileMessageManager.onretrieving
A handler for a retrieving event; this MozMmsEvent or MozSmsEvent is sent whenever an MMS or SMS enters the retrieving flow.
MozMobileMessageManager.onsent
A handler for a sent event; this MozMmsEvent or MozSmsEvent is sent whenever an MMS or SMS is sent.
MozMobileMessageManager.onsending
A handler for a sending event; this MozMmsEvent or MozSmsEvent is sent whenever an MMS or SMS enters the send flow.
MozMobileMessageManager.onfailed
A handler for a failed event; this MozMmsEvent or MozSmsEvent is sent when sending an MMS or SMS has failed.

Methods

MozMobileMessageManager.delete(param)
Deletes a message and returns a DOMRequest object (where DOMRequest.result is a Boolean reflecting whether the message was deleted). A message id, a MozSmsMessage object, or a MozMmsMessage object can be used as a parameter.
MozMobileMessageManager.getMessage(id)
Gets a message with the specified id and returns a DOMRequest object where DOMRequest.result is a MozSmsMessage.
MozMobileMessageManager.getMessages(filter, reverseOrder)
Gets messages, which are specified using an MozSmsFilter object. The order can be reversed using a boolean as a second parameter. A DOMCursor is returned.
MozMobileMessageManager.getSegmentInfoForText(text)
Returns a MozSmsSegmentInfo with 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 id as read or unread depending on the Boolean isRead. A DOMRequest object is returned.
MozMobileMessageManager.send(number, message)
Sends a message to a specified number. If number is a DOMString (only one number) a DOMRequest object is returned. If number is an array of DOMStrings (multiple numbers) an array of DOMRequest objects is returned.
MozMobileMessageManager.sendMMS(param)
Send an MMS to a list of receivers. A DOMRequest object 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 an id, a location, and a content which is a Blob.
MozMobileMessageManager.getThreads()
Gets a list of MozMobileMessageThread. A DOMCursor is returned.
MozMobileMessageManager.retrieveMMS(id)
Gets a message with the specified id and returns a DOMRequest object where DOMRequest.result is a MozMmsMessage.
MozMobileMessageManager.<strong>getSmscAddress</strong>(<strong>serviceId</strong>)
Gets the number of the SMS center for the specificed SIM card and returns a DOMRequest object where DOMRequest.result is the number.

MozMobileMessageManager 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.

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 Not supported Not supported Not supported Not supported Not supported
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

See also

ドキュメントのタグと貢献者

Contributors to this page: fscholz, Jeremie, teoli, Colin, kscarfone, MHasan
最終更新者: fscholz,