diff --git a/Examples b/Examples index 577dcae69..eadc74917 160000 --- a/Examples +++ b/Examples @@ -1 +1 @@ -Subproject commit 577dcae6938ce18501c38309a1fad3bde07c18d3 +Subproject commit eadc74917e7c73f8851a4e44a3b38a607b0033b3 diff --git a/Sources/Core/TrackerConstants.swift b/Sources/Core/TrackerConstants.swift index ba712e2d4..6e691e628 100644 --- a/Sources/Core/TrackerConstants.swift +++ b/Sources/Core/TrackerConstants.swift @@ -181,11 +181,11 @@ let kSPPageTitle = "page" let kSPPageRefr = "refr" // --- Structured Event -let kSPStuctCategory = "se_ca" -let kSPStuctAction = "se_ac" -let kSPStuctLabel = "se_la" -let kSPStuctProperty = "se_pr" -let kSPStuctValue = "se_va" +let kSPStructCategory = "se_ca" +let kSPStructAction = "se_ac" +let kSPStructLabel = "se_la" +let kSPStructProperty = "se_pr" +let kSPStructValue = "se_va" // --- E-commerce Transaction Event let kSPEcommId = "tr_id" diff --git a/Sources/Snowplow/Events/Structured.swift b/Sources/Snowplow/Events/Structured.swift index aac0cc24d..d22cb2d59 100644 --- a/Sources/Snowplow/Events/Structured.swift +++ b/Sources/Snowplow/Events/Structured.swift @@ -53,12 +53,12 @@ public class Structured: PrimitiveAbstract { override var payload: [String : Any] { var payload: [String : Any] = [:] - payload[kSPStuctCategory] = category - payload[kSPStuctAction] = action - if let label = label { payload[kSPStuctLabel] = label } - if let property = property { payload[kSPStuctProperty] = property } + payload[kSPStructCategory] = category + payload[kSPStructAction] = action + if let label = label { payload[kSPStructLabel] = label } + if let property = property { payload[kSPStructProperty] = property } if let value = value { - payload[kSPStuctValue] = String(format: "%.17g", value.doubleValue) + payload[kSPStructValue] = String(format: "%.17g", value.doubleValue) } return payload } diff --git a/Tests/Global Contexts/TestGlobalContexts.swift b/Tests/Global Contexts/TestGlobalContexts.swift index 1b154df3b..7fbfdb5f6 100644 --- a/Tests/Global Contexts/TestGlobalContexts.swift +++ b/Tests/Global Contexts/TestGlobalContexts.swift @@ -18,7 +18,7 @@ import XCTest class GlobalContextGenerator: NSObject, ContextGenerator { func filter(from event: InspectableEvent) -> Bool { - return "StringToMatch" == event.payload[kSPStuctCategory] as? String + return "StringToMatch" == event.payload[kSPStructCategory] as? String } func generator(from event: InspectableEvent) -> [SelfDescribingJson]? { @@ -151,7 +151,7 @@ class TestGlobalContexts: XCTestCase { ]) ], filter: { event in - return stringToMatch == event.payload[kSPStuctCategory] as? String + return stringToMatch == event.payload[kSPStructCategory] as? String }) let filterNotMatchingGC = GlobalContext(staticContexts: [ SelfDescribingJson(schema: "schemaNotMatching", andDictionary: [