Widget Data Interaction

The ArkTS widget framework provides the updateForm() and requestForm() APIs to proactively trigger widget updates.

WidgetLocalStorageProp

API System Capability Constraints
updateForm No 1. Invoked by the provider.
2. Allows only the widget provider to update its own widgets. It cannot be used to update widgets by other providers.
requestForm Yes 1. Invoked by the host.
2. Allows only the widget host to update the widgets added to it. It cannot be used to update widgets added to other hosts.

The following describes the typical use cases of widget updates: