Live Activity updates often fail after an app closes because the push token changes. iOS can update the push token for an active Live Activity at any time. If your app only listens for these token updates when the activity starts, the listener stops working as soon as the app process ends. Since the backend never receives the new token, push notifications for the activity fail until the user opens the app again.
You can fix this by reconnecting the token observer every time the app starts for all active sessions.
Use the Pushwoosh SDK
Register every Live Activity attributes type once per launch, inside your AppDelegate in didFinishLaunchingWithOptions (or App.init for SwiftUI apps). The SDK then re-attaches to any activities that are still running and re-uploads their per-activity push token.
Pushwoosh.LiveActivities.setup(YourAttributes.self)
Call it for every attributes type your app uses. The call is idempotent, so registering at launch and again later is safe. If you use the SDK-managed default attributes instead of your own type, call Pushwoosh.LiveActivities.defaultSetup().
Legacy note: integrations built on the pre-modular SDK (before 6.8.0) called Pushwoosh.sharedInstance().setup(YourAttributes.self) directly. That entry point is deprecated but still works; new code should use Pushwoosh.LiveActivities.setup(_:).
Manual implementation
If you prefer to handle this yourself, iterate through Activity.activities in your AppDelegate on startup. Run your token listener function for every activity found in that list to ensure the backend has the current token.
Comments
0 comments
Please sign in to leave a comment.