youssef hachicha
12/02/2024, 9:57 AMUNNotificationAction
, kotlin doesn't allow me to set values for that
I was only able to do that for UIMutableUserNotificationAction
but when I use UIMutableUserNotificationAction
the notification doesn't even show up
val pauseButton = UIMutableUserNotificationAction().apply {
this.setTitle("pause")
this.setIdentifier("pause_action")
this.setBehavior(UIUserNotificationActionBehavior.UIUserNotificationActionBehaviorDefault)
}
val cancelButton = UIMutableUserNotificationAction().apply {
this.setTitle("cancel_action")
this.setIdentifier("cancel")
this.setBehavior(UIUserNotificationActionBehavior.UIUserNotificationActionBehaviorDefault)
}
val meetingInviteCategory =
UNNotificationCategory.categoryWithIdentifier(
identifier = "meetingInviteCategory",
actions = listOf(pauseButton, cancelButton),
intentIdentifiers = emptyList<String>(),
hiddenPreviewsBodyPlaceholder = "",
options = UNNotificationCategoryOptionCustomDismissAction
)
val content = UNMutableNotificationContent().apply {
setTitle(title)
}
val request = UNNotificationRequest.requestWithIdentifier(
identifier = notificationId.toString(),
content = content,
trigger = null
)
center.apply {
setNotificationCategories(setOf(meetingInviteCategory))
addNotificationRequest(
request,
null
)
}
also is it possible to provide documentation for the Ios part?