Post

Replies

Boosts

Views

Activity

Comment on In the context of Live Activity, when app is launched into background due to some callback, should you wrap your work with background tasks?
@DTS Engineer Q1 From the emojiranger app: for await activityState in activity.activityStateUpdates { if activityState == .dismissed { So doesn't that mean app gets a callback? Q2: Even though upon reaching stale-date UI is updated immediately, the callback from listening to activityStateUpdates and checking for if the state is .stale is ** delayed** until app is foreground. Is that expected?
1w
Comment on Get new pushToken from LiveActivity which created by push
This is only true for us if the live activity was started from the app. When the Live Activity was started from apns, then PushTokenUpdates will only emit new tokens if user hits on "Allow" from Lock Screen. Toggling OS permission off and then back on won't cause how Apple evaluates — at until now. I think is a bug. Since the docs on PushTokenUpdates say: By default, your app can start, update, and end a Live Activity if you use ActivityKit to offer /// Live Activities
Nov ’25
Comment on In the context of Live Activity, when app is launched into background due to some callback, should you wrap your work with background tasks?
Thanks Albert. I see. So dismiss won't launch. but the rest launch the app. I have read / watched those links multiple times before (including the emoji ranger app). My ultimate question is: when OS launches the app, is it necessary to use beginBackgroundTask or by virtue of being launched (by OS into background) app has some allowed time to process whatever it was that launched the app? If so, does that negate the need of using beginBackgroundTask? Asking because we often get -1005 errors
Nov ’25
Comment on What should your server do when apns returns a 410 Unregistered error for your token?
I interpreted docs saying "unless your application retrieves the same device token" as 'it's possible that a token becomes invalid and then valid again'. I guess what you're saying is: even if a given token becomes invalid and then valid, then you still have to stop using an unregistered token — unless and until the server re-issues is to you again. (2/2)
Nov ’25
Comment on What should your server do when apns returns a 410 Unregistered error for your token?
Thank you so much Argun. This was really helpful. "This reads like you are sending background notifications and expecting the app to be launched in response". That's not our case. In our logs, we saw a "410 - unregistered" for a token and then later saw the app re-issuing the same token to us again. I thought it was due to the app temporarily marking the token as unregistered. (1/2)
Nov ’25
Comment on How to properly share code between launch in background and launch in foreground?
Thanks Rico. I only used Live Activity and Core Location as 'examples' to explain my question. The heart of my question is: “if some observation triggers an app launch. Should the app launch also re-do the observation immediately so the newly launched process is again subscribed to things it needs?” If so then architecturally how should that be? The case of push-to-start token is a fairly simple case. Wondering what you should for app launches in background for CoreBluetooth / CoreLocation
Topic: App & System Services SubTopic: General Tags:
Mar ’25
Comment on Live Activity update push token
@Sumbo when app is launched, you get the token. Send it to the server. Then any time else when the token is updated, then whether app is in foreground or background, again update your server with the newer token. Once you do this, this means server 'always' has the updated the token — before it sends a live activity notification to app.
Mar ’25