i want to add facility in my iOS application that user can reply to the my message directly from the push notification. Like iMessage app is doing it in iOS 8. I am able to
Swift 4.2, 4.0+ of satheeshwaran answer.
//creating the inline reply notification action
let replyAction = UIMutableUserNotificationAction()
replyAction.title = "Say Something"
replyAction.identifier = "inline-reply"
replyAction.activationMode = .background
replyAction.isAuthenticationRequired = false
replyAction.behavior = .textInput
//creating a category
let notificationCategory = UIMutableUserNotificationCategory()
notificationCategory.identifier = "INVITE_CATEGORY"
notificationCategory.setActions([replyAction], for: .default)
//registerting for the notification.
let categories = NSSet(array: [notificationCategory]) as? Set
let settings = UIUserNotificationSettings(types: [ .sound, .alert,.badge], categories: categories)
application.registerUserNotificationSettings(settings)