Menu

Widgets, Controls and Live Activities from an Expo app
📰

Widgets, Controls and Live Activities from an Expo app

DEV Community: reactnative·Odd Eggs Studio·5 days ago
#2lSpBhwH
#devtoreactnative#devto#dev#available#swift
Reading 0:00
15s threshold

6pm is an Expo app with three native extensions: a widget extension (Home and Lock Screen widgets, two Control Center controls, one Live Activity), an App Intents extension ("Log in 6pm" for Siri and Apple Pay automations) and a share extension. The extensions never open the database, and Swift never decides a number: TypeScript writes JSON, Swift lays it out.

Code below is from the 6pm repo . The stack: Expo 58, React Native 0.88 on the New Architecture, and @bacons/apple-targets 5.0.0 for the native targets.

The shape

Everything native beyond the app itself lives in apps/mobile/targets :

targets/ widgets/ WidgetKit: SafeTodayWidget, TodayListWidget, SurfaceActivityWidget, two controls intents/ App Intents extension: LogSpendIntent, open-screen intents share/ Share extension: reads a bank receipt with Vision _shared/ GroupFiles.swift, DomainBridge.swift, ThemeTokens.swift, strings, domain-native.js

Enter fullscreen mode

Exit fullscreen mode

Each target is declared in a few lines of JavaScript.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.