diff --git a/src/pages/docs/cli/push/publish.mdx b/src/pages/docs/cli/push/publish.mdx index 3e3a3c78a6..83917e5a31 100644 --- a/src/pages/docs/cli/push/publish.mdx +++ b/src/pages/docs/cli/push/publish.mdx @@ -30,7 +30,11 @@ A raw JSON recipient object. Exclusive with `--device-id` and `--client-id`. ### `--channel` -The target channel name. Publishes a push notification via the channel using `extras.push`. Ignored if `--device-id`, `--client-id`, or `--recipient` is also provided. +The target channel name. Publishes a push notification via the channel using `extras.push`. Ignored if `--device-id`, `--client-id`, or `--recipient` is also provided. Use together with `--message` to publish a realtime message on the channel alongside the push notification. + +### `--message` + +Realtime message data to include alongside the push notification. Accepts either plain text or raw JSON, and the value is used as the realtime message `data` payload rather than a full message object. Only applies when publishing via `--channel`. ### `--title` @@ -171,6 +175,22 @@ ably push publish --channel my-channel --payload '{"notification":{"title":"Hell ``` +Publish a push notification to a channel with a realtime message string: + + +```shell +ably push publish --channel my-channel --title Hello --body World --message 'Hello from push' +``` + + +Publish a push notification to a channel with a realtime message JSON payload: + + +```shell +ably push publish --channel my-channel --title Hello --body World --message '{"event":"push","text":"Hello"}' +``` + + Publish to a channel using a payload from a file: