how widget update data?

Asked on 03/03/2025

1 search

Widgets update their data through a combination of system events and app intents. When the system needs to reload a widget, it runs the widget extension process to fetch the current state and content of the widget. This can happen due to several events:

  1. User Interaction: When a user interacts with a widget, the system automatically reloads it to reflect any changes.
  2. App Requests: An app can request the system to reload a widget on demand if the state or content needs to be refreshed.
  3. Push Notifications: A push notification can invalidate a widget, prompting the system to reload it.

Widgets can also use value providers to fetch data asynchronously, especially when the data is stored on a server and needs to be accessed across multiple devices. This allows the widget to reflect changes made from different devices.

For more detailed information, you can refer to the session Extend your app’s controls across the system (07:10).