Instance Method


Handles a notification action selected by the user.


- (void)didReceiveNotificationResponse:(UNNotificationResponse *)response completionHandler:(void (^)(UNNotificationContentExtensionResponseOption option))completion;



The response object that identifies the user-selected action. Use this object to get information about the notification and the user’s response.


The block to execute when you are finished performing the action. You must call this block at some point during your implementation. The block has no return value and takes the following parameter:


The response you want to take for the notification. For a list of possible options, see UNNotificationContentExtensionResponseOption.


Implement this method when you want your view controller to handle actions selected by the user. Use your implementation to perform the associated task and then execute the completion block. If you implement this method, you must handle all actions defined in all categories managed by your Notification Content app extension. If you don't implement this method, the system notifies your app when the user selects an action.

See Also

Handling Custom Actions


Constants indicating the preferred response to a notification.