You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/android/development/server-driven-widgets.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,13 +60,13 @@ On the Android emulator, use `10.0.2.2` instead of `localhost` to reach the host
60
60
61
61
## Building the server
62
62
63
-
Voltra provides widget server handlers for the common runtime styles. Use `createWidgetUpdateHandler()` for Fetch-compatible runtimes, `createWidgetUpdateNodeHandler()` for `node:http`, and `createWidgetUpdateExpressHandler()` for Express-style handlers. All three share the same request parsing, platform validation, token validation, and response serialization.
63
+
Voltra provides widget server handlers for the common runtime styles. Use `createAndroidWidgetUpdateHandler()` for Fetch-compatible runtimes, `createAndroidWidgetUpdateNodeHandler()` for `node:http`, and `createAndroidWidgetUpdateExpressHandler()` for Express-style handlers. All three share the same request parsing, platform validation, token validation, and response serialization.
// Reload specific widgets (triggers an immediate WorkManager fetch)
192
-
awaitreloadWidgets(['dynamic_weather'])
192
+
awaitreloadAndroidWidgets(['dynamic_weather'])
193
193
194
194
// Reload all widgets
195
-
awaitreloadWidgets()
195
+
awaitreloadAndroidWidgets()
196
196
```
197
197
198
198
For server-driven widgets, this enqueues an immediate one-time WorkManager request to fetch fresh content. For local-only widgets, it re-renders from cached data.
@@ -224,9 +224,13 @@ Provide a meaningful initial state (e.g. "Loading..." or placeholder content) ra
224
224
225
225
## Cross-platform server
226
226
227
-
A single server can handle both iOS and Android requests using `createWidgetUpdateHandler`:
227
+
A single server can handle both iOS and Android requests using `createWidgetUpdateHandler` from `@use-voltra/server`:
The handler uses the required `platform` query parameter to route requests to the correct render function.
247
251
248
-
If you're serving the endpoint from Node or Express, use `createWidgetUpdateNodeHandler()` or `createWidgetUpdateExpressHandler()` instead.
252
+
If you're serving the cross-platform endpoint from Node or Express, use `createWidgetUpdateNodeHandler()` or `createWidgetUpdateExpressHandler()` from `@use-voltra/server` instead.
0 commit comments