Created
May 28, 2018 17:45
-
-
Save pgpt10/abdfd0bfc39653387bb6d77854f3a76e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Actions | |
let remindLaterAction = UNNotificationAction(identifier: "remindLater", title: "Remind me later", options: UNNotificationActionOptions(rawValue: 0)) | |
let acceptAction = UNNotificationAction(identifier: "accept", title: "Accept", options: .foreground) | |
let declineAction = UNNotificationAction(identifier: "decline", title: "Decline", options: .destructive) | |
let commentAction = UNTextInputNotificationAction(identifier: "comment", title: "Comment", options: .authenticationRequired, textInputButtonTitle: "Send", textInputPlaceholder: "Share your thoughts..") | |
//Category | |
let invitationCategory = UNNotificationCategory(identifier: "INVITATION", actions: [remindLaterAction, acceptAction, declineAction, commentAction], intentIdentifiers: [], options: UNNotificationCategoryOptions(rawValue: 0)) | |
//Register the app’s notification types and the custom actions that they support. | |
center.setNotificationCategories([invitationCategory]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment