Rich Notification: What It Is, Media Content, and Creating Notifications

Author: IT Sectr Published: 2026-03-20 Reading time: 8 min

Rich Notification is an enhanced format of iOS push notifications that includes media attachments, interactive buttons, and custom interfaces to improve user experience. Unlike standard text notifications, Rich Notification can display images, videos, and audio directly in the banner or on the lock screen. According to Apple Developer Documentation, 2026, UNNotificationAttachment supports up to 10 files in a single notification and automatically scales them for optimal display on all devices.

Key Takeaways

  • Media Attachments — Rich Notification supports images (JPEG, PNG, GIF), video (MP4, MOV up to 30 seconds), and audio (MP3, AAC, WAV) via UNNotificationAttachment.
  • Interactivity — buttons and text input are added through UNNotificationAction and UNTextInputNotificationAction, tied to notification categories.
  • Service Extension — a mandatory component for media loading: it downloads the attachment from the payload URL and adds it to the content.
  • Content Extension — creates a fully custom notification interface with custom UI, animations, and gesture handling.
  • Limits — maximum attachment size is 10 MB, extension memory limit is 50 MB, processing time is up to 30 seconds.

What Is Rich Notification

Rich Notification is an iOS push notification that contains not only text but also media attachments, interactive elements, and a customized interface. The term “rich” reflects the ability to include images, videos, audio, action buttons, and text input in a notification, turning a simple alert into a full-fledged interactive element.

Evolution of Notifications in iOS

Apple introduced Rich Notification support in iOS 10 along with the UserNotifications framework. Before this, push notifications could only contain text, sound, and a badge. iOS 10 introduced UNNotificationServiceExtension and UNNotificationContentExtension, which opened up the ability to modify content and create custom interfaces. Later versions added SwiftUI support in Content Extension, animated GIFs, and improved media scaling.

Advantages Over Standard Notifications

Rich Notification significantly increases user engagement. Apple studies show that notifications with images receive 30–40% more interactions compared to text-only ones. A product image, video preview, or quick reply button allows the user to make a decision directly from the notification without opening the app. This shortens the path to the target action and improves the user experience.

Media Attachment Types and Formats

UNNotificationAttachment supports three media categories: images, video, and audio. Each type has its own format, size, and duration limitations. The system automatically scales images to fit the notification size and limits video duration to 30 seconds for performance optimization.

Media TypeSupported FormatsMaximum Size
ImagesJPEG, PNG, GIF, TIFF10 MB per file
VideoMPEG, MP4, MOV10 MB, up to 30 seconds
AudioMP3, AAC, WAV, CAF10 MB

Images and Animated GIFs

Images are automatically cropped and scaled by the system for display in compact and expanded notification views. Animated GIFs are supported starting from iOS 12 and play automatically when viewing the notification. The recommended image size is 1024x1024 pixels, ensuring sharp display on all devices, including iPad with a large screen.

Video and Audio Attachments

Video in Rich Notification plays without sound by default — the user can enable sound via the player button. Maximum video duration is 30 seconds, after which playback stops. Audio attachments can be used for voice messages or sound previews and play when tapping the notification in the expanded view.

Interactive Buttons and Actions

Interactive actions allow the user to perform operations directly from the notification without opening the app. Actions are registered via UNNotificationCategory and UNNotificationAction when the app launches. Each action can be background (without opening the app) or foreground (opens the app to complete the operation).

UNNotificationAction and UNTextInputNotificationAction

UNNotificationAction represents a button with a title and optional modifiers such as requiresAuthentication (requires Face ID/Touch ID) or destructive (highlighted in red). UNTextInputNotificationAction extends this capability by adding a text input field — ideal for quick replies to messages or comments. Actions are displayed on long press on the notification or swipe down.

Registering Categories and Actions

Notification categories link the content type with a set of available actions. The registration process is performed in AppDelegate at app launch via UNUserNotificationCenter.current().setNotificationCategories. The category is specified on the server in the category field of the JSON payload, and the system automatically applies the corresponding set of actions to the notification.

Handling Action Taps

When the user taps a button or submits text, the system calls the UNUserNotificationCenterDelegate with the didReceive response method. UNNotificationResponse contains the action identifier and the entered text (for UNTextInputNotificationAction). Based on this information, the app executes the corresponding business logic: sends a message, confirms an action, or opens a specific screen.

Implementing Rich Notification in Swift

Let us walk through the full Rich Notification creation cycle: from registering categories in AppDelegate to processing in Service Extension and displaying. AppDelegate registers the category with buttons, the server sends a notification with an image URL, Service Extension downloads the media, and Content Extension displays a custom interface with buttons.

