Background data messages
Listen for silent data payloads and read the retained queue after a cold start.
Listen for data messages
Subscribe for a data payload as it arrives. These are data messages, not user-visible notifications — the result arrives on push.dataReceived, so subscribe before you read the queue.
Each live event is a BdkPushDataMessage without delivered. appState is foreground, background, or cold.
Subscribe to push.dataReceived before you call getDataMessages(), or a live delivery can be missed.
Read the retained queue
Read messages that arrived while the page wasn't listening. Newest first. The read does not remove them. The native side keeps the most recent 20.
When delivered is present, native attempted delivery — not that a page listener confirmed receipt.
This feature can be switched off in a given app build. Check await bdk.capabilities.has("push.data") before showing the UI. When it is off, the call resolves ok: false with code: "common/feature_disabled". See Detect features.
In a plain browser the call resolves ok: false with a code like common/feature_disabled — branch on !result.ok.
Send a data message
Send a data or silent payload from your push provider. There is no SDK call to send one from the page.