Skip to content

Commit 8045469

Browse files
maratalclaude
andcommitted
docs(push): add test push subsection to step 3
Covers sending test pushes via Ably CLI by client ID and device ID once the device is activated, before moving on to channel subscriptions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f43fb4e commit 8045469

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

src/pages/docs/push/getting-started/nextjs.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,29 @@ npm run dev
297297
298298
Navigate to `http://localhost:3000/push` in your browser. Click **Activate Push**, grant notification permission, and wait for the device ID to appear.
299299

300+
### Test push notifications <a id="step-3-test"/>
301+
302+
Once the device is activated, send a test push notification directly to your client ID using the Ably CLI:
303+
304+
<Code>
305+
```shell
306+
ably push publish --client-id push-tutorial-client \
307+
--title "Test push" \
308+
--body "Hello from CLI!" \
309+
--data '{"foo":"bar"}'
310+
```
311+
</Code>
312+
313+
A native browser notification should appear and the log should display the received push event. You can also send to the specific device ID shown in the log:
314+
315+
<Code>
316+
```shell
317+
ably push publish --device-id <your-device-id> \
318+
--title "Test push" \
319+
--body "Hello from CLI!"
320+
```
321+
</Code>
322+
300323
![Screenshot of the Next.js push tutorial application showing push notifications received](../../../../images/content/screenshots/getting-started/nextjs-push-getting-started-guide.png)
301324

302325
## Step 4: Subscribe to channel push <a id="step-4"/>

0 commit comments

Comments
 (0)