<Callout warning>

**Note:** This functionality is not available in **tvOS**.

</Callout>

APNs supports three types of media: [audio, images, and video](#apns-supported-media-types-and-sizes). You can use a **Notification Service Extension** to download one of these media types and attach it to an incoming push notification.

**AWSPinpointPushNotificationsPlugin** provides a service extension that works with Amazon Pinpoint push notifications. You can use the service extension as-is or override certain methods to customize functionality. The following steps describe how to setup the provided Notification Service Extension in your project.

1. In your Xcode project, select **File, New, Target...**

![New target](/images/push-notifications/service-extension/01_new-target.png)

2. Select **Notification Service Extension** and click **Next**.

![Target type](/images/push-notifications/service-extension/02_target-type.png)

3. Enter a name for your service extension and click **Finish**.

![Target name](/images/push-notifications/service-extension/03_target-name.png)

4. In project settings, select the service extension target you just added, select the **General** tab, and add **AWSPinpointPushNotificationsPlugin** under **Frameworks and Libraries**.

![Add library](/images/push-notifications/service-extension/04_add-library.png)

5. When you created the service extension, Xcode created a **NotificationService.swift** file containing some boiler plate code. Locate this file under the service extension's folder and replace it's contents as show below:

![Notification Service](/images/push-notifications/service-extension/05_notification-service.png)

```swift
import AWSPinpointPushNotificationsPlugin

class NotificationService: AWSPinpointPushNotificationsPlugin.ServiceExtension {}
```

Your service extension is now setup to fetch remote media from a URL defined in Amazon Pinpoint push notifications, save the media to a temporary folder, and attach them to push notifications before they are presented to the user.

## APNs supported media types and sizes

Audio - 5MB max
- AudioInterchangeFileFormat
- WaveformAudio
- MP3
- MPEG4Audio

Image - 10 MB max
- JPEG
- GIF
- PNG

Video - 50 MB max
- MPEG
- MPEG2Video
- MPEG4
- AVIMovie
