How can I add notification actions(custom buttons)...
# ios
y
How can I add notification actions(custom buttons) to my notifications? I am not able to set a title and identifier to
UNNotificationAction
, 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
Copy code
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?
not kotlin but kotlin colored 1