ClaudeExpoDec 10, 2025, 4:30 PM

How to implement iOS widgets in Expo apps

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

claudeenmodel: claude-sonnet-4-20250514

Building iOS Widgets in Expo Apps with Swift and React Native Integration

Key Points

  • Native iOS widgets implementation in Expo apps using Swift
  • Widget-first design approach for ambient user experiences
  • Expo Config Plugin for managing native Apple targets

Summary

This guide demonstrates how to implement native iOS widgets in Expo applications using Swift while maintaining Expo's development workflow. The approach is showcased through Glow, a widget-first affirmations app that prioritizes ambient presence on iOS home and lock screens.

Key Points

  • Widget-first approach: Widgets serve as the primary user interface rather than supplementary features, reducing friction and increasing engagement
  • Technical solution: Uses @bacons/apple-targets Expo Config Plugin to generate native Apple targets while avoiding manual Xcode project management
  • Native requirements: iOS widgets require Swift code implementation since they cannot run React Native or JavaScript
  • Data sharing: Enables communication between Swift widgets and React Native components within the same app
  • Expo workflow preservation: Maintains fast iteration cycles, EAS Build integration, and streamlined development process
  • Ambient user experience: Delivers content through lock screen and home screen widgets for zero-friction access

Full Translation

Translations

A translation section that keeps the flow of the original article.

claudejamodel: claude-sonnet-4-20250514

ExpoアプリでiOSウィジェットを実装する方法

ExpoアプリでiOSウィジェットを実装する方法

Users • React Native • Development • December 10, 2025 • 7分で読める

Arthur Spalanzani ゲスト著者

GlowがExpoとSwiftウィジェットを使用して、React Nativeとデータを共有し、iOSのホーム画面に表示されるウィジェット中心のアファメーションアプリを構築する方法を学びましょう。

この記事は、モバイル開発に情熱を注ぐインディーアプリ開発者兼工学系学生のArthur Spalanzaniによるゲスト投稿です。


昨年の冬、私はフランスからノルウェーに移住しました。12月の20時間の暗闇は、予想していたものとは全く違いました。見つけられる限りのウェルネスアプリをダウンロードしましたが、どれも努力が必要でした:ジャーナリングのプロンプト、気分の追跡、瞑想セッション。私にはもっとシンプルなものが必要でした。

そこでGlowを構築しました。これは、ウィジェットがアプリそのものであるアファメーションアプリです。コンパニオン機能でも、プレビューでもありません。実際の製品がロック画面とホーム画面に存在するのです。

私は2019年からExpoでアプリを構築してきました。一度学んだら、振り返ることはありませんでした。しかし、このプロジェクトは私を新しい領域に押し進めました:ネイティブSwiftウィジェットです。

コア体験としてのウィジェット

ほとんどのウェルネスアプリが失敗する理由は、アプリを開くことを覚えておく必要があるからです。Glowはこれを逆転させます:アファメーションがあなたのところにやってくるのです。

ロック画面で時間を確認するとき、そこにあなたのアファメーションがあります。ホーム画面間をスワイプするとき、そこに再び現れます。摩擦ゼロ、アンビエントな存在感。

ロック画面ウィジェットは、無意識にスマートフォンをチェックする瞬間にあなたを捉えます。ホーム画面ウィジェットは、一日を通して意図的なタッチポイントを提供します。開くアプリはなく、必要なときに言葉があるだけです。

技術的な課題:ウィジェットをネイティブに感じさせる

私は何年もExpoでコーディングしてきましたが、ウィジェットは新しい領域でした。ウィジェットにはネイティブSwiftコードが必要です(React NativeやJavaScriptを実行できません)。それでも、Expoワークフローのすべての利点を維持したかったのです:高速な反復、EAS Build、手動でのXcodeプロジェクト管理の不要。

@bacons/apple-targetsの登場です。これは、ウィジェットなどのネイティブAppleターゲットを生成しながら、/iosディレクトリの外で管理可能に保つ実験的なExpo Config Pluginです。

How to implement iOS widgets in Expo apps | Expo | DocsDigest