Called to let your app know which action was selected by the user for a given notification.
- iOS 10.0+
- watchOS 3.0+
The notification center that received the notification.
The user’s response to the notification. This object contains the original notification and the identifier string for the selected action. If the action allowed the user to provide a textual response, this object is an instance of the
Input Notification Response
The block to execute when you have finished processing the user’s response. You must execute this block from your method and should call it as quickly as possible. The block has no return value or parameters.
Use this method to perform the tasks associated with your app’s custom actions. When the user responds to a notification, the system calls this method with the results. You use this method to perform the task associated with that action, if at all. At the end of your implementation, you must call the
completion block to let the system know that you are done processing the notification.
You specify your app’s notification types and custom actions using
UNNotification objects. You create these objects at initialization time and register them with the user notification center. Even if you register custom actions, the action in the
response parameter might indicate that the user dismissed the notification without performing any of your actions.
If you do not implement this method, your app never responds to custom actions.