◉RORK LABJP
●SUBDOMAIN — Rork can now connect your web app to a subdomain only, leaving your root domain and www untouched (12/1)●UPDATES — expo-updates 58.0.23 fixes Android release builds embedding a stale runtime version●FLASH END — Intro pricing for Gemini Flash models ends 12/31, 29 days from now. Time to recheck AI feature costs●HMR — Some report the dev server picking up another server's bundle and then exiting●FIRST VIEW — Map the first screen for a normal launch, a notification, and a link, and back navigation stops surprising you●CARBON — Gemini 4 Carbon and Argon are now at standard rates: $4.00 input, $20.00 output per 1M tokens●SUBDOMAIN — Rork can now connect your web app to a subdomain only, leaving your root domain and www untouched (12/1)●UPDATES — expo-updates 58.0.23 fixes Android release builds embedding a stale runtime version●FLASH END — Intro pricing for Gemini Flash models ends 12/31, 29 days from now. Time to recheck AI feature costs●HMR — Some report the dev server picking up another server's bundle and then exiting●FIRST VIEW — Map the first screen for a normal launch, a notification, and a link, and back navigation stops surprising you●CARBON — Gemini 4 Carbon and Argon are now at standard rates: $4.00 input, $20.00 output per 1M tokens
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.

Rork622StoreKit 217Subscription23Background Refresh3Restore PurchaseiOS118Expo240

✦ 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
BGTaskScheduler Code=1 means unavailable, and Apple lists three causes: Background App Refresh turned off, running on Simulator, or submitting from an extension. Missing Info.plist entries show up as Code=3. A code-by-code triage table, the Expo identifier, a log-tally script, and a getPendingTaskRequests check.
⬡ Dev Tools2026-10-30
It runs in development but the iOS Release build dies on launch — checking whether a missing scheme is the cause
In an expo-router app, an app.json with no scheme can crash only the iOS Release build at launch. A triage table for Release-only crashes, how to read the reason from the log, why Debug and Android survive, the two fixes and why one needs a native rebuild, and a pre-submission 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.