• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. B2G OS APIs
  5. MozSmsManager

MozSmsManager

In This Article
  1. Summary
  2. Event Handlers
  3. Methods
    1. Additional methods for Mozilla chrome code
  4. Specifications
  5. Browser compatibility
  6. See also

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

Methods

MozSmsManager.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 or an MozSmsMessage object can be used as a parameter.
MozSmsManager.getMessage(id)
Gets a message with the specified id and returns a DOMRequest object where DOMRequest.result is a MozSmsMessage.
MozSmsManager.getMessages(filter, reverseOrder)
Gets messages, which are specified using a MozSmsFilter object. The order can be reversed using a boolean as a second parameter. A DOMCursor is returned.
MozSmsManager.getSegmentInfoForText(text)
Returns a MozSmsSegmentInfo with 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 id as read or unread depending on the Boolean isRead. A DOMRequest object is returned.
MozSmsManager.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.
MozSmsManager.getThreads()
Gets a list of MozMobileMessageThread. A DOMCursor is 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.

  • Desktop
  • Mobile
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

  • window.navigator.mozSms
  • MozSmsEvent

Document Tags and Contributors

Tags: 
  • API
  • B2G
  • DOM
  • Firefox OS
  • Mobile
  • Non-standard
  • Obsolete
  • Reference
  • Référence
  • WebSMS
 Contributors to this page: chrisdavidmills, fscholz, teoli, SphinxKnight, kscarfone, kohei.yoshino, Jeremie, Sheppy, janjongboom
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:07:15 AM
See also
  1. Mobile Messaging API
  2. Archive
  3. Events
    1. open
    2. message
    3. error
    4. close
    5. sending
    6. sent
    7. failed
    8. deliverysuccess
    9. deliveryerror
    10. retrieving
    11. received
  4. Related pages for Mobile Messaging API
    1. MozMmsEvent
    2. MozMmsMessage
    3. MozMobileMessageManager
    4. MozMobileMessageThread
    5. MozSmsEvent
    6. MozSmsFilter
    7. MozSmsManager
    8. MozSmsMessage
    9. MozSmsSegmentInfo
    10. Navigator.mozMobileMessage