Just shipped iOS Home Screen & Lock Screen widgets in React Native. 🚀
Most people say it can't be done cleanly. Here's proof it can 👆
The widget updates live golf scores directly on your Home Screen — no app open, no refresh needed.
Here's what made this tricky:
Widgets are completely sandboxed. No JS bridge. No fetch(). No React state. The only way to pass data from React Native to the widget is through App Groups + UserDefaults — and if your provisioning profile doesn't match exactly, the widget shows blank. No error. No warning. Just silence.
What you're seeing in the code:
→ PlayerScore model shared between app and widget extension
→ TimelineProvider controlling exactly when the widget refreshes
→ loadGameData() reading live data from UserDefaults with the App Group suite name
→ Full SwiftUI rendering — inside a React Native project
3 things that will burn you if you try this:
App Group ID must be identical in both targets — one character off = silent failure
.never refresh policy means YOU control updates, not WidgetKit
Always test on a real device — simulator caches stale widget data constantly