Select your Platform:
Client SDKs
Backend SDKs
Push Test
Confused about "Push Test"?
Let us know how we can improve our documentation:
- On This Page:
- Push Test Parameters
Once you're all setup with push notifications, you can use the CLI to test how the these notifications will look for your devices.
In preparation of this make sure that:
Your app has push notifications configured for at least one provider(APNs or Firebase)
You have a user that has at least one device associated
The base command for testing push notifications is:
1
stream chat:push:test --user_id 'user_123'
This will do several things for you:
Pick a random message from a channel that this user is part of
Use the notification templates configured for your push providers to render the payload using this message
Send this payload to all of the user's devices
In some other cases, your app is already configured with push notifications and is running smoothly, but you want to try out a new notification template. For example, let's say you want to test a new APN notification template:
1
stream chat:push:test --user_id 'user_123' --apn_notification_template '{"aps":{"alert":{"title":"{{ sender.name }} @ {{ channel.name }}","body":"testing out new stuff:{{ message.text }}"},"category":"NEW_MESSAGE_2"}}'
As you can see, this one time only, the new template will be used for the push notification instead of the configured one:

Here's a full list of parameters that you can use with the test command:
Push Test Parameters
Copied!Confused about "Push Test Parameters"?
Let us know how we can improve our documentation:
name | type | description | default | optional |
---|---|---|---|---|
user_id | string | The user ID | - | |
message_id | string | ID of the message that should be used instead of a random one. If the message doesn't exist, an error will occur | - | ✓ |
apn_notification_template | string | Notification template to be used instead of the configured APN one. This is one time only. | - | ✓ |
firebase_notification_template | string | Notification template to be used instead of the configured APN one. This is one time only. | - | ✓ |
firebase_data_template | string | Data template to be used instead of the configured Firebase one. This is one time only. | - | ✓ |