Skip to content

Commit 028fde0

Browse files
nan-licursoragent
andcommitted
fix: [SDK-4814] attribute Live Activity receive receipt to the delivered content
Read the notificationId from the content yielded by this contentUpdates iteration instead of activity.content (the latest snapshot), which can advance while the loop is suspended and mis-attribute the receipt to a different update. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 28f7907 commit 028fde0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

iOS_SDK/OneSignalSDK/OneSignalLiveActivities/Source/OneSignalLiveActivitiesManagerImpl.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ public class OneSignalLiveActivitiesManagerImpl: NSObject, OSLiveActivities {
334334
Task {
335335
for await content in activity.contentUpdates {
336336
// Don't track a live activity started / updated "in app" without a notification
337-
if let notificationId = activity.content.state.onesignal?.notificationId {
337+
if let notificationId = content.state.onesignal?.notificationId {
338338
OneSignalLiveActivitiesManagerImpl.addReceiveReceipts(notificationId: notificationId, activityType: "\(activityType)", activityId: activity.attributes.onesignal.activityId)
339339
}
340340
}

0 commit comments

Comments
 (0)