onCreateNotification
open fun onCreateNotification(context: Context, notificationPayload: NotificationPayload): NotificationCompat.Builder?
Override this method if you want to build your own notification UI notification using the provided notificationPayload.
Return
NotificationCompat.Builder if want to should your custom UI for the notification, Otherwise return null, if you want SDK to build its default UI.
Example usage: If you want to show your own UI based on specific condition.
override fun onCreateNotification(
context: Context,
notificationPayload: NotificationPayload
) {
if(someCondition(notificationPayload)){
val notificationBuilder = buildMyOwnTemplate(notificationPayload)
return notificationBuilder
}
return null
}
Content copied to clipboard
Parameters
context
instance of Context
notificationPayload
instance of NotificationPayload representing payload of the notification