---
title: UNNotificationContentExtension
framework: usernotificationsui
role: symbol
role_heading: Protocol
path: usernotificationsui/unnotificationcontentextension
---

# UNNotificationContentExtension

An object that presents a custom interface for a delivered local or remote notification.

## Declaration

```swift
protocol UNNotificationContentExtension : NSObjectProtocol
```

## Mentioned in

Customizing the Appearance of Notifications

## Overview

Overview The UNNotificationContentExtension protocol provides the entry point for a notification content app extension, which displays a custom interface for your app’s notifications. You adopt this protocol in the custom UIViewController subclass that you use to present your interface. You create this type of extension to improve the way your notifications are presented, possibly by adding custom colors and branding, or by incorporating media and other dynamic content into your notification interface. To define a notification content app extension, add a notification content extension target to the Xcode project containing your app. The default Xcode template contains a source file and storyboard for your view controller. The Info.plist file of the extension comes mostly configured. Specifically, the NSExtensionPointIdentifier key is set to the value com.apple.usernotifications.content-extension, and the NSExtensionMainStoryboard key is set to the name of the project’s storyboard file. However, the NSExtensionAttribute key contains a dictionary of additional keys and values, which are listed in the following table.  |   |   |   |   |  If the notification category includes custom actions, the system automatically adds action buttons to your notification interface; don’t create those buttons yourself. If your view controller implements the optional didReceive(_:completionHandler:) method, the system calls that method to respond to any selected actions. If your view controller doesn’t implement that method, the system delivers the selected action to your app for handling. The system prevents the delivery of touch events to your view controller while it is onscreen. Do not install gesture recognizers or rely on touch events in your interface. For information about how to implement your notification content app extension, see Customizing the Appearance of Notifications.

## Topics

### Processing Notifications

- [didReceive(_:)](usernotificationsui/unnotificationcontentextension/didreceive(_:).md)

### Handling Custom Actions

- [didReceive(_:completionHandler:)](usernotificationsui/unnotificationcontentextension/didreceive(_:completionhandler:).md)
- [UNNotificationContentExtensionResponseOption](usernotificationsui/unnotificationcontentextensionresponseoption.md)

### Supporting Media Playback

- [mediaPlayPauseButtonType](usernotificationsui/unnotificationcontentextension/mediaplaypausebuttontype.md)
- [UNNotificationContentExtensionMediaPlayPauseButtonType](usernotificationsui/unnotificationcontentextensionmediaplaypausebuttontype.md)
- [mediaPlayPauseButtonFrame](usernotificationsui/unnotificationcontentextension/mediaplaypausebuttonframe.md)
- [mediaPlayPauseButtonTintColor](usernotificationsui/unnotificationcontentextension/mediaplaypausebuttontintcolor.md)
- [mediaPlay()](usernotificationsui/unnotificationcontentextension/mediaplay().md)
- [mediaPause()](usernotificationsui/unnotificationcontentextension/mediapause().md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Related Documentation

- [Scheduling a notification locally from your app](usernotifications/scheduling-a-notification-locally-from-your-app.md)
- [Setting up a remote notification server](usernotifications/setting-up-a-remote-notification-server.md)

### Notification Content App Extension

- [Customizing the Appearance of Notifications](usernotificationsui/customizing-the-appearance-of-notifications.md)
