Set up the targets
The widget extension registers the token on its own, so it needs to know the API key and the subscriber. It reads both from the app group the app configured BuzzKit with.- Add an app group to both the app and the widget extension in Xcode’s Signing & Capabilities, and pass it as
appGroupwhen you configure BuzzKit in the app. - Add the Push Notifications capability to the widget extension target, so it carries the
aps-environmententitlement.
Keep the token registered
Give your widget configuration a push handler that forwards WidgetKit’s token to BuzzKit.BuzzKit.widgets(appGroup:) works inside the extension, where configure never runs. pushTokenDidChange(_:widgets:) registers the token against the current subscriber while any of your widgets is installed, and unregisters it when the last one is removed.
WidgetKit issues one push token per device for all of your app’s widgets, so BuzzKit keeps one registration per device, not one per widget. A reload reaches every widget of the app on that device.
Re-register from the app
The extension registers the token against the subscriber the app last stored in the app group: the identified user, or the anonymous id before identify. WidgetKit only calls the handler when the token or the installed widgets change, so afteridentify have the app re-register the current token. It moves to the identified subscriber.
BuzzKit.widgets is the app’s instance. synchronize() registers WidgetCenter.shared.currentPushInfo, and does nothing when there is none. The low-level surface stays available when you want to do the plumbing yourself: register(token:) and unregister(), both async throws, on either instance. The token’s APNs environment is detected from the build.
Reload from your backend
POST /v1/widgets/reload takes one subscriber or up to 100, and pushes to every widget token registered for them. It needs the messages:send scope.
The call is synchronous and creates no message. The response carries one result per registered widget token with the APNs outcome.
no_credential means the token’s environment has no APNs credential. A token APNs rejects as invalid comes back as invalid_endpoint and its registration is removed, so the next reload skips it.
Next
Live Activities
Start, update and end a Live Activity from your backend.
Push
Permission, device tokens and environments.
Identity
Identifying the subscriber tokens are registered against.
Sending messages
Ordinary sends, targeting and content.