Live activity not showing up

496 views Asked by At

I'm having a problem where live activities are not showing up on either simulator or device. I've set the project and target to iOS 16.2, here is my code on how I call the activity:

    let a = SessionAttributes()
    let initial = SessionAttributes.ContentState(time: "king", exercise: "bja")
    let activityContent = ActivityContent(state: initial, staleDate: nil) 
    do {
        let activity = try Activity<SessionAttributes>.request(attributes: a, content: activityContent, pushType: nil)
        print(activity.id)

    } catch {
        print("error showing live activity")
    }

When calling this the activity id is printed to console without problem, but the live activity doesn't show up. I've double checked so that live activities is indeed enabled for the app in the settings. I've tried to clear derived data.

1

There are 1 answers

0
mahim85 On

I encountered a similar issue and dedicated over 8 hours to debugging. The solution that worked for me involved resizing and compressing the logo used in rendering the view. Initially, the resolution was set at 1024x1024, but reducing it to 50x50 and ensuring the file size was below 4kb resolved the issue. I hope this information proves helpful! Documentation

a screenshot from the documentation