Skip to content

Commit b5abb66

Browse files
authored
Fix IOSLiveActivitiesUpdated not firing after start() on iOS 17.2+ (#132)
On iOS 17.2+, start() skipped checkForActivities() assuming pushToStartTokenUpdates would trigger watcher setup. That stream fires at launch/token refresh but not on direct app-initiated starts, so no state changes were ever observed for the new activity. Fix: set up the watcher and emit the initial event inline after start() on iOS 17.2+, mirroring what checkForActivities() would have done. Guarded by activityState nil check so it's a no-op if a concurrent pushToStartTokenUpdates already handled it.
1 parent 1c7ac8c commit b5abb66

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

ios/AirshipFrameworkProxy/LiveActivity/LiveActivityManager.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ public actor LiveActivityManager: Sendable {
154154
let result = try await findEntry(attributesType: request.attributesType).start(request)
155155
if #unavailable(iOS 17.2) {
156156
await self.checkForActivities()
157+
} else if activityState[result.id] == nil {
158+
// On iOS 17.2+, checkForActivities() is not called on start (pushToStartTokenUpdates
159+
// handles discovery at launch), so set up watching for the new activity directly.
160+
await startWatchingActivityUpdates(result.id, attributesType: request.attributesType)
161+
await updated(activityID: result.id, info: result, notifyOnChange: false)
162+
await notify()
157163
}
158164
return result
159165
}

0 commit comments

Comments
 (0)