-
public final class NotificationConfigPush notifications configuration class
-
-
Field Summary
Fields Modifier and Type Field Description private final BooleanpushNotificationsEnabledprivate final Function1<String, Boolean>ignorePushMessageWhenUserOnlineprivate final List<PushDeviceGenerator>pushDeviceGeneratorsprivate final Function0<Boolean>shouldShowNotificationOnPushprivate final Function0<Boolean>requestPermissionOnAppLaunchprivate final BooleanautoTranslationEnabledprivate final TokenProvidertokenProvider
-
Constructor Summary
Constructors Constructor Description NotificationConfig(Boolean pushNotificationsEnabled, Function1<String, Boolean> ignorePushMessageWhenUserOnline, List<PushDeviceGenerator> pushDeviceGenerators, Function0<Boolean> shouldShowNotificationOnPush, Function0<Boolean> requestPermissionOnAppLaunch, Boolean autoTranslationEnabled, TokenProvider tokenProvider)NotificationConfig(Boolean pushNotificationsEnabled, Function1<String, Boolean> ignorePushMessageWhenUserOnline, List<PushDeviceGenerator> pushDeviceGenerators, Function0<Boolean> shouldShowNotificationOnPush, Function0<Boolean> requestPermissionOnAppLaunch, Boolean autoTranslationEnabled)NotificationConfig(Boolean pushNotificationsEnabled, Function1<String, Boolean> ignorePushMessageWhenUserOnline, List<PushDeviceGenerator> pushDeviceGenerators, Function0<Boolean> shouldShowNotificationOnPush, Function0<Boolean> requestPermissionOnAppLaunch)NotificationConfig(Boolean pushNotificationsEnabled, Function1<String, Boolean> ignorePushMessageWhenUserOnline, List<PushDeviceGenerator> pushDeviceGenerators, Function0<Boolean> shouldShowNotificationOnPush)NotificationConfig(Boolean pushNotificationsEnabled, Function1<String, Boolean> ignorePushMessageWhenUserOnline, List<PushDeviceGenerator> pushDeviceGenerators)NotificationConfig(Boolean pushNotificationsEnabled, Function1<String, Boolean> ignorePushMessageWhenUserOnline)NotificationConfig(Boolean pushNotificationsEnabled)NotificationConfig()
-
Method Summary
Modifier and Type Method Description final BooleangetPushNotificationsEnabled()Enables/disables push notifications on the device. final Function1<String, Boolean>getIgnorePushMessageWhenUserOnline()There is different behaviour for receiving push messages when the user is online (when there is an active WebSocket connection) depending on the type of the message. final List<PushDeviceGenerator>getPushDeviceGenerators()A list of generators responsible for providing the information needed to register a device final Function0<Boolean>getShouldShowNotificationOnPush()Allows enabling/disabling showing notification after receiving a push message. final Function0<Boolean>getRequestPermissionOnAppLaunch()Allows SDK to request android.Manifest.permission.POST_NOTIFICATIONS permission for a connected user. final BooleangetAutoTranslationEnabled()Whether or not the auto-translation feature is enabled. final TokenProvidergetTokenProvider()A token provider to be used on case of restoring user credentials and an expired token needs to be refreshed. -
-
Constructor Detail
-
NotificationConfig
NotificationConfig(Boolean pushNotificationsEnabled, Function1<String, Boolean> ignorePushMessageWhenUserOnline, List<PushDeviceGenerator> pushDeviceGenerators, Function0<Boolean> shouldShowNotificationOnPush, Function0<Boolean> requestPermissionOnAppLaunch, Boolean autoTranslationEnabled, TokenProvider tokenProvider)
-
NotificationConfig
NotificationConfig(Boolean pushNotificationsEnabled, Function1<String, Boolean> ignorePushMessageWhenUserOnline, List<PushDeviceGenerator> pushDeviceGenerators, Function0<Boolean> shouldShowNotificationOnPush, Function0<Boolean> requestPermissionOnAppLaunch, Boolean autoTranslationEnabled)
-
NotificationConfig
NotificationConfig(Boolean pushNotificationsEnabled, Function1<String, Boolean> ignorePushMessageWhenUserOnline, List<PushDeviceGenerator> pushDeviceGenerators, Function0<Boolean> shouldShowNotificationOnPush, Function0<Boolean> requestPermissionOnAppLaunch)
-
NotificationConfig
NotificationConfig(Boolean pushNotificationsEnabled, Function1<String, Boolean> ignorePushMessageWhenUserOnline, List<PushDeviceGenerator> pushDeviceGenerators, Function0<Boolean> shouldShowNotificationOnPush)
-
NotificationConfig
NotificationConfig(Boolean pushNotificationsEnabled, Function1<String, Boolean> ignorePushMessageWhenUserOnline, List<PushDeviceGenerator> pushDeviceGenerators)
-
NotificationConfig
NotificationConfig(Boolean pushNotificationsEnabled, Function1<String, Boolean> ignorePushMessageWhenUserOnline)
-
NotificationConfig
NotificationConfig(Boolean pushNotificationsEnabled)
-
NotificationConfig
NotificationConfig()
-
-
Method Detail
-
getPushNotificationsEnabled
final Boolean getPushNotificationsEnabled()
Enables/disables push notifications on the device. Device's token won't be registered if push notifications are disabled.
-
getIgnorePushMessageWhenUserOnline
final Function1<String, Boolean> getIgnorePushMessageWhenUserOnline()
There is different behaviour for receiving push messages when the user is online (when there is an active WebSocket connection) depending on the type of the message.
Supported types:
ChatNotification.TYPE_MESSAGE_NEW - new message notification
ChatNotification.TYPE_MESSAGE_UPDATED - message update notification
ChatNotification.TYPE_REACTION_NEW - new reaction notification
ChatNotification.TYPE_NOTIFICATION_REMINDER_DUE - reminder notification
The default behaviour is:
ChatNotification.TYPE_MESSAGE_NEW, the push is ignored when the user is online.
ChatNotification.TYPE_MESSAGE_UPDATED, the push is ignored when the user is online.
ChatNotification.TYPE_REACTION_NEW, the push is ignored when the user is online.
ChatNotification.TYPE_NOTIFICATION_REMINDER_DUE, the push is shown when the user is online.
This function allows you to customize the behavior for different notification types.
-
getPushDeviceGenerators
final List<PushDeviceGenerator> getPushDeviceGenerators()
A list of generators responsible for providing the information needed to register a device
-
getShouldShowNotificationOnPush
final Function0<Boolean> getShouldShowNotificationOnPush()
Allows enabling/disabling showing notification after receiving a push message.
-
getRequestPermissionOnAppLaunch
final Function0<Boolean> getRequestPermissionOnAppLaunch()
Allows SDK to request android.Manifest.permission.POST_NOTIFICATIONS permission for a connected user.
-
getAutoTranslationEnabled
final Boolean getAutoTranslationEnabled()
Whether or not the auto-translation feature is enabled.
-
getTokenProvider
final TokenProvider getTokenProvider()
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.
-
-
-
-