RORK LABJP
TOOLING — Rork's developer repos keep moving: rork-xcode was updated on July 16, rork-device on July 15, and rork-plist on July 13OPUS46 — Claude Opus 4.6 is live in Rork, and Rork Max is built to assemble apps on top of Claude CodeSIM — A cloud iOS simulator runs in the browser, with one click to install on a device and two clicks to publish to the App StoreMAX — Rork Max emits pure Swift rather than React Native, reaching iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and even iMessageNATIVE — That opens up HealthKit, ARKit and LiDAR, NFC, Dynamic Island, Live Activities, 3D through Metal, and on-device inference with Core MLSEED — Rork raised a $15M seed led by Left Lane Capital, with Peak XV and a16z Speedrun joining the roundTOOLING — Rork's developer repos keep moving: rork-xcode was updated on July 16, rork-device on July 15, and rork-plist on July 13OPUS46 — Claude Opus 4.6 is live in Rork, and Rork Max is built to assemble apps on top of Claude CodeSIM — A cloud iOS simulator runs in the browser, with one click to install on a device and two clicks to publish to the App StoreMAX — Rork Max emits pure Swift rather than React Native, reaching iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and even iMessageNATIVE — That opens up HealthKit, ARKit and LiDAR, NFC, Dynamic Island, Live Activities, 3D through Metal, and on-device inference with Core MLSEED — Rork raised a $15M seed led by Left Lane Capital, with Peak XV and a16z Speedrun joining the round
Articles/Dev Tools
Dev Tools/2026-05-27Advanced

Three-Layer StoreKit 2 Entitlement Sync for Rork Apps: Launch, Background Refresh, and Restore

When you wire StoreKit 2 subscriptions into a Rork-generated app, Transaction.updates alone leaves gaps. Here is the three-layer sync I run across six wallpaper apps — launch-time re-evaluation, Background App Refresh, and Restore Purchase — including measured refresh rates and the AdMob revenue I recovered.

Rork515StoreKit 216Subscription23Background Refresh3Restore PurchaseiOS109Expo149

Premium Article

I am Masaki Hirokawa, an artist and indie developer running Dolice Labs. I have six wallpaper apps generated with Rork in active production, and four of them carry StoreKit 2 subscriptions. My initial assumption was that subscribing to the Transaction.updates async stream and reacting to it would be enough. After running this in production for a couple of years, I am convinced the updates stream alone is not sufficient. Several real-world situations — long-closed apps, post-airplane-mode recovery, device migration — slip through the cracks of that single stream.

This article is a working memo of how I now handle entitlement synchronization. I have been shipping iOS apps independently since 2014, with 50 million combined downloads, and the past two years have made it clear: subscription entitlement sync needs to be a three-layer system, not a one-stream system. Everything here is designed to drop into a Rork-generated Expo project with minimal disruption.

The dropped-update problem I saw in one app

The first time I knew something was off, my highest-DAU wallpaper app showed roughly 7% lower subscription retention than my forecast. Crashlytics was clean. Sentry was clean. When I opened individual accounts in the RevenueCat Customer Center, I found sessions where the subscription was active on Apple's side but the app treated the user as a non-member. Ads were showing to paying customers, and my AdMob eCPM was suspiciously high every time I checked the cohort breakdown.

After digging, the root cause was that the Transaction.updates subscription only runs while the app is in the foreground. If a user does not open the app over a weekend and the renewal posts on Sunday, the update event arrives sometime after Monday's first onAppear. In my code, that delay raced with the first paywall render. The user briefly saw the non-member UI, hit a paywall, and walked away.

There is no clean way to solve this with one stream alone. The fix needs different layers handling different failure modes.

Why three layers — the gaps Transaction.updates cannot close

In production, the gaps I observed fall into three categories.

  1. Renewals confirmed while the app is fully terminated. iOS does deliver an updates event a few seconds to tens of seconds after relaunch, but if you read currentEntitlements during that window the user looks non-member.
  2. Network instability and the first minute after airplane mode is disabled. StoreKit retries internally, but if a screen transition fires before entitlements recover, the UI ends up holding stale state.
  3. Device migration or iCloud restore. Same Apple ID, but the receipt sync has a multi-second lag on first launch. During that window, paid features appear locked even though the purchase is valid.

I now assign each gap to a different layer.

GapLayer
Renewal during full terminationLayer 1: re-evaluate currentEntitlements at launch
Network instability or long backgroundLayer 2: periodic check via Background App Refresh
Device migration or iCloud delayLayer 3: user-initiated Restore Purchase

Transaction.updates is then strictly the "react quickly while in foreground" layer. It is helpful, but it cannot be the source of truth.

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
Three gaps that Transaction.updates structurally cannot close, mapped to the layer that fixes each one
Measured Background App Refresh firing rate across six wallpaper apps in production (1.8–3.4 times per 24 hours)
Where to place the Restore Purchase button so it actually gets tapped, plus the ~12% AdMob revenue I recovered after deploying the three layers
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-28
Tracking Down BGTaskScheduler.submit Error Code=1 (Unavailable) in Rork iOS Apps
A field-tested checklist for diagnosing BGTaskScheduler.submit failing with Error Code=1 (Unavailable) in iOS apps built with Rork, walking through the six causes that account for nearly every case.
Dev Tools2026-06-29
Handling iOS Limited Photo Library Access in a Rork (Expo) App
Handle iOS limited photo library access (selected photos only) correctly in a Rork (Expo) app. Covers the three states of full / limited / denied, designing a screen that works from the selected subset, and a path to add more photos, all with working code.
Dev Tools2026-06-26
Import the User's Own Image From the Files App in a Rork App, Without the URL Going Stale
Pull images from the Files app or iCloud Drive and the URL you picked goes invalid moments later. Here is how expo-document-picker, security-scoped URLs, and a reliable copy into your sandbox actually work, with running code.
📚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 →