Contents

pushHandler(_:)

Register a type that can handle push tokens changing for widgets.

Declaration

@MainActor @preconcurrency func pushHandler(_ pushHandlerType: any WidgetPushHandler.Type) -> some WidgetConfiguration

Parameters

  • pushHandlerType:

    The type of the object that can handle push tokens you use to update the widget with push notifications.

Overview

Use this to opt this widget into supporting updates via push notifications.

If you have multiple widget configurations, you can choose to use the same push handler type for those widget configurations.

When the push configuration of your widgets changes, each unique handler type will be instantiated and pushTokenDidChange(_:widgets:) will be called.