diff --git a/Sources/YLS-iOS/Models/YLSEvent.swift b/Sources/YLS-iOS/Models/YLSEvent.swift index 814016e..6f36f57 100644 --- a/Sources/YLS-iOS/Models/YLSEvent.swift +++ b/Sources/YLS-iOS/Models/YLSEvent.swift @@ -10,9 +10,10 @@ import Foundation struct YLSEvent { let hashedID: String let timestamp: String + let version: Int let event: [String: Any] func fetchDictionary() -> [String: Any] { - return ["hashedID": hashedID, "timestamp": timestamp, "event": event] + return ["hashedID": hashedID, "timestamp": timestamp, "version": version, "event": event] } } diff --git a/Sources/YLS-iOS/YLS_iOS.swift b/Sources/YLS-iOS/YLS_iOS.swift index 88194f1..92ea935 100644 --- a/Sources/YLS-iOS/YLS_iOS.swift +++ b/Sources/YLS-iOS/YLS_iOS.swift @@ -10,6 +10,8 @@ let logger = Logger(subsystem: "YLS", category: "Logging") public final class YLS { public static let shared = YLS() + private let version = 1 + private var url: URL? private var hashedID: String? private var caches: [YLSEvent] = [] @@ -83,7 +85,7 @@ public final class YLS { var event: [String: Any] = ["platform": "iOS", "event": name] event = event.merging(extra) { (current, new) in new } - let ylsEvent = YLSEvent(hashedID: hashedID, timestamp: timestamp, event: event) + let ylsEvent = YLSEvent(hashedID: hashedID, timestamp: timestamp, version: version, event: event) self.caches.append(ylsEvent) if self.caches.count >= 10 {