Skip to content

Commit

Permalink
Merge branch 'release/5.4.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
matus-tomlein committed Aug 9, 2023
2 parents 10d0eaa + 5ae519a commit 1f76199
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion SnowplowTracker.podspec
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 2 additions & 1 deletion Sources/Core/Media/MediaSchemata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Core/TrackerConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Snowplow/Media/Entities/MediaPlayerEntity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion Tests/Media/TestMediaController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 6 additions & 2 deletions Tests/Media/TestMediaEventAndEntitySerialization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.4.1
5.4.2

0 comments on commit 1f76199

Please sign in to comment.