I have a state in my app that is connected to a Live Activity. When the state is true, the Live Activity is active, and when it is false, the Live Activity is ended.
I have noticed, though, that if a user starts the Live Activity (by changing the state to true), then force quits the app, then reopens the app and changes the state to false, the Live Activity is not ended / removed from the lock screen.
Is there any way to fix this? Since there is no problem ending the Live Activity if the user doesn't force quit the app, it seems as though the Live Activity may be somehow connected to the specific instance of the app. Is there a way to not have the Live Activity connected to the only active instance of the app, but be able to have it ended by any future instance of the app?
Can you help clarify a few things?
I have a state in my app that is connected to a Live Activity.
How is this state connected to the Live Activity?
...that if a user starts the Live Activity (by changing the state to true)...
How is the activity started when the user changes this state to true?
But to answer the question of Live Activities being tied to an instance of an app. Force quitting the app doesn't end the Live Activities. When the user relaunches the app, the app should be able to get all ongoing Live Activities via the Activity.activities
variable: https://developer.apple.com/documentation/activitykit/activity/activities