I have a problem with iOS live activities. After the app was restarted, I didn't get active activities.
I create a live activity using this code:
do {
let activity = try Activity<AppActivityAttributes>.request(
attributes: attributes,
contentState: state,
pushType: .token
)
await refreshToken(for: activity)
} catch {
print(error)
}
And checking current active activities using this property:
Activity<AppActivityAttributes>.activities
It works ok when activity is created, the activities array is not empty. But when the app is killed and restarted, it's always empty, even though activity is still active, the user can see it and the backend updates it by an activity token.
Am I doing something wrong? Is there any other way to get active activities after the app is restarted?