Asks you to make any needed changes to the notification and notify the system when you're done.
- iOS 10.0+
- macOS 10.14+
- UIKit for Mac 13.0+Beta
- watchOS 6.0+Beta
The original notification request. Use this object to get the original content of the notification.
The block to execute with the modified content. This block has no return value and takes the following parameter:
UNNotificationobject with the content to be displayed to the user.
Override this method and use it to modify the
UNNotification object that was delivered with the notification. At some point during your implementation, execute the
content block and pass it your modified content. If you decide not to modify the content, call the
content block with the original content from the
You can modify any of the content from the original request. You might customize the content for the current user or replace it altogether. You can use this method to download images or movies and add them as attachments to the content. You may also modify the alert text as long as you do not remove it. If the content object does not contain any alert text, the system ignores your modifications and delivers the original notification content.
Your extension has a limited amount of time (no more than 30 seconds) to modify the content and execute the
content block. If you do not execute that block in a timely manner, the system calls your extension’s
service method to give you one last chance to execute the block. If you do not, the system presents the notification’s original content to the user.