39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
---
|
|
id: silent_messages
|
|
sidebar_position: 21
|
|
title: Silent Messages
|
|
---
|
|
|
|
Pushing Silent Messages
|
|
|
|
Sometimes you want to add system or transactional messages to channels such as: "your ride is waiting for you",
|
|
"James updated the information for the trip", "You and Jane are now matched" and so on.
|
|
|
|
You may not want these messages to mark a channel as unread or increase the unread messages for users.
|
|
|
|
Silent messages are special messages that don't increase the unread messages count nor mark a channel as unread.
|
|
Creating a silent message is very simple, you only need to include the silent field boolean field and set it to true.
|
|
|
|
```dart
|
|
final text = 'You completed your trip';
|
|
|
|
const message = {
|
|
|
|
text: text,
|
|
|
|
user: systemUser,
|
|
|
|
silent: true,
|
|
|
|
attachments: tripAttachments,
|
|
|
|
};
|
|
await channel.sendMessage(message);
|
|
```
|
|
|
|
<b>Notes: </b>
|
|
|
|
1. Existing messages cannot be turned into a silent message or vice versa.
|
|
|
|
2. Silent messages do send push notifications by default. To skip our push notification service,
|
|
mark the message with `skip_push: true`. |