Post

Replies

Boosts

Views

Activity

Where to retrieve Live activity update token that was started with ActivityKit push notifications using push-to-start token?
I can successfully start a Live Activity using push-to-start token, but in order to update the Live Activity i need another token as stated in the docs: While the system starts the new Live Activity and wakes up your app, you receive the push token you use for updates. When the app is open, i can retrieve this update token and successfully update the Live Activity using this example code: func observeActivityPushToken() { Task { for await activityData in Activity<LiveActivityAttributes>.activityUpdates { Task { for await tokenData in activityData.pushTokenUpdates { let token = tokenData.map { String(format: "%02x", $0) }.joined() print("Push token: \(token)") } } } } } But when the app is closed, how/where do i manage to get this update token and send it to the server "when the system wakes up the app"?
2
1
295
Sep ’24