WebSMS

  • Revision slug: WebAPI/WebSMS
  • Revision title: WebSMS
  • Revision id: 463973
  • Created:
  • Creator: Jeremie
  • Is current revision? No
  • Comment

Revision Content

{{ non-standard_header() }}

{{ B2GOnlyHeader2('certified') }}

Summary

WebSMS is an API that makes it possible for web content to create, send, and receive Short Message Service (SMS) or Multimedia Messaging Service (MMS) messages.

The API is available using {{ domxref("window.navigator.mozSms") }} which returns a {{ domxref("MozSmsManager") }} object or {{ domxref("window.navigator.mozMobileMessage") }} which returns a {{ domxref("MozMobileMessageManager") }}. See below for a full list of interfaces:

DOM interfaces

SMS interfaces

  • {{ domxref("window.navigator.mozSms") }} {{deprecated_inline("25")}}
  • {{ domxref("MozSmsManager") }} {{deprecated_inline("25")}}
  • {{ domxref("MozSmsMessage") }}
  • {{ domxref("MozSmsEvent") }}
  • {{ domxref("MozSmsFilter") }}
  • {{ domxref("MozSmsSegmentInfo") }}

MMS and SMS interfaces

  • {{ domxref("window.navigator.mozMobileMessage") }} {{b2g_required_inline("1.1")}}
  • {{ domxref("MozMobileMessageManager")}}
  • {{ domxref("MozMmsMessage") }}
  • {{ domxref("MozMmsEvent") }}
  • {{ domxref("MozMobileMessageThread") }}

Sample code and introduction

Specifications

This is a non standard implementation, but it is discussed at W3C as part of the System Application Working Group.

Specification Status Comment
{{SpecName('Messaging')}} {{Spec2('Messaging')}} Editor Draft (WIP).

Browser compatibility

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

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatNo() }} {{ CompatGeckoMobile("12.0") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}

Preferences & availability

  • WebSMS is disabled by default and can be enabled setting the preference dom.sms.enabled to true.
  • A comma-separated whitelist of allowed hostnames that are allowed to use the WebSMS API must be specified using the dom.sms.whitelist preference. This string is empty by default.
  • WebSMS is only available to certified apps on Firefox OS (B2G).
  • MMS are available starting with Firefox OS 1.1

See also

Revision Source

<p>{{ non-standard_header() }}</p>
<p>{{ B2GOnlyHeader2('certified') }}</p>
<h2 id="Summary">Summary</h2>
<p>WebSMS is an API that makes it possible for web content to create, send, and receive Short Message Service (SMS) or Multimedia Messaging Service (MMS) messages.</p>
<p>The API is available using {{ domxref("window.navigator.mozSms") }} which returns a {{ domxref("MozSmsManager") }} object or {{ domxref("window.navigator.mozMobileMessage") }} which returns a {{ domxref("MozMobileMessageManager") }}. See below for a full list of interfaces:</p>
<h2 id="DOM_interfaces">DOM interfaces</h2>
<h3 id="SMS_interfaces">SMS interfaces</h3>
<ul>
  <li>{{ domxref("window.navigator.mozSms") }} {{deprecated_inline("25")}}</li>
  <li>{{ domxref("MozSmsManager") }} {{deprecated_inline("25")}}</li>
  <li>{{ domxref("MozSmsMessage") }}</li>
  <li>{{ domxref("MozSmsEvent") }}</li>
  <li>{{ domxref("MozSmsFilter") }}</li>
  <li>{{ domxref("MozSmsSegmentInfo") }}</li>
</ul>
<h3 id="MMS_and_SMS_interfaces">MMS and SMS interfaces</h3>
<ul>
  <li>{{ domxref("window.navigator.mozMobileMessage") }} {{b2g_required_inline("1.1")}}</li>
  <li>{{ domxref("MozMobileMessageManager")}}</li>
  <li>{{ domxref("MozMmsMessage") }}</li>
  <li>{{ domxref("MozMmsEvent") }}</li>
  <li>{{ domxref("MozMobileMessageThread") }}</li>
</ul>
<h2 id="Sample_code_and_introduction">Sample code and introduction</h2>
<ul>
  <li><a href="/en-US/docs/WebAPI/WebSMS/Introduction_to_Mobile_Message_API" title="en/API/WebSMS/Introduction_to_WebSMS">Introduction to Mobile Message API</a></li>
</ul>
<h2 id="Specifications">Specifications</h2>
<p>This is a non standard implementation, but it is discussed at W3C as part of the <a href="http://www.w3.org/2012/sysapps/" title="http://www.w3.org/2012/sysapps/">System Application Working Group</a>.</p>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{SpecName('Messaging')}}</td>
      <td>{{Spec2('Messaging')}}</td>
      <td>Editor Draft (WIP).</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>For obvious reasons, support is primarily expected on mobile browsers.</p>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoMobile("12.0") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="Preferences_.26_availability">Preferences &amp; availability</h2>
<ul>
  <li>WebSMS is disabled by default and can be enabled setting the preference <code>dom.sms.enabled</code> to true.</li>
  <li>A comma-separated whitelist of allowed hostnames that are allowed to use the WebSMS API must be specified using the <code>dom.sms.whitelist</code> preference. This string is empty by default.</li>
  <li>WebSMS is only available to certified apps on Firefox OS (B2G).</li>
  <li>MMS are available starting with Firefox OS 1.1</li>
</ul>
<h2 class="note" id="See_also">See also</h2>
<ul>
  <li><a class="link-https" href="https://wiki.mozilla.org/WebAPI/WebSMS" title="https://wiki.mozilla.org/WebAPI/WebSMS">WebSMS API</a> (design document)</li>
</ul>
Revert to this revision