Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Send to multiple receivers

Fan out a single message to multiple known receiver IDs in one send() call. DNotifier delivers to each recipient independently — there are no shared channels or subscriptions.


When to use receiverIds

Scenario
Approach

Group chat (your app manages members)

Send to each member's user ID

Notify several dashboard sessions

List admin session IDs

Broadcast to a team

Your backend maintains the member list


The send() contract

Field
Description

senderId

Must match the connecting user's userId

receiverIds

Array of target user IDs (mutually exclusive with single receiverId)

data

Same JSON payload sent to every recipient

saveHistory

Optional; default true per recipient rules

{
  "type": "text",
  "text": "Hello everyone"
}

Each recipient receives the same data object in their onMessage handler.


Delivery semantics

  • Recipients who are online receive the message immediately via onMessage

  • Recipients who are offline do not get live delivery

  • With saveHistory: true, each recipient can load history when they reconnect (chat use case)


Language guides

Language
Guide

JavaScript / TypeScript

Dart / Flutter


Last updated