Can anyone help why the old score is showing in live activity after 8 hours?
I have added the live activity on Monday, 24 April 9:50 PM. It's working fine to update data properly via notification. But, I see old data in next morning. Old score matches on added time data.
I don't know why happening this. I have attached 3 screenshots for better understanding. So, if anyone has an idea about this please ping me.
Code For add Live activity
var contentState = LiveScoreAttributes.Status(value: "This is dynamic app!", id: liveScoreViewModelObj.allLiveScores?[self.pagecontrol.currentPage].id ?? 0, liveScore: LiveScoreModel(allLiveScores: [myData]))
do {
activityScoreAttributes = try Activity<LiveScoreAttributes>.request(attributes: attributes, contentState: contentState, pushType: .token)
}
catch (let error) {
print(error.localizedDescription)
}
Code For Update Live activity
let contentState = LiveScoreAttributes.Status(value: "This is dynamic app!", id: myId, liveScore: LiveScoreModel(allLiveScores: [myData]))
Task {
for activity in Activity<LiveScoreAttributes>.activities {
if liveScore.id == activity.content.state.id {
await activity.update(using: contentState)
}
}
}