Package 

Interface NotificationIdFactory


  • 
    public interface NotificationIdFactory
    
                        

    Factory for creating custom notification IDs based on the ChatNotification type.

    Implement this interface to customize how notification IDs are generated for different types of chat notifications. This allows you to control notification grouping behavior.

    If getNotificationId returns null, the SDK will use its default notification ID generation logic.

    Example usage:

    val notificationIdFactory = NotificationIdFactory { notification ->
        if (notification is ChatNotification.MessageNew && notification.message.isSystem()) {
            // Use a stable hash code for system messages to avoid default grouping by channel
            "system:${notification.message.id}".hashCode()
        } else {
            // Use default SDK behavior for other notification types
            null
        }
    }
    • Method Summary

      Modifier and Type Method Description
      abstract Integer getNotificationId(ChatNotification notification) Generates a notification ID for the given ChatNotification.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait