showNotification

fun Context.showNotification(channelId: String, title: String, message: String, @DrawableRes icon: Int, notificationId: Int = 0, pendingIntent: PendingIntent? = null)

Extension function of Context to display notification

Receiver

Context

Parameters

channelId

String of group notification that this notification will be displayed in

title

String title of the notification

message

String message of the notification

icon

DrawableRes as the notification icon

notificationId

id for current notification

pendingIntent

PendingIntent to run when notification is clicked, nullable by default