NotificationConfig

data class NotificationConfig @JvmOverloads constructor(val pushNotificationsEnabled: Boolean = true, val ignorePushMessagesWhenUserOnline: Boolean = true, val ignorePushMessageWhenUserOnline: (type: String) -> Boolean = { type -> when (type) { ChatNotification.TYPE_MESSAGE_NEW -> ignorePushMessagesWhenUserOnline ChatNotification.TYPE_NOTIFICATION_REMINDER_DUE -> false // Always show reminder notifications else -> true // Default behavior for unknown types } }, val pushDeviceGenerators: List<PushDeviceGenerator> = listOf(), val shouldShowNotificationOnPush: () -> Boolean = { true }, val requestPermissionOnAppLaunch: () -> Boolean = { true }, val autoTranslationEnabled: Boolean = false, val tokenProvider: TokenProvider? = null)

Push notifications configuration class

Constructors

Link copied to clipboard
constructor(pushNotificationsEnabled: Boolean = true, ignorePushMessagesWhenUserOnline: Boolean = true, ignorePushMessageWhenUserOnline: (type: String) -> Boolean = { type -> when (type) { ChatNotification.TYPE_MESSAGE_NEW -> ignorePushMessagesWhenUserOnline ChatNotification.TYPE_NOTIFICATION_REMINDER_DUE -> false // Always show reminder notifications else -> true // Default behavior for unknown types } }, pushDeviceGenerators: List<PushDeviceGenerator> = listOf(), shouldShowNotificationOnPush: () -> Boolean = { true }, requestPermissionOnAppLaunch: () -> Boolean = { true }, autoTranslationEnabled: Boolean = false, tokenProvider: TokenProvider? = null)

Properties

Link copied to clipboard

Whether or not the auto-translation feature is enabled.

Link copied to clipboard

Push notifications are ignored and not displayed when the user is online (when there is an active WebSocket connection). Set to false if you would like to receive and handle push notifications even if user is online. Default value is true.

Link copied to clipboard

There is different behaviour for receiving push messages when ths user is online (when there is an active WebSocket connection) depending on the type of the message.

Link copied to clipboard
val pushDeviceGenerators: List<PushDeviceGenerator>

A list of generators responsible for providing the information needed to register a device

Link copied to clipboard

Enables/disables push notifications on the device. Device's token won't be registered if push notifications are disabled.

Link copied to clipboard

Allows SDK to request android.Manifest.permission.POST_NOTIFICATIONS permission for a connected user.

Link copied to clipboard

Allows enabling/disabling showing notification after receiving a push message.

Link copied to clipboard

A token provider to be used on case of restoring user credentials and an expired token needs to be refreshed. If not provided, the SDK will create a TokenProvider with the last token used within the client.