1

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?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.