Class UnbluNotificationChannelConfiguration

java.lang.Object
com.unblu.sdk.core.notification.UnbluNotificationChannelConfiguration

public final class UnbluNotificationChannelConfiguration extends Object
Configures the NotificationChannels the Unblu SDK creates.
Apply the configuration before you create an Unblu client, as the channels are created while the client initializes.
  • 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. Use NotificationInterceptor together with UnbluNotification.setChannelId(String) to send Unblu notifications to a channel of your own.
      This setting doesn't apply to UnbluNotificationChannel.ONGOING_CALL and UnbluNotificationChannel.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

      public static void setChannelName(@NonNull UnbluNotificationChannel channel, @Nullable String name)
      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 name
      name - 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 describe
      description - The description of the channel, or null to fall back to the SDK default
    • getChannelName

      @Nullable public static String getChannelName(@NonNull UnbluNotificationChannel channel)
      Parameters:
      channel - The channel to get the name of
      Returns:
      The name set via setChannelName(UnbluNotificationChannel, String), or null if none was set
    • getChannelDescription

      @Nullable public static String getChannelDescription(@NonNull UnbluNotificationChannel channel)
      Parameters:
      channel - The channel to get the description of
      Returns:
      The description set via setChannelDescription(UnbluNotificationChannel, String), or null if none was set