1# Overview of ArkTS Widget Update 2<!--Kit: Form Kit--> 3<!--Subsystem: Ability--> 4<!--Owner: @cx983299475--> 5<!--Designer: @xueyulong--> 6<!--Tester: @chenmingze--> 7<!--Adviser: @Brilliantry_Rui--> 8 9Both the widget host (for example, the home screen) and the widget provider can trigger updates to the widget page. Moreover, the widget framework notifies the widget provider of updates according to the scheduled information. Therefore, widget updates include active updates initiated by the widget provider, active updates initiated by the widget host, and interval-based or time-specific updates. In all these update modes, the widget provider is responsible for pushing the widget data to be updated. 10 11## Widget Data Interaction 12 13The ArkTS Widget Manager supports the data interaction between the widget provider (for example, applications) and widget. The widget transfers data to the widget provider through [postCardAction](../reference/apis-arkui/js-apis-postCardAction.md#postcardaction-1), and the widget provider can transfer data to the widget through [updateForm](../reference/apis-form-kit/js-apis-app-form-formProvider.md#formproviderupdateform). After the widget provider transfers data to the widget, the data can be used for page update. 14 15The widget provider and widget are independent of each other. Therefore, data can be transferred only through [LocalStorageProp](../ui/state-management/arkts-localstorage.md#localstorageprop), and the **getContext** method cannot be used. After the widget provider pushes data, the widget UI receives it via **LocalStorageProp**, and converts the received data to a string. 16 17## Page Update Modes 18 19Widgets can be updated actively or passively based on the triggering mode. 20 21### Active Update 22 23Active updates include the updates triggered by the widget provider and the widget host. For details, see [Active Update of ArkTS Widgets](arkts-ui-widget-active-refresh.md). 24 25**Figure 1** Flowchart of active update by the widget provider 26 27 28 29If there is a need to update widget data, the widget provider, as long as it is running, can proactively update the widget using the [updateForm](../reference/apis-form-kit/js-apis-app-form-formProvider.md#formproviderupdateform) API provided by formProvider. 30 31**Figure 2** Flowchart of active update by the widget host 32 33 34 35If changes in system language or color scheme are detected, the widget host, as long as it is running, can proactively request to update the widget using the **requestForm** API provided by formHost. The Widget Manager then instructs the widget provider to complete the update. 36 37### Passive Update 38 39Passive update includes interval-based update and time-specific update<!--Del-->, and conditional update<!--DelEnd-->. For details, see [Passive Update of ArkTS Widgets](arkts-ui-widget-passive-refresh.md). 40 41Interval-based update: The widget content will be automatically updated at the specified interval by calling [onUpdateForm](../reference/apis-form-kit/js-apis-app-form-formExtensionAbility.md#formextensionabilityonupdateform). 42 43Time-specific update: The widget content will be automatically updated at a designated time every day. 44 45<!--Del--> 46Conditional update: The widget is updated when a certain condition is met. Currently, it is triggered when the network status of a device changes from unavailable to available. 47<!--DelEnd--> 48 49**Figure 3** Flowchart of interval-based and time-specific updates by the widget provider 50 51 52 53Based on the scheduled update information configured by the widget provider, the widget manager determines whether to instruct the provider to update the widget, considering factors such as timing information, widget visibility status, and the number of updates. 54 55## Constraints 56 571. The widget provider is only allowed to update its own widgets. 58 592. The widget host is only allowed to update the widgets added to it. 60