From 487dbab060dcb3fa98f0ed9cc0c84a7e2e5ec52e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matu=CC=81s=CC=8C=20Tomlein?= Date: Tue, 8 Aug 2023 10:16:08 +0200 Subject: [PATCH 1/2] Update vendor and version of the player schema used in media tracking (close #812) --- Sources/Core/Media/MediaSchemata.swift | 3 ++- Sources/Snowplow/Media/Entities/MediaPlayerEntity.swift | 2 +- Tests/Media/TestMediaController.swift | 2 +- Tests/Media/TestMediaEventAndEntitySerialization.swift | 8 ++++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Sources/Core/Media/MediaSchemata.swift b/Sources/Core/Media/MediaSchemata.swift index b54d7e7e4..1e6338315 100644 --- a/Sources/Core/Media/MediaSchemata.swift +++ b/Sources/Core/Media/MediaSchemata.swift @@ -16,7 +16,8 @@ import Foundation class MediaSchemata { private static let schemaPrefix = "iglu:com.snowplowanalytics.snowplow.media/" private static let schemaSuffix = "/jsonschema/1-0-0" - static let playerSchema = "\(schemaPrefix)player\(schemaSuffix)" + // NOTE: The player schema has a different vendor than the other media schemas because it builds on an older version of the same schema. Versions 5.3 to 5.4.1 of the tracker used a conflicting schema URI which has since been removed from Iglu Central. + static let playerSchema = "iglu:com.snowplowanalytics.snowplow/media_player/jsonschema/2-0-0" static let sessionSchema = "\(schemaPrefix)session\(schemaSuffix)" static let adSchema = "\(schemaPrefix)ad\(schemaSuffix)" static let adBreakSchema = "\(schemaPrefix)ad_break\(schemaSuffix)" diff --git a/Sources/Snowplow/Media/Entities/MediaPlayerEntity.swift b/Sources/Snowplow/Media/Entities/MediaPlayerEntity.swift index 4f0ebaf40..1557d22b7 100644 --- a/Sources/Snowplow/Media/Entities/MediaPlayerEntity.swift +++ b/Sources/Snowplow/Media/Entities/MediaPlayerEntity.swift @@ -39,7 +39,7 @@ extension MediaType { /** Properties for the media player context entity attached to media events. - Entity schema: `iglu:com.snowplowanalytics.snowplow.media/player/jsonschema/1-0-0` + Entity schema: `iglu:com.snowplowanalytics.snowplow/media_player/jsonschema/2-0-0` */ @objc(SPMediaPlayer) public class MediaPlayerEntity: NSObject { diff --git a/Tests/Media/TestMediaController.swift b/Tests/Media/TestMediaController.swift index 3153e7ac8..211312adf 100644 --- a/Tests/Media/TestMediaController.swift +++ b/Tests/Media/TestMediaController.swift @@ -132,7 +132,7 @@ class TestMediaController: XCTestCase { XCTAssertEqual(1, trackedEvents.count) XCTAssert(firstEvent?.entities.contains { $0.schema == "test1" } ?? false) - XCTAssert(firstEvent?.entities.contains { $0.schema.contains("/player/") } ?? false) + XCTAssert(firstEvent?.entities.contains { $0.schema.contains("/media_player/") } ?? false) } func testTrackingPlaybackRateChangeEventUpdatesThePlaybackRate() { diff --git a/Tests/Media/TestMediaEventAndEntitySerialization.swift b/Tests/Media/TestMediaEventAndEntitySerialization.swift index a5ff98eaf..249cb4d44 100644 --- a/Tests/Media/TestMediaEventAndEntitySerialization.swift +++ b/Tests/Media/TestMediaEventAndEntitySerialization.swift @@ -31,7 +31,7 @@ class TestMediaEventAndEntitySerialization: XCTestCase { func testBuildsEntityWithDefaultValuesForEmptyMediaPlayer() { let entity = MediaPlayerEntity().entity - XCTAssertEqual(mediaSchema(name: "player"), entity.schema) + XCTAssertEqual(mediaPlayerSchema, entity.schema) XCTAssertEqual(0.0, entity.data["currentTime"] as? Double) XCTAssertEqual(true, entity.data["paused"] as? Bool) XCTAssertEqual(false, entity.data["ended"] as? Bool) @@ -56,7 +56,7 @@ class TestMediaEventAndEntitySerialization: XCTestCase { volume: 80 ).entity - XCTAssertEqual(mediaSchema(name: "player"), entity.schema) + XCTAssertEqual(mediaPlayerSchema, entity.schema) XCTAssertEqual(33.3, entity.data["currentTime"] as? Double) XCTAssertEqual(false, entity.data["paused"] as? Bool) XCTAssertEqual(true, entity.data["fullscreen"] as? Bool) @@ -131,4 +131,8 @@ class TestMediaEventAndEntitySerialization: XCTestCase { private func mediaSchema(name: String, version: String = "1-0-0") -> String { return "iglu:com.snowplowanalytics.snowplow.media/" + name + "/jsonschema/" + version } + + private var mediaPlayerSchema: String { + return "iglu:com.snowplowanalytics.snowplow/media_player/jsonschema/2-0-0" + } } From 5ae519a28efa07060dc529e6f9bd714b0362afab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matu=CC=81s=CC=8C=20Tomlein?= Date: Tue, 8 Aug 2023 10:21:00 +0200 Subject: [PATCH 2/2] Prepare for 5.4.2 release --- CHANGELOG | 4 ++++ Examples | 2 +- SnowplowTracker.podspec | 2 +- Sources/Core/TrackerConstants.swift | 2 +- VERSION | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e7deb358b..4c70875fb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +Version 5.4.2 (2023-08-08) +-------------------------- +Update vendor and version of the player schema used in media tracking (#812) + Version 5.4.1 (2023-07-19) -------------------------- Add thread-safety to a globalContext manager function (#809) diff --git a/Examples b/Examples index f9b62ba77..9d851e13f 160000 --- a/Examples +++ b/Examples @@ -1 +1 @@ -Subproject commit f9b62ba77dd05420991faaefef9aea79c38b3d08 +Subproject commit 9d851e13f8ca357a394c60695777c3970f8ed9bc diff --git a/SnowplowTracker.podspec b/SnowplowTracker.podspec index 1ed592d95..aa7a20154 100644 --- a/SnowplowTracker.podspec +++ b/SnowplowTracker.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SnowplowTracker" - s.version = "5.4.1" + s.version = "5.4.2" s.summary = "Snowplow event tracker for iOS, macOS, tvOS, watchOS for apps and games." s.description = <<-DESC Snowplow is a mobile and event analytics platform with a difference: rather than tell our users how they should analyze their data, we deliver their event-level data in their own data warehouse, on their own Amazon Redshift or Postgres database, so they can analyze it any way they choose. Snowplow mobile is used by data-savvy games companies and app developers to better understand their users and how they engage with their games and applications. Snowplow is open source using the business-friendly Apache License, Version 2.0 and scales horizontally to many billions of events. diff --git a/Sources/Core/TrackerConstants.swift b/Sources/Core/TrackerConstants.swift index fbd7876f7..43286dbc8 100644 --- a/Sources/Core/TrackerConstants.swift +++ b/Sources/Core/TrackerConstants.swift @@ -14,7 +14,7 @@ import Foundation // --- Version -let kSPRawVersion = "5.4.1" +let kSPRawVersion = "5.4.2" #if os(iOS) let kSPVersion = "ios-\(kSPRawVersion)" #elseif os(tvOS) diff --git a/VERSION b/VERSION index ade65226e..8ae03c119 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.4.1 +5.4.2