RORK LABJP
CLOUD — Rork Max compiles native Swift on a fleet of cloud Macs, so you never download Xcode or need to own a MacPLATFORM — Rork Max targets iPhone, iPad, Apple Watch, and Vision Pro, and reaches games, widgets, and Live ActivitiesSHIP — Build in the browser, preview through a streaming simulator, install on device via QR code, and submit to the App Store without leaving RorkSPLIT — Regular Rork generates cross-platform apps with React Native and Expo. Reach for it to ship broadly and fast, and for Max when you need Apple-specific depthCREDIT — The free tier works out to roughly five prompts a week. It helps to budget the cost of trying something separately from the cost of finishing itPRICE — Rork Max sits on the $200/month Max plan, while regular Rork starts free with paid plans from $25/monthCLOUD — Rork Max compiles native Swift on a fleet of cloud Macs, so you never download Xcode or need to own a MacPLATFORM — Rork Max targets iPhone, iPad, Apple Watch, and Vision Pro, and reaches games, widgets, and Live ActivitiesSHIP — Build in the browser, preview through a streaming simulator, install on device via QR code, and submit to the App Store without leaving RorkSPLIT — Regular Rork generates cross-platform apps with React Native and Expo. Reach for it to ship broadly and fast, and for Max when you need Apple-specific depthCREDIT — The free tier works out to roughly five prompts a week. It helps to budget the cost of trying something separately from the cost of finishing itPRICE — Rork Max sits on the $200/month Max plan, while regular Rork starts free with paid plans from $25/month
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 Max231Notification Content ExtensionPush Notifications9UserNotificationsSwift48App 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-07-18
Your AR Furniture Is Gone by Morning — Persisting Placements with ARWorldMap
AR apps generated by Rork Max lose every placed object on relaunch. Here is the design that fixes it: when to save an ARWorldMap, how to encode custom anchors, how to handle the relocalization wait, and what to do when relocalization simply never lands.
Dev Tools2026-07-17
Killing the Export Compliance Prompt in Rork Builds for Good
Every Rork and Rork Max build lands in App Store Connect with a Missing Compliance warning. Here is how to decide whether you qualify for the exemption, and how to set it once in app.json or Info.plist so the question never returns.
Dev Tools2026-07-16
Regenerable Zones in Rork Max Code: Keeping the Freedom to Rebuild
Generated code carries an invisible asset: the option to throw it away and rebuild it. Every hand edit quietly expires that option. Here is how I track it with a ledger and CI checks across six live apps.
📚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 →