createNotificationHandler
fun createNotificationHandler(context: Context, notificationConfig: NotificationConfig, newMessageIntent: (message: Message, channel: Channel) -> Intent = getDefaultNewMessageIntentFun(context), notificationChannel: () -> NotificationChannel = getDefaultNotificationChannel(context), userIconBuilder: UserIconBuilder = provideDefaultUserIconBuilder(context), permissionHandler: NotificationPermissionHandler? = provideDefaultNotificationPermissionHandler(context), notificationTextFormatter: (currentUser: User?, message: Message) -> CharSequence = getDefaultNotificationTextFormatter(notificationConfig), actionsProvider: (notificationId: Int, channel: Channel, message: Message) -> List<NotificationCompat.Action> = getDefaultActionsProvider(context), notificationBuilderTransformer: (NotificationCompat.Builder, ChatNotification) -> NotificationCompat.Builder = { builder, _ -> builder }): NotificationHandler
Method that creates a NotificationHandler.
Return
A NotificationHandler instance.
Parameters
context
The Context to build the NotificationHandler with.
notificationConfig
Configuration for push notifications.
newMessageIntent
Lambda expression used to generate an Intent to open your app
notificationChannel
Lambda expression used to generate a NotificationChannel. Used in SDK_INT >= VERSION_CODES.O.
userIconBuilder
Generates IconCompat to be shown on notifications.
permissionHandler
Handles android.Manifest.permission.POST_NOTIFICATIONS permission lifecycle.
notificationTextFormatter
Lambda expression used to formats the text of the notification.
actionsProvider
Lambda expression used to provide actions for the notification.
notificationBuilderTransformer
Lambda expression used to transform the NotificationCompat.Builder before building the notification.