Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 7556cda

Browse files
author
Eduardo Fullea
committed
adding manual fetch example, fixing MessagingEvent. closes #20
1 parent a3acc41 commit 7556cda

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

index.html

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,26 @@ <h3>Steps</h3>
11021102
</ol>
11031103
</ol>
11041104

1105+
<p>
1106+
An example of manual fetch of an MMS is provided below:
1107+
1108+
<pre class="example highlight">
1109+
var message = receivedMessageEvent.message
1110+
if (message.state == 'not-downloaded') {
1111+
var req = navigator.messaging.mms.fetch (message.id)
1112+
req.onprogress = function() {
1113+
window.console.log(e.loaded + ' bytes out of ' + e.total + '
1114+
downloaded ...');
1115+
}
1116+
req.onsuccess = function() {
1117+
window.console.log('Message Fetched!');
1118+
}
1119+
req.onerror = function(e) {
1120+
window.console.error(e.target.error.name);
1121+
}
1122+
</pre>
1123+
1124+
11051125
<p>The User Agent MAY fire additional <code>ProgressEvents</code>
11061126
[[!PROGRESS-EVENTS]] on the <code>MessagingRequest</code> object associated to
11071127
the sending and fetching of an MMS message, in order to report on the progress
@@ -1136,6 +1156,11 @@ <h2><a>MessagingRequest</a> Interface</h2>
11361156
<code>MessagingRequest</code> object, e.g. <code>delete</code> method of the
11371157
<code>Messaging</code> object.</dd>
11381158

1159+
<dt class="no-docs">
1160+
attribute EventHandler onprogress
1161+
</dt>
1162+
<dd></dd>
1163+
11391164
<dt class="no-docs">
11401165
attribute EventHandler onsuccess
11411166
</dt>
@@ -1479,7 +1504,7 @@ <h2><a>MessagingCursor</a> Interface</h2>
14791504
<h2><a>MessagingEvent</a> Interface</h2>
14801505
<p>The <a>MessagingEvent</a> interface represents events related to a message
14811506
sent or received.
1482-
<dl title="[NoInterfaceObject] interface MessagingEvent"
1507+
<dl title="[NoInterfaceObject] interface MessagingEvent : ProgressEvent"
14831508
class="idl">
14841509
<dt>readonly attribute (SmsMessage or MmsMessage) message</dt>
14851510
<dd>MUST return the <code>SmsMessage</code> or <code>MmsMessage</code>

0 commit comments

Comments
 (0)