RORK LABJP
MAX — Rork Max generates native Swift apps for iPhone, iPad, Watch, TV, Vision Pro, and iMessageNATIVE — It reaches AR/LiDAR, Metal 3D, Dynamic Island, Live Activities, HealthKit, and Core MLPUBLISH — Two-click App Store submission sharply cuts the overhead of shipping an appPRICING — Rork Max is 00/month, while the original Rork starts free with paid plans from 5/monthFUNDING — Rork raised .8M from a16z, with over 743k monthly visits and 85% growthTOOL — The original Rork builds native iOS and Android apps from plain English using React Native (Expo)MAX — Rork Max generates native Swift apps for iPhone, iPad, Watch, TV, Vision Pro, and iMessageNATIVE — It reaches AR/LiDAR, Metal 3D, Dynamic Island, Live Activities, HealthKit, and Core MLPUBLISH — Two-click App Store submission sharply cuts the overhead of shipping an appPRICING — Rork Max is 00/month, while the original Rork starts free with paid plans from 5/monthFUNDING — Rork raised .8M from a16z, with over 743k monthly visits and 85% growthTOOL — The original Rork builds native iOS and Android apps from plain English using React Native (Expo)
Articles/App Dev
App Dev/2026-07-01Advanced

Building SharePlay in Rork Max's Native Swift — Keeping Two Screens in the Same State

Implementation notes on building SharePlay with GroupActivities in Rork Max's native Swift — moving two screens through the same state over FaceTime. Covers declaring the GroupActivity, joining a GroupSession, syncing state with GroupSessionMessenger, handling latency and conflicts, catching up late joiners, and the boundary for bridging from React Native, with the pitfalls I actually hit.

SharePlayGroupActivitiesRork Max201iOS95SwiftUI58

Premium Article

There are moments when you want to look at the same screen together with family who live far away, while on a call — not trading photos one at a time, but where the moment you swipe, their screen shows the same photo too. That "seeing the same thing together" experience is harder to build than it looks, and once it works, it is quietly delightful. As an indie developer who has run a few small utility apps on my own for years — monetized mostly through AdMob on the App Store — I have come to see SharePlay as one of the rare mechanisms that turns "a tool you use alone" into "a space you use with someone."

The foundation for it is GroupActivities. It layers your app's session on top of a FaceTime call and keeps the state aligned across every participant's device. The catch is that this lives entirely in native territory — there is no API you can reach cleanly from JavaScript. That is exactly why it matters that Rork Max now generates native Swift. Here, I will build the smallest SharePlay that moves two screens through the same state, and walk through the spots where I actually got stuck.

Why this is not realistic in the React Native version

Getting this straight up front makes the later design choices easier. The core of SharePlay is the GroupActivities framework: conforming to the GroupActivity protocol, receiving a GroupSession asynchronously, and exchanging low-level messages through GroupSessionMessenger. All of these are tied deeply to Swift types and async sequences — the kind of thing that fits poorly across a bridge.

AspectReact Native (Expo) aloneRork Max native Swift
Conforming to GroupActivityCannot be expressed in JS typesDeclared plainly as a Swift struct
Receiving a GroupSessionAsync sequences are awkward to bridgeTaken directly with for await
State-sync granularityCarries bridge round-trip latencyStays inside native, stays light
System UI integrationHard to surface in the share pickerRides the OS SharePlay UI naturally

At first I assumed a thin wrapper as an Expo native module would be enough. But once I tried to bridge both receiving the GroupSession and the Messenger's send/receive, the state drifted every time it crossed the boundary — a sync that stopped being a sync. For SharePlay, I have concluded that the practical move is to place the heart of the experience on the native side and let React Native only tap "start" and "stop." Because Rork Max generates that central part in Swift, that separation actually holds together as an implementation.

Declaring the "activity" you do together

SharePlay starts by declaring, as a type, what you are doing together. That activity becomes the unit shared among participants. For a "swipe through photos together" experience, you give it the minimum information needed to identify what is being paged.

import GroupActivities
 
struct SharedGalleryActivity: GroupActivity {
    // Identifier for the gallery being viewed together
    var galleryID: String
 
    var metadata: GroupActivityMetadata {
        var meta = GroupActivityMetadata()
        meta.title = "View a gallery together"
        meta.type = .generic     // .generic unless it is video or music
        return meta
    }
}

Choose type by purpose. For synchronized video use .watchTogether, for music .listenTogether, and the system will even handle playback controls for you. But for syncing your own custom screen, .generic is far easier to work with. Set it to .watchTogether and the OS starts expecting a playback UI, which ends up fighting you. I got that wrong at first and spent a while confused about why extra controls kept appearing on screen.

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
Follow the full arc in working Swift — from declaring a GroupActivity to joining a GroupSession to tearing it down
A minimal design for keeping two devices in the same state with GroupSessionMessenger, plus how to handle latency, conflicts, and catching up people who join late
Why SharePlay is not realistic in the React Native version and needs Rork Max's native generation, explained at the implementation level
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

App Dev2026-07-01
Building a Song-Recognition App with ShazamKit in Rork Max's Native Swift
Implementation notes on building a song-recognition app with SHManagedSession in Rork Max's native Swift. Covers the difference from hand-rolling AVAudioEngine, designing the idle / prerecording / matching states, using prerecording to improve initial accuracy, and the boundary design for bridging from Expo — with the pitfalls I actually hit.
App Dev2026-06-28
Building a Live Barcode and Text Scanner in Rork Max with VisionKit's DataScanner
Add a live barcode and text scanner to your Rork Max native Swift app using VisionKit's DataScanner. Covers the SwiftUI bridge, availability handling, throttling repeated detections, and on-device verification with working code.
App Dev2026-07-01
Making the Block Screen Feel Like Your Own App — ShieldConfiguration and Button Handling in Rork Max
Replace the plain gray shield that screen-time apps show with something that speaks in your app's voice. This walks through swapping the UI with a ShieldConfiguration extension and controlling the buttons with ShieldAction, wired into a Rork Max native setup.
📚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 →