swift
// AppDelegate — registering categories and actions
func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions:
    [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {

    let replyAction = UNTextInputNotificationAction(
        identifier: "reply",
        title: "Reply",
        options: [.authenticationRequired])

    let likeAction = UNNotificationAction(
        identifier: "like",
        title: "Like",
        options: [])

    let category = UNNotificationCategory(
        identifier: "social_post",
        actions: [replyAction, likeAction],
        intentIdentifiers: [],
        options: [])

    UNUserNotificationCenter.current()
        .setNotificationCategories([category])
    return true
}

Service Extension for Loading Images

After receiving a push notification with the “social_post” category and an image URL in a custom field, the Service Extension is activated. The extension downloads the image from the network, creates a UNNotificationAttachment with a unique identifier, and adds it to the content. It is important to check the size of the downloaded file — if it exceeds 10 MB, the attachment will not be created, and the system will show the notification without media.

swift
class NotificationService: UNNotificationServiceExtension {

    override func didReceive(
        _ request: UNNotificationRequest,
        withContentHandler contentHandler:
        @escaping (UNNotificationContent) -> Void
    ) {
        let content = (request.content.mutableCopy()
            as! UNMutableNotificationContent)
        guard let urlString = content.userInfo["media-url"]
            as? String,
            let url = URL(string: urlString)
        else { contentHandler(request.content); return }

        URLSession.shared.downloadTask(with: url) {
            location, _, _ in
            guard let location = location else {
                contentHandler(content); return }
            let attachment = try! UNNotificationAttachment(
                identifier: "media", url: location,
                options: [UNNotificationAttachmentOptionsTypeHintKey:
                    "jpg"])
            content.attachments = [attachment]
            contentHandler(content)
        }.resume()
    }
}

Testing Rich Notification

To test Rich Notification without a server, use the iOS simulator and send pushes via terminal using xcrun simctl push. In the payload, be sure to specify mutable-content: 1 to activate the Service Extension and the category to display actions. The command fires a push from a JSON file directly to the selected simulator, allowing quick iteration without setting up server infrastructure.

Content Extension and Custom Interface

UNNotificationContentExtension allows you to completely replace the standard notification interface with a custom UIKit or SwiftUI view. The extension activates when the user expands the notification (force touch or swipe down) and can contain buttons, sliders, animations, and any other UI components. The interface size adapts to the content using Auto Layout.

Storyboard and SwiftUI in Content Extension

Content Extension is based on a storyboard with a view controller inheriting UIViewController. SwiftUI View is integrated via UIHostingController starting from iOS 16, allowing modern approaches to interface building. For backward compatibility with iOS 14–15, it is recommended to use UIKit with xib files. The interface receives modified content from Service Extension via UNNotificationContent.

Handling User Actions

Content Extension implements the UNNotificationContentExtension protocol with the didReceive response method. UNNotificationResponse contains information about the pressed button or entered text. The extension can update the interface without closing the notification or call the completion handler to close it. This allows creating quick interaction scenarios, such as a “like” with visual feedback directly in the notification.

Design Recommendations

Apple recommends keeping Content Extension concise and functional, avoiding excessive elements. The maximum height of the expanded notification is about 400 points, after which content scrolls. Use system fonts and spacing for consistency with other notifications. Test on different screen sizes to ensure the interface displays correctly on both iPhone and iPad.

Frequently Asked Questions

What is the maximum image size in Rich Notification?

The maximum size of a single media attachment is 10 MB. If the limit is exceeded, UNNotificationAttachment is not created, and the notification is displayed without media. It is recommended to optimize images to 1–3 MB for fast loading in Service Extension.

Do Rich Notifications work on all iPhone models?

Rich Notifications are supported on all devices with iOS 10 and later, including iPhone 5s and newer. Content Extension with custom UI is available from iOS 12. SwiftUI in Content Extension — from iOS 16. On older versions, the notification displays in standard form.

Can GIF be used in Rich Notification?

Yes, animated GIFs are supported starting from iOS 12. GIF is loaded via UNNotificationAttachment as a regular image and automatically plays when viewing the notification. The GIF size is limited to the same 10 MB as other formats.

How many buttons can be added to a notification?

Maximum 4 actions per notification when registering a category. If more are specified, the system displays the first 4 and ignores the rest. It is recommended to use 2–3 buttons for optimal UX — too many options overload the interface.

Is a server required to send Rich Notifications?

Yes, the server must send pushes via APNS (Apple Push Notification service) with a JSON payload containing the media file URL in a custom field and the mutable-content: 1 flag. The server also specifies the category to activate the Content Extension and actions.

Summary

  • Rich Notification — an iOS push notification with media attachments, interactive buttons, and custom UI that increases user engagement.
  • Supported media — JPEG/PNG/GIF images, MP4/MOV video (up to 30 s), MP3/AAC/WAV audio with a 10 MB limit per file.
  • Service Extension downloads media from the payload URL and adds UNNotificationAttachment to the notification content.
  • Interactive actions — up to 4 buttons per category, including text input via UNTextInputNotificationAction.
  • Content Extension replaces the standard interface with a custom UIKit/SwiftUI view with arbitrary elements.
  • Content Extension implements the UNNotificationContentExtension protocol with the didReceive method for handling taps and updating the UI in real time.
  • Rich Notification requires configuration at all levels: server (APNS), Service Extension (media loading), and AppDelegate (category registration).

We will develop a mobile application turnkey

IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.

Discuss the project

Read also