Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/pages/docs/cli/push/publish.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ A raw JSON recipient object. Exclusive with `--device-id` and `--client-id`.

### `--channel` <a 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` <a id="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` <a id="title"/>

Expand Down Expand Up @@ -171,6 +175,22 @@ ably push publish --channel my-channel --payload '{"notification":{"title":"Hell
```
</Code>

Publish a push notification to a channel with a realtime message string:

<Code>
```shell
ably push publish --channel my-channel --title Hello --body World --message 'Hello from push'
```
</Code>

Publish a push notification to a channel with a realtime message JSON payload:

<Code>
```shell
ably push publish --channel my-channel --title Hello --body World --message '{"event":"push","text":"Hello"}'
```
</Code>

Publish to a channel using a payload from a file:

<Code>
Expand Down
Loading