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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getBody()
java.lang.String
getChannelId()
java.util.Map<java.lang.String,java.lang.String>
getData()
int
getIcon()
java.lang.String
getSound()
java.lang.String
getTitle()
void
setBody(java.lang.String body)
Sets the body of the notificationvoid
setChannelId(java.lang.String channelId)
Sets the ID of the channel for Unblu notificationsvoid
setData(java.util.Map<java.lang.String,java.lang.String> data)
Sets the additional data for the Unblu notification.void
setIcon(int icon)
Sets the icon resource ID for Unblu notificationsvoid
setSound(java.lang.String sound)
Specifies the name of the sound to use for Unblu notifications.void
setTitle(java.lang.String title)
Sets the title of the notification
-
-
-
Method Detail
-
getTitle
@Nullable java.lang.String getTitle()
- Returns:
- The title of the notification
-
getBody
@Nullable java.lang.String getBody()
- Returns:
- The body of the notification
-
getIcon
int getIcon()
- Returns:
- Icon resource ID of the Unblu notification
-
getSound
@Nullable java.lang.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 java.lang.String getChannelId()
- Returns:
- The ID of the channel for the Unblu notification
-
getData
java.util.Map<java.lang.String,java.lang.String> getData()
- Returns:
- The additional data of the Unblu notification
-
setTitle
void setTitle(@Nullable java.lang.String title)
Sets the title of the notification- Parameters:
title
- The title of the notification
-
setBody
void setBody(@Nullable java.lang.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 java.lang.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 java.lang.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(java.util.Map<java.lang.String,java.lang.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.
-
-