RORK LABJP
MAX — Rork Max generates native Swift apps for iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessageNATIVE — It unlocks native capabilities React Native cannot reach: AR/LiDAR, Metal 3D, widgets, Dynamic Island, Live Activities, Siri Intents, and HealthKitRN — Standard Rork builds cross-platform apps with React Native (Expo), a good fit when you want something working fastCHOICE — Pick React Native for speed, or Rork Max when you need Apple hardware and OS integrationPRICE — Rork is free to start with paid plans from $25/mo; Rork Max is $200/moFLOW — Describe the app you want in plain language and Rork produces working code you can ship to the storesMAX — Rork Max generates native Swift apps for iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessageNATIVE — It unlocks native capabilities React Native cannot reach: AR/LiDAR, Metal 3D, widgets, Dynamic Island, Live Activities, Siri Intents, and HealthKitRN — Standard Rork builds cross-platform apps with React Native (Expo), a good fit when you want something working fastCHOICE — Pick React Native for speed, or Rork Max when you need Apple hardware and OS integrationPRICE — Rork is free to start with paid plans from $25/mo; Rork Max is $200/moFLOW — Describe the app you want in plain language and Rork produces working code you can ship to the stores
Articles/Dev Tools
Dev Tools/2026-06-18Advanced

A Custom Screen Appears When You Long-Press a Notification in a Rork Max App — Implementing a Notification Content Extension

How to add a Notification Content Extension to a Swift app generated by Rork Max so a custom UI is drawn only when the notification expands. Covers the split with the Service Extension, updating the in-notification UI from a button, sharing state via an App Group, and the order to check when nothing shows — all with working code.

Rork Max172Notification Content ExtensionPush Notifications8UserNotificationsSwift28App Group4

Premium Article

I run a small indie app on the App Store that delivers a single piece of artwork every morning. Push notifications could already show an image, but one day a user wrote in asking to save the day's picture straight from the notification. Not tap through to open the app — finish the whole thing inside the notification. That is a place standard rich notifications cannot reach.

There are two mechanisms for changing how a notification looks, and I confused them myself at first, so let me start with that distinction. Rork Max generates native Swift, but "drawing your own screen inside the notification" does not appear by running the generated scaffold as-is. Adding the extension target, matching categories, working within the memory limits — I'll walk through the dirt in the order I wired it into my own app.

The Service Extension and the Content Extension do different jobs

UserNotifications has two extension points. Confuse them and you wander a maze of "the image shows but the button does nothing" and "I built the UI but it never appears."

ExtensionWhen it runsWhat it can doWhat it cannot do
Notification Service ExtensionRight after delivery, before displayRewrite the payload, fetch attachments like images, decryptDraw UI or respond to interaction
Notification Content ExtensionWhen the user expands the notificationDraw UI in your own view controller, update it from a buttonPre-delivery payload work (that is the Service side's job)

To put it plainly: downloading the image and attaching it to the notification is the Service Extension's job, and drawing your own card with a "Save" button when that notification is expanded (long-press or pull down) is the Content Extension's job. This request was the latter. The two work together, and in production I find they usually ship as a pair.

A category is the "password" that ties it together

Whether the Content Extension appears at all comes down entirely to a matching category identifier. The flow is this:

  1. The main app registers a UNNotificationCategory (its identifier and the action buttons you want)
  2. The push payload carries the same identifier as category
  3. The Content Extension's Info.plist sets the same identifier in UNNotificationExtensionCategory

If those three drift by even one character, the custom UI silently fails to appear. No error is raised, so this is where the first failure almost always lives.

Registration on the main app side happens once, at launch.

import UserNotifications
 
enum NotificationSetup {
    static func registerCategories() {
        let save = UNNotificationAction(
            identifier: "SAVE_PICK",
            title: "Save",
            options: []
        )
        let openShuffle = UNNotificationAction(
            identifier: "SHUFFLE_PICK",
            title: "See another piece",
            options: []
        )
        let dailyPick = UNNotificationCategory(
            identifier: "DAILY_PICK",          // ← this password matters
            actions: [save, openShuffle],
            intentIdentifiers: [],
            options: []
        )
        UNUserNotificationCenter.current()
            .setNotificationCategories([dailyPick])
    }
}

The payload you send carries the same category, plus mutable-content so the Service Extension goes and fetches the image.

{
  "aps": {
    "alert": { "title": "Today's piece", "body": "Your artwork for today has arrived" },
    "mutable-content": 1,
    "category": "DAILY_PICK"
  },
  "image_url": "https://example.com/picks/2026-06-18.jpg"
}

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Separate the Service Extension (rewrite before delivery) from the Content Extension (draw on expand) and decide which one your app actually needs
Get the four Info.plist keys including UNNotificationExtensionCategory and UserInteractionEnabled, plus working code that returns completion(.doNotDismiss) to update the in-notification UI on a button tap
Learn the App Group design that shares the saved state with the main app, and the six things to check, in order, when the custom UI refuses to appear
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Dev Tools2026-06-18
Running Rork Max Swift Apps in Many Languages with String Catalog
An operational design for taking the Swift apps Rork Max generates into multiple languages, centered on the .xcstrings String Catalog. From extracting strings to handling plurals, pouring in translations, and checking for breakage, these are the lessons from keeping multilingual apps running.
Dev Tools2026-06-17
Why Your Rork Max Native Swift Widget Freezes After Day One — Designing the TimelineProvider Refresh Budget
Native Swift home screen widgets generated by Rork Max stop rotating after the first day unless you understand the TimelineProvider refresh budget. Here is how reloadPolicy, App Groups, and deep links fit together in a real app.
Dev Tools2026-06-16
Putting Your Rork Max Native App's Content into iPhone Search — Becoming a 'Findable' App with Core Spotlight
Index the content of the native Swift app Rork Max generates into Core Spotlight, so users reach a specific in-app screen straight from iPhone search. Covers adding, updating, and removing index entries, plus the production trap of stale search results, from an indie developer's view.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →