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
Call configureLiveActivity inside your AppDelegate in the didFinishLaunchingWithOptions method. The SDK manages the observers for any activities that are still running.
Pushwoosh.LiveActivities.configureLiveActivity(YourAttributes.self)
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.