Package com.unblu.sdk.core.notification
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 Summary
Modifier and TypeMethodDescriptiongetBody()
getData()
int
getIcon()
getSound()
getTitle()
void
Sets the body of the notificationvoid
setChannelId
(String channelId) Sets the ID of the channel for Unblu notificationsvoid
Sets the additional data for the Unblu notification.void
setIcon
(int icon) Sets the icon resource ID for Unblu notificationsvoid
Specifies the name of the sound to use for Unblu notifications.void
Sets the title of the notification
-
Method Details
-
getTitle
- Returns:
- The title of the notification
-
getBody
- Returns:
- The body of the notification
-
getIcon
int getIcon()- Returns:
- Icon resource ID of the Unblu notification
-
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
- Returns:
- The ID of the channel for the Unblu notification
-
getData
- Returns:
- The additional data of the Unblu notification
-
setTitle
Sets the title of the notification- Parameters:
title
- The title of the notification
-
setBody
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
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
Sets the ID of the channel for Unblu notifications- Parameters:
channelId
- The ID of the channel to use for Unblu notifications
-
setData
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.
-