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

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

Link copied to clipboard
fun blob(): Blob

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

Link copied to clipboard

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

Link copied to clipboard
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
fun text(): String

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