From f4285f8e3fcaa951b14b9f6b36a0c4be9412abad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matu=CC=81s=CC=8C=20Tomlein?= Date: Mon, 19 Aug 2024 10:46:36 +0200 Subject: [PATCH 1/2] Fix media tracking calls not being dispatched on the correct queue when tracking using AVPlayer --- Integrationtests/TestTrackEventsToMicro.swift | 13 +++++++++++++ .../InternalQueue/MediaControllerIQWrapper.swift | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Integrationtests/TestTrackEventsToMicro.swift b/Integrationtests/TestTrackEventsToMicro.swift index c57caffc2..d21984f02 100644 --- a/Integrationtests/TestTrackEventsToMicro.swift +++ b/Integrationtests/TestTrackEventsToMicro.swift @@ -13,6 +13,9 @@ import XCTest import SnowplowTracker +#if !os(watchOS) +import AVKit +#endif class TestTrackEventsToMicro: XCTestCase { var tracker: TrackerController? @@ -166,6 +169,16 @@ class TestTrackEventsToMicro: XCTestCase { ], timeout: Micro.timeout) } +#if !os(watchOS) + func testMediaTrackingUsingAVPlayer() { + let player = AVPlayer() + let mediaTracking = tracker?.media.startMediaTracking(player: player, configuration: MediaTrackingConfiguration(id: "integration-test")) + mediaTracking?.track(MediaReadyEvent()) + + wait(for: [Micro.expectCounts(good: 1)], timeout: Micro.timeout) + } +#endif + private func track(_ event: Event) { _ = tracker!.track(event) tracker!.emitter!.flush() diff --git a/Sources/Core/InternalQueue/MediaControllerIQWrapper.swift b/Sources/Core/InternalQueue/MediaControllerIQWrapper.swift index beaf0b2dc..e0b9dcc8d 100644 --- a/Sources/Core/InternalQueue/MediaControllerIQWrapper.swift +++ b/Sources/Core/InternalQueue/MediaControllerIQWrapper.swift @@ -45,7 +45,9 @@ class MediaControllerIQWrapper: MediaController { #if !os(watchOS) func startMediaTracking(player: AVPlayer, configuration: MediaTrackingConfiguration) -> MediaTracking { - return InternalQueue.sync { controller.startMediaTracking(player: player, configuration: configuration) } + return InternalQueue.sync { + MediaTrackingIQWrapper(tracking: controller.startMediaTracking(player: player, configuration: configuration)) + } } #endif From 2af846d346ccc42433bb903bdb48dd4963f0e574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matu=CC=81s=CC=8C=20Tomlein?= Date: Mon, 19 Aug 2024 10:49:25 +0200 Subject: [PATCH 2/2] Prepare for 6.0.8 release --- CHANGELOG | 4 ++++ Examples | 2 +- SnowplowTracker.podspec | 2 +- Sources/Core/TrackerConstants.swift | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 320fb05c1..5c5a53241 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +Version 6.0.8 (2024-08-19) +-------------------------- +Fix media tracking calls not being dispatched on the correct queue when tracking using AVPlayer + Version 6.0.7 (2024-07-16) -------------------------- Fix incorrect decoding of timeout property in network configuration (#902) diff --git a/Examples b/Examples index 26d1f93aa..17c63afb1 160000 --- a/Examples +++ b/Examples @@ -1 +1 @@ -Subproject commit 26d1f93aa04ee85a1f492204f5ded0725a2de6af +Subproject commit 17c63afb1da94a86706d0400a9cc79115d000537 diff --git a/SnowplowTracker.podspec b/SnowplowTracker.podspec index 698d850a9..8281f5f43 100644 --- a/SnowplowTracker.podspec +++ b/SnowplowTracker.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SnowplowTracker" - s.version = "6.0.7" + s.version = "6.0.8" 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 d60736d45..c1f2b470e 100644 --- a/Sources/Core/TrackerConstants.swift +++ b/Sources/Core/TrackerConstants.swift @@ -14,7 +14,7 @@ import Foundation // --- Version -let kSPRawVersion = "6.0.7" +let kSPRawVersion = "6.0.8" #if os(iOS) let kSPVersion = "ios-\(kSPRawVersion)" #elseif os(tvOS)