◉RORK LABJP
●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SONNET 4.5 — Retires on the Claude API on 11/30, 27 days left. If your app calls it, check the migration target●SDK 58 — Moves to React Native 0.88. R8 is now on by default in Android release builds, and iOS prebuild generates a SceneDelegate●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SONNET 4.5 — Retires on the Claude API on 11/30, 27 days left. If your app calls it, check the migration target●SDK 58 — Moves to React Native 0.88. R8 is now on by default in Android release builds, and iOS prebuild generates a SceneDelegate●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…
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 Max235Notification 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-05-01
Adding a Notification Service Extension to a Rork App — Rich Push, Encrypted Payloads, and Dynamic Rewriting
Wiring a Notification Service Extension into a Rork-built iOS app — image attachments, end-to-end encrypted payloads, and dynamic APNs payload rewriting — with working Swift code and the production pitfalls that bit me along the way.
⬡ Dev Tools2026-04-05
Rork Max × WidgetKit & Live Activities in Practice — From Home Screen to Dynamic Island
A complete guide to implementing iOS Widgets, Lock Screen widgets, and Dynamic Island Live Activities with Rork Max. Covers WidgetKit fundamentals, Timeline update strategies, App Intents integration, and monetization.
⬡ Dev Tools2026-07-18
The Generated Screen That Quietly Jams at AX5 and in German — Putting Layout Resilience Checks on Rork Max SwiftUI
A record of running every Rork Max generated SwiftUI screen through pseudolocalization and the largest text size to find exactly where it jams. Covers when to reach for ViewThatFits, ScaledMetric and layoutPriority, plus the snapshot checks that catch regressions every time you regenerate.