Post

Replies

Boosts

Views

Activity

Reply to Live Activity Persistence After App Force Quit
Thank you for the response. There is a button in the app that triggers the start of a live activity. I'm not too familiar with how it works (or should work), but this is the code that triggers the activity: activity = try! Activity<live_activity_name>.request(attributes: attributes, contentState: state, pushType: nil) Then, when the user clicks the button again, it should end the live activity: await activity?.end(using: state, dismissalPolicy: .immediate) The problem is that when the user force quits the app, then reopens the app and triggers the code above to end the live activity, it does not actually end it. The lines of code listed above are within an if-else branch, with the condition being the value of the boolean state (related to whether the live activity should be active or ended). Based on your response, does this mean that I should fetch all ongoing Live Activities using Activity.activities (instead of relying on the boolean variable within the app)?
May ’23