Silent & System 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.

// This message will not trigger events for channel members
var silentMessage = await channel.SendNewMessageAsync(new StreamSendMessageRequest
{
  Text = "System message",
  Silent = true
});

Existing messages cannot be turned into a silent message or vice versa.

Silent replies will still increment a message’s reply_count

Silent messages do send push notifications by default. To skip our push notification service, mark the message with skip_push: true, as described here.

It is also possible to send system messages. System messages differ from normal messages in the way they are presented to the user. Like the name says, system messages are normally send from the system itself, but a user is able to send it as well by specifying type: 'system' with the message. The user who sends a system message client-side should have the Create System Message permission. Server-side system messages don’t need that permission.

const text = "You completed your trip";
const message = {
  text,
  user: systemUser,
  type: "system",
};
await channel.sendMessage(message);
© Getstream.io, Inc. All Rights Reserved.