◉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-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.

Rork622WidgetKit11App Group4iOS118Widget ExtensionReact Native244Expo 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. Having stepped on this more than once, 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
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.