Skip to content

feat: support runtime props in Dynamic Widgets#229

Open
V3RON wants to merge 12 commits into
mainfrom
agent/android-dynamic-widget-props
Open

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

Conversation

@V3RON

@V3RON V3RON commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What is this?

This PR adds runtime-props update support for entry-based Dynamic Widgets on Android and iOS. It closes the gap where the Dynamic Widget adapter accepted props but the native render runtimes always supplied {}. The existing legacy widget APIs and data formats remain unchanged.

How does it work?

  • Android exposes updateAndroidDynamicWidget with typed, JSON-serializable props, stores the latest props per Dynamic Widget ID in private SharedPreferences, passes them into the Hermes render path, and refreshes only matching generated Glance receiver instances.
  • iOS exposes updateDynamicWidget with typed, JSON-serializable props, stores the latest props per Dynamic Widget ID in App Group UserDefaults, passes them into the JavaScriptCore/WidgetKit render path, and reloads only the matching WidgetKit kind.
  • Both platforms default to {} when no props are stored. The existing Metro adapters already forward props, so no production CLI generator change is required.
  • The examples, documentation, and platform-specific JVM, Swift, and JavaScript regression tests cover the new behavior.

Why is this useful?

Applications can update Dynamic Widgets with current runtime data such as headline and unreadCount, without constructing pre-rendered payload variants. Platform-specific persistence and targeted refreshes keep updates scoped to the intended widget while preserving existing integrations.

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
V3RON added 2 commits July 16, 2026 15:55
Advance per-instance Glance Preferences state before dispatching updates so active sessions observe persisted prop changes. Keep SharedPreferences authoritative and cover sequential, coalesced, concurrent, and failure paths.
@V3RON
V3RON marked this pull request as ready for review July 17, 2026 18:55
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