◉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-10Advanced

Why Your Rork iOS Widget Keeps Showing Stale Data — Rebuilding the App Group + WidgetKit Pipeline That Actually Refreshes

Your Rork-built iOS widget shows yesterday's data. Rebuild the App Group, shared UserDefaults, and timeline reload pipeline so parent and widget share state.

Rork584WidgetKit11App Group4iOS116Widget ExtensionReact Native239Expo Modules

✦ Premium Article

A few hours after I published the monthly update for one of my wallpaper apps, the home-screen widget kept showing last month's "daily wallpaper". Open the app, and the latest image was right there. Glance at the widget, and it was a full day behind. The first user message that night went something like, "is the widget broken?" and I was up far later than I planned, because telling a paying user "please reinstall" is the worst answer a small developer can give.

WidgetKit's documentation gives you a single sentence on this: "use an App Group to share data with the parent app." But once you actually graft a Widget Extension onto a Rork-generated React Native project, that one line hides three traps. The App Group is silently misconfigured, UserDefaults reads and writes don't agree on which keychain they're hitting, and the timeline reload runs at the wrong moment. This walkthrough fixes all three so that the parent app and the widget behave like one system in production, instead of two strangers passing each other on the home screen.

What "the widget is stuck on yesterday" actually means

Every iOS app, including a Widget Extension grafted onto a Rork project, runs in its own sandbox. Your widget looks like part of the parent app on the home screen, but it ships as a separate process with a separate bundle ID. iOS treats it as a separate citizen with its own data jar.

Which means: anything written to UserDefaults.standard in the parent app reads back as nil from inside the widget. That isn't a bug in your code, it's a contract between you and iOS. To cross the sandbox boundary, you have to ask Apple for an App Group, which gives both targets a shared keyed store and a shared file container. The first time I built a widget for an app, I didn't go through the App Group setup and spent half a day staring at a nil return value before realizing the storage I was writing to wasn't visible from the other side of the boundary.

There's a deeper consequence too. WidgetKit caches the last rendered timeline. If the parent app updates a value but never tells WidgetKit "the underlying data has changed", the widget will keep using its cached timeline until the cached entry's policy expires. So even when the App Group is wired up correctly, if you don't pair writes with explicit reload calls, the widget appears broken to the user — even though the data is fine in the shared container.

Issuing the App Group — don't reuse your bundle ID

The App Group is a separate identifier from the parent app's bundle ID, prefixed with group.. The convention is group.{reverse-domain}.{appname}.shared. The first mistake I see people make is reusing com.example.myapp directly as their App Group string. App Groups are a different namespace entirely — they need to be registered separately.

The setup goes:

  1. Open the Apple Developer Portal → Identifiers → App Groups, and register a new one (e.g. group.com.example.myapp.shared).
  2. On both the parent app's and the Widget Extension's identifiers, attach this App Group under Capabilities.
  3. In Xcode → Signing & Capabilities for both targets, add the "App Groups" capability and tick the ID you just registered.
  4. Confirm both targets' *.entitlements files now contain:
<key>com.apple.security.application-groups</key>
<array>
  <string>group.com.example.myapp.shared</string>
</array>

If the entitlement is missing on one of the two targets, you don't get a clean compile-time error. You get the worst possible runtime: writes appear to succeed (because you wrote into a different, target-local UserDefaults), reads return nil (because the other side is looking at the actual shared container, which is empty), and you waste hours wondering why your code doesn't work. After running an indie app business since 2014, I now check both entitlements files first whenever I add a new extension, before I even open Xcode's signing UI.

A small ritual I picked up: keep the App Group ID in a single Swift constant, named so it shows up in code search. That way when something is broken, you grep the codebase and immediately see all the call sites that depend on that ID, instead of hunting through Info.plist, entitlements files, and SwiftUI views one at a time.

✦

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
✦Fold App Group, shared UserDefaults, and timeline reloads into one design that stops the widget from getting stuck on stale data
✦Implementation code for working with the system refresh budget, instant updates via App Intent, and deep-linking from widgetURL into Expo Router
✦The distribution-profile trap that passes TestFlight but breaks the App Store build, plus the exact pre-submission check
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-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.
⬡ Dev Tools2026-07-27
When to Raise Your Minimum iOS Version — Count Leftover Branches, Not User Percentages
Judging a minimum OS bump by usage share produces the same answer every year, so the decision never happens. Here is the annotation convention, the sweep script that counts how many iOS and Android branches each candidate floor would retire, and what to watch for 30 days after.
⬡ 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.