Skip to main content

Custom message types

Chat UI supports custom message types (distinct from built-in types) and allows modifying how both built-in and custom message types appear in the Chat UI SDK channel view.

Create custom message types

In addition to using the SDK's built-in message types, you can create custom messages for your business requirements.

tip

For details on creating custom message types, refer to the Chat SDK custom message APIs, such as NCCustomMessageContent, NCCustomMediaMessageContent, and NCMessagePersistent. For Chat UI display customization, see Modify message display styles.

Custom messages will only display in the Chat UI channel view when their persistentFlag has one of these values:

  • NCMessagePersistentCounted
  • NCMessagePersistentPersisted

If your custom message type includes these properties, you must create a display template for it—otherwise the Chat UI SDK cannot properly render the message.

Create and register display templates for custom messages

Chat UI supports creating custom message cells to control how messages appear in the channel view. If you create a custom message type and need it to display in the channel interface, you must create a corresponding display template. Otherwise, the SDK cannot properly render that message type. See Create new message display template in Modify message display styles for details.

Reference