diff --git a/Sources/AppcuesKit/Push/ParsedNotification.swift b/Sources/AppcuesKit/Push/ParsedNotification.swift index 369fc5f9b..5e3ea1b14 100644 --- a/Sources/AppcuesKit/Push/ParsedNotification.swift +++ b/Sources/AppcuesKit/Push/ParsedNotification.swift @@ -13,7 +13,9 @@ internal struct ParsedNotification { let applicationID: String let userID: String let notificationID: String + let notificationVersion: Int? let workflowID: String? + let workflowVersion: Int? let workflowTaskID: String? let deepLinkURL: URL? let experienceID: String? @@ -34,7 +36,9 @@ internal struct ParsedNotification { self.userID = userID self.notificationID = notificationID + self.notificationVersion = userInfo["appcues_notification_version"] as? Int self.workflowID = userInfo["appcues_workflow_id"] as? String + self.workflowVersion = userInfo["appcues_workflow_version"] as? Int self.workflowTaskID = userInfo["appcues_workflow_task_id"] as? String self.deepLinkURL = (userInfo["appcues_deep_link_url"] as? String) .flatMap { URL(string: $0) } diff --git a/Sources/AppcuesKit/Push/PushMonitor.swift b/Sources/AppcuesKit/Push/PushMonitor.swift index 80b59eb69..c2690c8e4 100644 --- a/Sources/AppcuesKit/Push/PushMonitor.swift +++ b/Sources/AppcuesKit/Push/PushMonitor.swift @@ -163,14 +163,17 @@ internal class PushMonitor: PushMonitoring { completionHandler: @escaping () -> Void ) { if !parsedNotification.isTest { + let properties: [String: Any?] = [ + "notification_id": parsedNotification.notificationID, + "notification_version": parsedNotification.notificationVersion, + "workflow_id": parsedNotification.workflowID, + "workflow_version": parsedNotification.workflowVersion, + "workflow_task_id": parsedNotification.workflowTaskID, + "device_id": storage.deviceID + ] analyticsPublisher.publish(TrackingUpdate( type: .event(name: Events.Push.pushOpened.rawValue, interactive: false), - properties: [ - "notification_id": parsedNotification.notificationID, - "workflow_id": parsedNotification.workflowID, - "workflow_task_id": parsedNotification.workflowTaskID, - "device_id": storage.deviceID - ].compactMapValues { $0 }, + properties: properties.compactMapValues { $0 }, isInternal: true )) }