◉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)●SDK 58 — Beta since 09/15 with no stable date yet; running projects in Expo Go has required login since 09/03●WIDGET — A write-up traces an iOS widget that renders black only in production builds●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)●SDK 58 — Beta since 09/15 with no stable date yet; running projects in Expo Go has required login since 09/03●WIDGET — A write-up traces an iOS widget that renders black only in production builds●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-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.

Rork585StoreKit 217Subscription23Background Refresh3Restore PurchaseiOS116Expo219

✦ 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
When BGTaskScheduler.submit returns Error Code=1, the cause space is finite — six of them. Covers telling Code=1 from Code=3, the identifier trap in Expo-based Rork apps, submitting from a widget extension by mistake, and a getPendingTaskRequests self-check.
⬡ Dev Tools2026-09-21
A build that stops with exit code 0 — the flag that silenced the log, and the check that let an empty file through
Two reports landed in the same week: eas build --local stopping with exit code 0 but produced no further output, and a zero-byte stub that never got embedded. Both came down to settings that reduce output. Here is how to audit your own scripts.
⬡ Dev Tools2026-09-05
Your Widget Extension Can Submit a BGTaskScheduler Request. It Just Cannot Register the Handler
Calling BGTaskScheduler from a widget extension compiles, submits, and returns true — and then nothing runs. Here is why registration belongs to the host app only, and how I moved refresh ownership back where it belongs across my wallpaper apps.