Package com.unblu.sdk.core.notification
Class UnbluNotificationChannelConfiguration
java.lang.Object
com.unblu.sdk.core.notification.UnbluNotificationChannelConfiguration
Configures the
Apply the configuration before you create an Unblu client, as the channels are created while the client initializes.
NotificationChannels the Unblu SDK creates.
Apply the configuration before you create an Unblu client, as the channels are created while the client initializes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic StringgetChannelName(UnbluNotificationChannel channel) static booleanstatic voidsetChannelDescription(UnbluNotificationChannel channel, String description) Sets the description the given channel is shown with in the Android notification settings.static voidsetChannelName(UnbluNotificationChannel channel, String name) Sets the name the given channel is shown with in the Android notification settings.static voidsetChannelsManagedBySdk(boolean managed) Determines whether the SDK creates the notification channels for new messages (UnbluNotificationChannel.NEW_MESSAGES), incoming calls (UnbluNotificationChannel.INCOMING_CALLS), and missed calls (UnbluNotificationChannel.MISSED_CALLS).
-
Method Details
-
setChannelsManagedBySdk
public static void setChannelsManagedBySdk(boolean managed) Determines whether the SDK creates the notification channels for new messages (UnbluNotificationChannel.NEW_MESSAGES), incoming calls (UnbluNotificationChannel.INCOMING_CALLS), and missed calls (UnbluNotificationChannel.MISSED_CALLS). By default the SDK creates them.
Pass false if your app manages its own notification channels. The SDK then doesn't create any of those three channels, so only the channels your app created appear in the Android notification settings. In that case, make sure the channels the notifications are sent to exist, otherwise Android silently discards the notifications. UseNotificationInterceptortogether withUnbluNotification.setChannelId(String)to send Unblu notifications to a channel of your own.
This setting doesn't apply toUnbluNotificationChannel.ONGOING_CALLandUnbluNotificationChannel.SCREEN_SHARING. Android requires a foreground service to post its notification to an existing channel, so the SDK always creates those two. They're only created once a call or a screen sharing session starts.- Parameters:
managed- If true, the SDK creates the notification channels, otherwise your app has to create them
-
isChannelsManagedBySdk
public static boolean isChannelsManagedBySdk()- Returns:
- true if the SDK creates the notification channels for new messages
(
UnbluNotificationChannel.NEW_MESSAGES), incoming calls (UnbluNotificationChannel.INCOMING_CALLS), and missed calls (UnbluNotificationChannel.MISSED_CALLS)
-
setChannelName
Sets the name the given channel is shown with in the Android notification settings. If you don't set a name, the SDK uses its own English default.- Parameters:
channel- The channel to namename- The name of the channel, or null to fall back to the SDK default
-
setChannelDescription
public static void setChannelDescription(@NonNull UnbluNotificationChannel channel, @Nullable String description) Sets the description the given channel is shown with in the Android notification settings. If you don't set a description, the channel is shown without one, unless the SDK provides a default.- Parameters:
channel- The channel to describedescription- The description of the channel, or null to fall back to the SDK default
-
getChannelName
- Parameters:
channel- The channel to get the name of- Returns:
- The name set via
setChannelName(UnbluNotificationChannel, String), or null if none was set
-
getChannelDescription
- Parameters:
channel- The channel to get the description of- Returns:
- The description set via
setChannelDescription(UnbluNotificationChannel, String), or null if none was set
-