Interface UnbluNotification


public interface UnbluNotification
Interface defining the structure and capabilities of notifications generated by the Unblu suite. It is designed to support the configuration and handling of both local and push notifications within applications integrating Unblu, enabling detailed control over notification appearance and behavior. The properties include basic notification elements like title and body, as well as Android-specific features such as icon resource IDs, sound configurations, and notification channels. Additional data can be used to pass extra information required by the application or for notification handling.
  • Method Details

    • getTitle

      @Nullable String getTitle()
      Returns:
      The title of the notification
    • getBody

      @Nullable String getBody()
      Returns:
      The body of the notification
    • getIcon

      int getIcon()
      Returns:
      Icon resource ID of the Unblu notification
    • getSound

      @Nullable String getSound()
      Returns:
      The sound name of the Unblu notification.
      This can be "default" to have the default sound for the notifications of the system or the name of a file inside the top level raw folder. If it is null also the default is used.
      Note: This is only used for older devices if there are no channels (version > Android 8, API level 26).
    • getChannelId

      @Nullable String getChannelId()
      Returns:
      The ID of the channel for the Unblu notification
    • getData

      Map<String,String> getData()
      Returns:
      The additional data of the Unblu notification
    • setTitle

      void setTitle(@Nullable String title)
      Sets the title of the notification
      Parameters:
      title - The title of the notification
    • setBody

      void setBody(@Nullable String body)
      Sets the body of the notification
      Parameters:
      body - The body of the notification
    • setIcon

      void setIcon(int icon)
      Sets the icon resource ID for Unblu notifications
      Parameters:
      icon - The resource ID of the icon to use for Unblu notifications
    • setSound

      void setSound(@Nullable String sound)
      Specifies the name of the sound to use for Unblu notifications. This can be "default" to have the default sound for the notifications of the system, or the name of a file inside the top level raw folder. If it is null, the default is used.
      Note: Only used for older android devices if there are no channels (version > Android 8, API level 26).
      Parameters:
      sound - The name of the sound to use
    • setChannelId

      void setChannelId(@Nullable String channelId)
      Sets the ID of the channel for Unblu notifications
      Parameters:
      channelId - The ID of the channel to use for Unblu notifications
    • setData

      void setData(Map<String,String> data)
      Sets the additional data for the Unblu notification. This data can be used to pass extra information that may be needed when the notification is received or clicked. This could include, for example, conversation identifiers, custom action identifiers, or any other context-specific information that enhances the notification's utility or enables specific functionality upon interaction.
      The data is represented as a key-value map.
      Parameters:
      data - A map of key-value string pairs representing the additional data to be included with the notification.