PushMessageData

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

MDN Reference

Functions

Link copied to clipboard
external fun arrayBuffer(): ArrayBuffer

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

Link copied to clipboard
external fun blob(): Blob

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

Link copied to clipboard
external fun bytes(): Uint8Array<ArrayBuffer>

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

Link copied to clipboard
external fun json(): JsAny?

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

Link copied to clipboard
external fun text(): String

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