diff --git a/Example/DemoAppTests/MuxImaListener_Test.m b/Example/DemoAppTests/MuxImaListener_Test.m deleted file mode 100644 index 4279d4b..0000000 --- a/Example/DemoAppTests/MuxImaListener_Test.m +++ /dev/null @@ -1,161 +0,0 @@ -// -// MUXSDKImaListenerTests.m -// MUXSDKImaListenerTests -// -// Created by Dylan Jhaveri on 09/11/2019. -// Copyright (c) 2019 Dylan Jhaveri. All rights reserved. -// - -// https://github.com/Specta/Specta - -#import -#import - -@interface MuxMockAVPlayerViewController : AVPlayerViewController -@end - -@implementation MuxMockAVPlayerViewController -- (id)init { - if (self = [super init]) { - self.player = [[AVPlayer alloc] init]; - } - return self; -} -@end - -@interface MuxMockImaAdEvent : IMAAdEvent { - enum IMAAdEventType type; -} - @property (nonatomic) enum IMAAdEventType type; - @property(nonatomic, copy, nullable) NSDictionary *adData; -@end - -@implementation MuxMockImaAdEvent - -@synthesize type; -@synthesize adData; - -- (id)initWithType:(NSInteger)_type { - type = _type; - return self; -} - -- (id)initWithType:(NSInteger)_type andAdData:(NSDictionary*)_adData { - type = _type; - adData = _adData; - return self; -} -@end - -SpecBegin(InitialSpecs) - -describe(@"MuxImaListener", ^{ - __block MUXSDKPlayerBinding *playerBinding = nil; - beforeEach(^{ - NSString *name = @"Test Player Name"; - MUXSDKCustomerPlayerData *playerData = [[MUXSDKCustomerPlayerData alloc] initWithPropertyKey:@"YOUR_ENVIRONMENT_KEY"]; - MUXSDKCustomerVideoData *videoData = [MUXSDKCustomerVideoData new]; - videoData.videoTitle = @"Big Buck Bunny"; - videoData.videoId = @"bigbuckbunny"; - videoData.videoSeries = @"animation"; - MuxMockAVPlayerViewController *avPlayerController = [[MuxMockAVPlayerViewController alloc] init]; - MUXSDKCustomerData *customerData = [[MUXSDKCustomerData alloc] initWithCustomerPlayerData:playerData - videoData:videoData - viewData:nil]; - playerBinding = [MUXSDKStats monitorAVPlayerViewController:avPlayerController - withPlayerName:name - customerData:customerData]; - }); - - describe(@"initWithPlayerBinding", ^{ - it(@"should initialize an object", ^{ - MuxImaListener *imaListener = [[MuxImaListener alloc] initWithPlayerBinding:playerBinding]; - expect(imaListener).toNot.beNil(); - }); - }); - - describe(@"initWithPlayerBindingWithOptions", ^{ - it(@"should initialize an object", ^{ - MuxImaListenerOptions options = MuxImaListenerOptionsPictureInPicture; - MuxImaListener *imaListener = [[MuxImaListener alloc] initWithPlayerBinding:playerBinding options:options]; - expect(imaListener).toNot.beNil(); - }); - }); - - describe(@"dispatchEvent", ^{ - __block MuxImaListener *imaListener = nil; - beforeEach(^{ - imaListener = [[MuxImaListener alloc] initWithPlayerBinding:playerBinding]; - }); - - it(@"should dispatch the correct event for kIMAAdEvent_STARTED", ^{ - MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_STARTED]; - MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent]; - expect(playbackEvent).to.beKindOf([MUXSDKAdPlayingEvent class]); - }); - - it(@"should dispatch the correct event for kIMAAdEvent_FIRST_QUARTILE", ^{ - MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_FIRST_QUARTILE]; - MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent]; - expect(playbackEvent).to.beKindOf([MUXSDKAdFirstQuartileEvent class]); - }); - - it(@"should dispatch the correct event for kIMAAdEvent_MIDPOINT", ^{ - MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_MIDPOINT]; - MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent]; - expect(playbackEvent).to.beKindOf([MUXSDKAdMidpointEvent class]); - }); - - it(@"should dispatch the correct event for kIMAAdEvent_THIRD_QUARTILE", ^{ - MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_THIRD_QUARTILE]; - MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent]; - expect(playbackEvent).to.beKindOf([MUXSDKAdThirdQuartileEvent class]); - }); - - it(@"should dispatch the correct event for kIMAAdEvent_SKIPPED", ^{ - MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_SKIPPED]; - MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent]; - expect(playbackEvent).to.beKindOf([MUXSDKAdEndedEvent class]); - }); - - it(@"should dispatch the correct event for kIMAAdEvent_COMPLETE", ^{ - MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_COMPLETE]; - MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent]; - expect(playbackEvent).to.beKindOf([MUXSDKAdEndedEvent class]); - }); - - it(@"should dispatch the correct event for kIMAAdEvent_PAUSE", ^{ - MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_PAUSE]; - MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent]; - expect(playbackEvent).to.beKindOf([MUXSDKAdPauseEvent class]); - }); - - it(@"should not dispatch aderror for LOG event *without* error info", ^{ - MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_LOG]; - MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent]; - expect(playbackEvent).to.beNil(); - }); - - it(@"should dispatch aderror for LOG event with error info", ^{ - NSMutableDictionary *mockErrorData = [[NSMutableDictionary alloc] init]; - [mockErrorData setObject:[NSNumber numberWithInt:110] forKey:@"errorCode"]; - [mockErrorData setObject:@"mock message" forKey:@"errorMessage"]; - [mockErrorData setObject:@"adPlayError" forKey:@"type"]; - NSMutableDictionary *mockLogData = [[NSMutableDictionary alloc] init]; - [mockLogData setObject:mockErrorData forKey:@"logData"]; - - MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_LOG andAdData:mockLogData]; - - MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent]; - expect(playbackEvent).to.beKindOf([MUXSDKAdErrorEvent class]); - }); - - it(@"should not dispatch an event for kIMAAdEvent_TAPPED", ^{ - MuxMockImaAdEvent *adEvent = [[MuxMockImaAdEvent alloc] initWithType:kIMAAdEvent_TAPPED]; - MUXSDKPlaybackEvent *playbackEvent = [imaListener dispatchEvent:adEvent]; - expect(playbackEvent).to.beNil(); - }); - }); -}); - -SpecEnd diff --git a/Example/MUXSDKImaListener.xcodeproj/project.pbxproj b/Example/MUXSDKImaListener.xcodeproj/project.pbxproj index 96489a0..8b85add 100644 --- a/Example/MUXSDKImaListener.xcodeproj/project.pbxproj +++ b/Example/MUXSDKImaListener.xcodeproj/project.pbxproj @@ -24,6 +24,9 @@ 351790AD293822A100ABBCC9 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 351790AC293822A100ABBCC9 /* SceneDelegate.swift */; }; 351790CC293822A200ABBCC9 /* DemoAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 351790CB293822A200ABBCC9 /* DemoAppUITests.swift */; }; 351790D92939012600ABBCC9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 351790D82939012600ABBCC9 /* Main.storyboard */; }; + 5DB297C999F8A7E6A5AB8862 /* Pods_DemoAppTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 234D0A42A417C44C5D35F698 /* Pods_DemoAppTests.framework */; }; + 66CFA6CAD12DC0464C8A347C /* Pods_DemoApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BEDBE5821BB818E7508B3ECE /* Pods_DemoApp.framework */; }; + B4A902F2D2775640A7E50964 /* Pods_MUXSDKIMATVOSExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4002E08B7DED4149D5B12F8F /* Pods_MUXSDKIMATVOSExample.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -77,6 +80,8 @@ 197727412AA90A44002BA06E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 197727422AA90A44002BA06E /* SceneDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 1977274A2AA90A60002BA06E /* ProcessInfo+Data.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ProcessInfo+Data.swift"; sourceTree = ""; }; + 234D0A42A417C44C5D35F698 /* Pods_DemoAppTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DemoAppTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 348CDCA196A7EF123EFC422A /* Pods-DemoAppTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoAppTests.debug.xcconfig"; path = "Target Support Files/Pods-DemoAppTests/Pods-DemoAppTests.debug.xcconfig"; sourceTree = ""; }; 351790A8293822A000ABBCC9 /* DemoApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DemoApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 351790AA293822A100ABBCC9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 351790AC293822A100ABBCC9 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; @@ -88,7 +93,10 @@ 351790C7293822A200ABBCC9 /* DemoAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 351790CB293822A200ABBCC9 /* DemoAppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoAppUITests.swift; sourceTree = ""; }; 351790D82939012600ABBCC9 /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; + 3EBC354C8485E5242E0B150C /* Pods-MUXSDKIMATVOSExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MUXSDKIMATVOSExample.release.xcconfig"; path = "Target Support Files/Pods-MUXSDKIMATVOSExample/Pods-MUXSDKIMATVOSExample.release.xcconfig"; sourceTree = ""; }; + 4002E08B7DED4149D5B12F8F /* Pods_MUXSDKIMATVOSExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MUXSDKIMATVOSExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 43EC73AD1AC164365E352A1C /* Mux-Stats-Google-IMA.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = "Mux-Stats-Google-IMA.podspec"; path = "../Mux-Stats-Google-IMA.podspec"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 5A9747E5CB59323EBDADE58F /* Pods-DemoApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoApp.debug.xcconfig"; path = "Target Support Files/Pods-DemoApp/Pods-DemoApp.debug.xcconfig"; sourceTree = ""; }; 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; @@ -96,7 +104,11 @@ 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; + 7493DC1F626202AB3DAFDC40 /* Pods-MUXSDKIMATVOSExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MUXSDKIMATVOSExample.debug.xcconfig"; path = "Target Support Files/Pods-MUXSDKIMATVOSExample/Pods-MUXSDKIMATVOSExample.debug.xcconfig"; sourceTree = ""; }; + 960FDC692315C4067D7349F1 /* Pods-DemoAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoAppTests.release.xcconfig"; path = "Target Support Files/Pods-DemoAppTests/Pods-DemoAppTests.release.xcconfig"; sourceTree = ""; }; ADF4605B56F017F8453719DF /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; + BEDBE5821BB818E7508B3ECE /* Pods_DemoApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DemoApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D6CB43B89088BA4CB7671EF9 /* Pods-DemoApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoApp.release.xcconfig"; path = "Target Support Files/Pods-DemoApp/Pods-DemoApp.release.xcconfig"; sourceTree = ""; }; DA374CB46C9E95D16EA14492 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; FA0DE2BA232AF707000D2CD2 /* MuxImaListener_Test.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MuxImaListener_Test.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -106,6 +118,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + B4A902F2D2775640A7E50964 /* Pods_MUXSDKIMATVOSExample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -127,6 +140,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 66CFA6CAD12DC0464C8A347C /* Pods_DemoApp.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -134,6 +148,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 5DB297C999F8A7E6A5AB8862 /* Pods_DemoAppTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -259,6 +274,9 @@ 6003F58F195388D20070C39A /* CoreGraphics.framework */, 6003F591195388D20070C39A /* UIKit.framework */, 6003F5AF195388D20070C39A /* XCTest.framework */, + BEDBE5821BB818E7508B3ECE /* Pods_DemoApp.framework */, + 234D0A42A417C44C5D35F698 /* Pods_DemoAppTests.framework */, + 4002E08B7DED4149D5B12F8F /* Pods_MUXSDKIMATVOSExample.framework */, ); name = Frameworks; sourceTree = ""; @@ -287,6 +305,12 @@ C0B2674DF2815E5727535C40 /* Pods */ = { isa = PBXGroup; children = ( + 5A9747E5CB59323EBDADE58F /* Pods-DemoApp.debug.xcconfig */, + D6CB43B89088BA4CB7671EF9 /* Pods-DemoApp.release.xcconfig */, + 348CDCA196A7EF123EFC422A /* Pods-DemoAppTests.debug.xcconfig */, + 960FDC692315C4067D7349F1 /* Pods-DemoAppTests.release.xcconfig */, + 7493DC1F626202AB3DAFDC40 /* Pods-MUXSDKIMATVOSExample.debug.xcconfig */, + 3EBC354C8485E5242E0B150C /* Pods-MUXSDKIMATVOSExample.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -298,9 +322,11 @@ isa = PBXNativeTarget; buildConfigurationList = 197727372AA278F0002BA06E /* Build configuration list for PBXNativeTarget "MUXSDKIMATVOSExample" */; buildPhases = ( + 9F549D7B051377547C5EE22F /* [CP] Check Pods Manifest.lock */, 197727092AA278EF002BA06E /* Sources */, 1977270A2AA278EF002BA06E /* Frameworks */, 1977270B2AA278EF002BA06E /* Resources */, + 7AA9D2E3148909143C645BC2 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -351,9 +377,11 @@ isa = PBXNativeTarget; buildConfigurationList = 351790D5293822A200ABBCC9 /* Build configuration list for PBXNativeTarget "DemoApp" */; buildPhases = ( + 0A1C696B76FBF5396B3B5A1E /* [CP] Check Pods Manifest.lock */, 351790A4293822A000ABBCC9 /* Sources */, 351790A5293822A000ABBCC9 /* Frameworks */, 351790A6293822A000ABBCC9 /* Resources */, + 0E8FD36E774D0C970D7BFD58 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -368,9 +396,11 @@ isa = PBXNativeTarget; buildConfigurationList = 351790D6293822A200ABBCC9 /* Build configuration list for PBXNativeTarget "DemoAppTests" */; buildPhases = ( + 1474B92CF82EB5F322A42E95 /* [CP] Check Pods Manifest.lock */, 351790B9293822A200ABBCC9 /* Sources */, 351790BA293822A200ABBCC9 /* Frameworks */, 351790BB293822A200ABBCC9 /* Resources */, + 97FE380F899C1ACD05466C2F /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -522,6 +552,147 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 0A1C696B76FBF5396B3B5A1E /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-DemoApp-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 0E8FD36E774D0C970D7BFD58 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-DemoApp/Pods-DemoApp-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Mux-Stats-Google-IMA-iOS/MuxStatsGoogleIMAPlugin.framework", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAds-IMA-iOS-SDK/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/Mux-Stats-AVPlayer/MUXSDKStats.framework/MUXSDKStats", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/Mux-Stats-Core/MuxCore.framework/MuxCore", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MuxStatsGoogleIMAPlugin.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleInteractiveMediaAds.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MUXSDKStats.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MuxCore.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DemoApp/Pods-DemoApp-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 1474B92CF82EB5F322A42E95 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-DemoAppTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 7AA9D2E3148909143C645BC2 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-MUXSDKIMATVOSExample/Pods-MUXSDKIMATVOSExample-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Mux-Stats-Google-IMA-tvOS/MuxStatsGoogleIMAPlugin.framework", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/Mux-Stats-AVPlayer/MUXSDKStats.framework/MUXSDKStats", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/Mux-Stats-Core/MuxCore.framework/MuxCore", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAds-IMA-tvOS-SDK/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MuxStatsGoogleIMAPlugin.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MUXSDKStats.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MuxCore.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleInteractiveMediaAds.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MUXSDKIMATVOSExample/Pods-MUXSDKIMATVOSExample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 97FE380F899C1ACD05466C2F /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-DemoAppTests/Pods-DemoAppTests-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Mux-Stats-Google-IMA-iOS/MuxStatsGoogleIMAPlugin.framework", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAds-IMA-iOS-SDK/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/Mux-Stats-AVPlayer/MUXSDKStats.framework/MUXSDKStats", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/Mux-Stats-Core/MuxCore.framework/MuxCore", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MuxStatsGoogleIMAPlugin.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleInteractiveMediaAds.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MUXSDKStats.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MuxCore.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DemoAppTests/Pods-DemoAppTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 9F549D7B051377547C5EE22F /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-MUXSDKIMATVOSExample-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 197727092AA278EF002BA06E /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -647,6 +818,7 @@ /* Begin XCBuildConfiguration section */ 197727312AA278F0002BA06E /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 7493DC1F626202AB3DAFDC40 /* Pods-MUXSDKIMATVOSExample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -698,6 +870,7 @@ }; 197727322AA278F0002BA06E /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 3EBC354C8485E5242E0B150C /* Pods-MUXSDKIMATVOSExample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -935,6 +1108,7 @@ }; 351790CF293822A200ABBCC9 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 5A9747E5CB59323EBDADE58F /* Pods-DemoApp.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -987,6 +1161,7 @@ }; 351790D0293822A200ABBCC9 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = D6CB43B89088BA4CB7671EF9 /* Pods-DemoApp.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -1039,6 +1214,7 @@ }; 351790D1293822A200ABBCC9 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 348CDCA196A7EF123EFC422A /* Pods-DemoAppTests.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -1086,6 +1262,7 @@ }; 351790D2293822A200ABBCC9 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 960FDC692315C4067D7349F1 /* Pods-DemoAppTests.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; diff --git a/Example/Podfile b/Example/Podfile index c9de2d3..74b9387 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -13,8 +13,6 @@ end target 'DemoAppTests' do platform :ios, '12.0' pod 'Mux-Stats-Google-IMA', :path => '../' - pod 'Specta' - pod 'Expecta' end post_install do |installer| diff --git a/Sources/MuxStatsGoogleIMAPlugin/MuxImaListener.m b/Sources/MuxStatsGoogleIMAPlugin/MuxImaListener.m index 0015394..dc86e91 100644 --- a/Sources/MuxStatsGoogleIMAPlugin/MuxImaListener.m +++ b/Sources/MuxStatsGoogleIMAPlugin/MuxImaListener.m @@ -47,7 +47,10 @@ - (void)setupAdViewData:(MUXSDKAdEvent *)event withAd:(IMAAd *)ad { MUXSDKAdData *adData = [MUXSDKAdData new]; if (ad != nil) { - + if ([_playerBinding getCurrentPlayheadTimeMs] < 1000) { + viewData.viewPrerollAdId = ad.adId; + viewData.viewPrerollCreativeId = ad.creativeID; + } adData.adId = ad.adId; adData.adCreativeId = ad.creativeID; diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index c8552c1..4b317b9 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -2,40 +2,19 @@ readonly XCODE_VERSION=$(xcodebuild -version | grep Xcode | cut -d " " -f2) -readonly SCHEME=DemoApp +readonly SCHEME=MuxStatsGoogleIMAPlugin readonly TOP_DIR=$(pwd) -readonly WORKSPACE_NAME=MUXSDKImaListener -readonly WORKSPACE_PATH=${TOP_DIR}/Example/${WORKSPACE_NAME}.xcworkspace - set -euo pipefail brew install xcbeautify -echo "▸ Switching to Xcode 15.4" -sudo xcode-select -s /Applications/Xcode_15.4.app - echo "▸ Using Xcode Version: ${XCODE_VERSION}" -echo "▸ Shutdown and reset the simulator" - -xcrun -v simctl shutdown all -xcrun -v simctl erase all - -pushd Example - -echo "▸ Reinstalling Local Cocoapod" - -pod deintegrate && pod install - echo "▸ Executing Tests" -xcodebuild -workspace ${WORKSPACE_PATH} \ - -scheme "${SCHEME}" \ +xcodebuild -scheme "${SCHEME}" \ -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.0' \ clean test \ | xcbeautify - -popd -