Skip to content

feat: support runtime props in Dynamic Widgets#229

Draft
V3RON wants to merge 9 commits into
mainfrom
agent/android-dynamic-widget-props
Draft

feat: support runtime props in Dynamic Widgets#229
V3RON wants to merge 9 commits into
mainfrom
agent/android-dynamic-widget-props

Conversation

@V3RON

@V3RON V3RON commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add runtime props APIs for Dynamic Widgets on Android and iOS, with explicit JSON-safe props types
  • persist the latest props per Dynamic Widget in Android private SharedPreferences and iOS App Group UserDefaults, defaulting to {}
  • pass persisted props into the on-device Hermes/JavaScriptCore render paths
  • refresh only the matching generated Android receiver instances or WidgetKit kind
  • add JVM, Swift, and JavaScript tests that do not require a full React Native app or emulator
  • add separate Android and iOS example screens that submit headline and unreadCount, plus platform entries that consume and display them
  • verify the existing Metro adapters already parse and forward props; no production CLI generator change is required
  • update documentation and add minor changesets for both clients

Why

Discussion #221 exposed two widget models being mixed together. The legacy update APIs send pre-rendered widget payload variants, while adding entry opts a widget into the Dynamic Widget system. Although the Dynamic Widget adapter accepted props, the native render runtimes always supplied {}, and neither platform exposed the persistence/update path needed to provide real runtime props.

The new APIs are separate from the legacy widget APIs, preserving existing behavior and data formats. The existing CLI/Metro generation path already forwards props correctly, so this change completes the missing native runtime path and locks it down with regression tests.

Verification

  • iOS client: 49 JavaScript tests and 43 Swift tests; React Native codegen selector checked; Pods simulator build succeeded; typecheck, lint, library build, and SwiftFormat passed
  • Android client: 23 JavaScript tests and the full Kotlin unit suite passed; typecheck, lint, library build, and ktlint passed
  • Metro: 13 tests, typecheck, lint, and build passed
  • focused strict TypeScript check for the changed example files passed
  • git diff --check and the repository pre-push hooks passed

Local environment notes

  • the full example-app TypeScript check still reports unrelated existing baseline errors; none point to the changed files
  • the website build is currently blocked before reaching these docs by a missing pnpm package file: binary-extensions/binary-extensions.json
  • no manual device run was performed

Closes #221

@V3RON V3RON changed the title feat(android): support runtime props in Dynamic Widgets feat: support runtime props in Dynamic Widgets Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant