Table of Contents

Class PushMessageData

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The PushMessageData interface of the Push API provides methods which let you retrieve the push data sent by a server in various formats.

[Value("PushMessageData")]
public class PushMessageData
Inheritance
PushMessageData
Inherited Members

Remarks

Unlike the similar methods in the Fetch API, which only allow the method to be invoked once, these methods can be called multiple times.

Messages received through the Push API are sent encrypted by push services and then automatically decrypted by browsers before they are made accessible through the methods of the PushMessageData interface.

See also on MDN

Constructors

PushMessageData()

public PushMessageData()

Methods

ArrayBuffer()

The arrayBuffer() method of the PushMessageData interface extracts push message data as an {{jsxref("ArrayBuffer")}} object.

[Value("arrayBuffer")]
public ArrayBuffer ArrayBuffer()

Returns

ArrayBuffer

An ArrayBuffer().

Remarks

Blob()

The blob() method of the PushMessageData interface extracts push message data as a Blob() object.

[Value("blob")]
public Blob Blob()

Returns

Blob

A Blob().

Remarks

Bytes()

The bytes() method of the PushMessageData interface extracts push message data as an {{jsxref("Uint8Array")}} object.

[Value("bytes")]
public Uint8Array Bytes()

Returns

Uint8Array

An Uint8Array.

Remarks

Json()

The json() method of the PushMessageData interface extracts push message data by parsing it as a JSON string and returning the result.

[Value("json")]
public dynamic Json()

Returns

dynamic

The result of parsing push event data as JSON. This could be anything that can be represented by JSON — an object, an array, a string, a number…

Remarks

Text()

The text() method of the PushMessageData interface extracts push message data as a plain text string.

[Value("text")]
public string Text()

Returns

string

A string.

Remarks