nsIPushMessage

A push message sent to a system subscription.
Inherits from: nsISupports Last changed in Gecko 46.0 (Firefox 46.0 / Thunderbird 46.0 / SeaMonkey 2.43)

nsIPushMessage is the subject of a push-message observer notification.

This interface resembles PushMessageData from the Push API.

Method overview

DOMString text();
jsval json();
void binary([optional] out uint32_t dataLen, [array, retval, size_is(dataLen)] out uint8_t data);

Methods

text()

Extracts the message data as a UTF-8 text string.

DOMString text();

Parameters

None.

json()

Parses the message data as JSON.

jsval json();

Parameters

None.

binary()

Extracts the message data as a byte array.

void binary(
  [optional] out uint32_t dataLen,
  [array, retval, size_is(dataLen)] out uint8_t data
);

Parameters

dataLen
The data size.
data
The byte array containing the data.

dataLen and data are out parameters. When called from JavaScript, nsIPushMessage.binary() returns data. Please see "Method parameters" in XPIDL for more details on using out parameters in JavaScript.

See also

Document Tags and Contributors

 Contributors to this page: rolfedh, kitcambridge
 Last updated by: rolfedh,