diff --git a/Code/Adscript-Examples/Cocoapod/.gitignore b/Code/Adscript-Examples/Cocoapod/.gitignore new file mode 100644 index 00000000..a7f1f840 --- /dev/null +++ b/Code/Adscript-Examples/Cocoapod/.gitignore @@ -0,0 +1 @@ +Frameworks/*.xcframework/ \ No newline at end of file diff --git a/Code/Adscript-Examples/Cocoapod/AdscriptReporter.xcodeproj/project.pbxproj b/Code/Adscript-Examples/Cocoapod/AdscriptReporter.xcodeproj/project.pbxproj new file mode 100644 index 00000000..86c56021 --- /dev/null +++ b/Code/Adscript-Examples/Cocoapod/AdscriptReporter.xcodeproj/project.pbxproj @@ -0,0 +1,656 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXBuildFile section */ + 295ED3E52E16B2350095420B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 295ED3DB2E16B2350095420B /* Assets.xcassets */; }; + 295ED3E72E16B2350095420B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 295ED3E02E16B2350095420B /* Main.storyboard */; }; + 295ED3E82E16B2350095420B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 295ED3DE2E16B2350095420B /* LaunchScreen.storyboard */; }; + 295ED3E92E16B2350095420B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295ED3DA2E16B2350095420B /* AppDelegate.swift */; }; + 295ED3EA2E16B2350095420B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295ED3E32E16B2350095420B /* ViewController.swift */; }; + 295ED3EB2E16B2350095420B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295ED3E22E16B2350095420B /* SceneDelegate.swift */; }; + 295ED3EC2E16B2350095420B /* PlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295ED3E12E16B2350095420B /* PlayerView.swift */; }; + 869D111A592EF8154DA1AB03 /* libPods-AdscriptReporter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F7AEAE2F99316EBC3A7E059A /* libPods-AdscriptReporter.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 29994EC92DFDC6DA0016F0E2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29994EAA2DFDC6D80016F0E2 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 29994EB12DFDC6D80016F0E2; + remoteInfo = AdscriptReporter; + }; + 29994ED32DFDC6DA0016F0E2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29994EAA2DFDC6D80016F0E2 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 29994EB12DFDC6D80016F0E2; + remoteInfo = AdscriptReporter; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 295ED3DA2E16B2350095420B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 295ED3DB2E16B2350095420B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 295ED3DC2E16B2350095420B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 295ED3DD2E16B2350095420B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 295ED3DF2E16B2350095420B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 295ED3E12E16B2350095420B /* PlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerView.swift; sourceTree = ""; }; + 295ED3E22E16B2350095420B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 295ED3E32E16B2350095420B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 29994EB22DFDC6D80016F0E2 /* AdscriptReporter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AdscriptReporter.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 29994EC82DFDC6DA0016F0E2 /* AdscriptReporterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AdscriptReporterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 29994ED22DFDC6DA0016F0E2 /* AdscriptReporterUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AdscriptReporterUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 7D223C4308E6BCF0F6785F8F /* Pods-AdscriptReporter.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AdscriptReporter.debug.xcconfig"; path = "Target Support Files/Pods-AdscriptReporter/Pods-AdscriptReporter.debug.xcconfig"; sourceTree = ""; }; + CA025FA0C60D148274C918BC /* Pods-AdscriptReporter.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AdscriptReporter.release.xcconfig"; path = "Target Support Files/Pods-AdscriptReporter/Pods-AdscriptReporter.release.xcconfig"; sourceTree = ""; }; + F7AEAE2F99316EBC3A7E059A /* libPods-AdscriptReporter.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AdscriptReporter.a"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 29994EAF2DFDC6D80016F0E2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 869D111A592EF8154DA1AB03 /* libPods-AdscriptReporter.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 29994EC52DFDC6DA0016F0E2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 29994ECF2DFDC6DA0016F0E2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 295ED3E42E16B2350095420B /* AdscriptReporter */ = { + isa = PBXGroup; + children = ( + 295ED3DA2E16B2350095420B /* AppDelegate.swift */, + 295ED3DB2E16B2350095420B /* Assets.xcassets */, + 295ED3DC2E16B2350095420B /* Info.plist */, + 295ED3DE2E16B2350095420B /* LaunchScreen.storyboard */, + 295ED3E02E16B2350095420B /* Main.storyboard */, + 295ED3E12E16B2350095420B /* PlayerView.swift */, + 295ED3E22E16B2350095420B /* SceneDelegate.swift */, + 295ED3E32E16B2350095420B /* ViewController.swift */, + ); + name = AdscriptReporter; + path = ../SharedCode; + sourceTree = SOURCE_ROOT; + }; + 29994EA92DFDC6D80016F0E2 = { + isa = PBXGroup; + children = ( + 295ED3E42E16B2350095420B /* AdscriptReporter */, + 29994EB32DFDC6D80016F0E2 /* Products */, + 2DEA1210CC5916F8004A4364 /* Pods */, + D1C02604FAF420079FE8B046 /* Frameworks */, + ); + sourceTree = ""; + }; + 29994EB32DFDC6D80016F0E2 /* Products */ = { + isa = PBXGroup; + children = ( + 29994EB22DFDC6D80016F0E2 /* AdscriptReporter.app */, + 29994EC82DFDC6DA0016F0E2 /* AdscriptReporterTests.xctest */, + 29994ED22DFDC6DA0016F0E2 /* AdscriptReporterUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 2DEA1210CC5916F8004A4364 /* Pods */ = { + isa = PBXGroup; + children = ( + 7D223C4308E6BCF0F6785F8F /* Pods-AdscriptReporter.debug.xcconfig */, + CA025FA0C60D148274C918BC /* Pods-AdscriptReporter.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + D1C02604FAF420079FE8B046 /* Frameworks */ = { + isa = PBXGroup; + children = ( + F7AEAE2F99316EBC3A7E059A /* libPods-AdscriptReporter.a */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 29994EB12DFDC6D80016F0E2 /* AdscriptReporter */ = { + isa = PBXNativeTarget; + buildConfigurationList = 29994EDB2DFDC6DA0016F0E2 /* Build configuration list for PBXNativeTarget "AdscriptReporter" */; + buildPhases = ( + 6191FCA4F0B6655B3496C06F /* [CP] Check Pods Manifest.lock */, + 29994EAE2DFDC6D80016F0E2 /* Sources */, + 29994EAF2DFDC6D80016F0E2 /* Frameworks */, + 29994EB02DFDC6D80016F0E2 /* Resources */, + A31CD09B89FCD1875C0C920D /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AdscriptReporter; + productName = AdscriptReporter; + productReference = 29994EB22DFDC6D80016F0E2 /* AdscriptReporter.app */; + productType = "com.apple.product-type.application"; + }; + 29994EC72DFDC6DA0016F0E2 /* AdscriptReporterTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 29994EE02DFDC6DA0016F0E2 /* Build configuration list for PBXNativeTarget "AdscriptReporterTests" */; + buildPhases = ( + 29994EC42DFDC6DA0016F0E2 /* Sources */, + 29994EC52DFDC6DA0016F0E2 /* Frameworks */, + 29994EC62DFDC6DA0016F0E2 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 29994ECA2DFDC6DA0016F0E2 /* PBXTargetDependency */, + ); + name = AdscriptReporterTests; + productName = AdscriptReporterTests; + productReference = 29994EC82DFDC6DA0016F0E2 /* AdscriptReporterTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 29994ED12DFDC6DA0016F0E2 /* AdscriptReporterUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 29994EE32DFDC6DA0016F0E2 /* Build configuration list for PBXNativeTarget "AdscriptReporterUITests" */; + buildPhases = ( + 29994ECE2DFDC6DA0016F0E2 /* Sources */, + 29994ECF2DFDC6DA0016F0E2 /* Frameworks */, + 29994ED02DFDC6DA0016F0E2 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 29994ED42DFDC6DA0016F0E2 /* PBXTargetDependency */, + ); + name = AdscriptReporterUITests; + productName = AdscriptReporterUITests; + productReference = 29994ED22DFDC6DA0016F0E2 /* AdscriptReporterUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29994EAA2DFDC6D80016F0E2 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1640; + LastUpgradeCheck = 1640; + TargetAttributes = { + 29994EB12DFDC6D80016F0E2 = { + CreatedOnToolsVersion = 16.4; + }; + 29994EC72DFDC6DA0016F0E2 = { + CreatedOnToolsVersion = 16.4; + TestTargetID = 29994EB12DFDC6D80016F0E2; + }; + 29994ED12DFDC6DA0016F0E2 = { + CreatedOnToolsVersion = 16.4; + TestTargetID = 29994EB12DFDC6D80016F0E2; + }; + }; + }; + buildConfigurationList = 29994EAD2DFDC6D80016F0E2 /* Build configuration list for PBXProject "AdscriptReporter" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 29994EA92DFDC6D80016F0E2; + minimizedProjectReferenceProxies = 1; + preferredProjectObjectVersion = 77; + productRefGroup = 29994EB32DFDC6D80016F0E2 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 29994EB12DFDC6D80016F0E2 /* AdscriptReporter */, + 29994EC72DFDC6DA0016F0E2 /* AdscriptReporterTests */, + 29994ED12DFDC6DA0016F0E2 /* AdscriptReporterUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 29994EB02DFDC6D80016F0E2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 295ED3E52E16B2350095420B /* Assets.xcassets in Resources */, + 295ED3E72E16B2350095420B /* Main.storyboard in Resources */, + 295ED3E82E16B2350095420B /* LaunchScreen.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 29994EC62DFDC6DA0016F0E2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 29994ED02DFDC6DA0016F0E2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 6191FCA4F0B6655B3496C06F /* [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-AdscriptReporter-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; + }; + A31CD09B89FCD1875C0C920D /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-AdscriptReporter/Pods-AdscriptReporter-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-AdscriptReporter/Pods-AdscriptReporter-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AdscriptReporter/Pods-AdscriptReporter-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 29994EAE2DFDC6D80016F0E2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 295ED3E92E16B2350095420B /* AppDelegate.swift in Sources */, + 295ED3EA2E16B2350095420B /* ViewController.swift in Sources */, + 295ED3EB2E16B2350095420B /* SceneDelegate.swift in Sources */, + 295ED3EC2E16B2350095420B /* PlayerView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 29994EC42DFDC6DA0016F0E2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 29994ECE2DFDC6DA0016F0E2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 29994ECA2DFDC6DA0016F0E2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 29994EB12DFDC6D80016F0E2 /* AdscriptReporter */; + targetProxy = 29994EC92DFDC6DA0016F0E2 /* PBXContainerItemProxy */; + }; + 29994ED42DFDC6DA0016F0E2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 29994EB12DFDC6D80016F0E2 /* AdscriptReporter */; + targetProxy = 29994ED32DFDC6DA0016F0E2 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 295ED3DE2E16B2350095420B /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 295ED3DD2E16B2350095420B /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; + 295ED3E02E16B2350095420B /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 295ED3DF2E16B2350095420B /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 29994EDC2DFDC6DA0016F0E2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7D223C4308E6BCF0F6785F8F /* Pods-AdscriptReporter.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = G749Q24N3X; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = ../SharedCode/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.theoplayer.adscript.ios.integration.AdscriptReporter; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 29994EDD2DFDC6DA0016F0E2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CA025FA0C60D148274C918BC /* Pods-AdscriptReporter.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = G749Q24N3X; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = ../SharedCode/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.theoplayer.adscript.ios.integration.AdscriptReporter; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 29994EDE2DFDC6DA0016F0E2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.5; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 29994EDF2DFDC6DA0016F0E2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.5; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 29994EE12DFDC6DA0016F0E2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.5; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.theoplayer.adscript.ios.integration.AdscriptReporterTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AdscriptReporter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/AdscriptReporter"; + }; + name = Debug; + }; + 29994EE22DFDC6DA0016F0E2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.5; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.theoplayer.adscript.ios.integration.AdscriptReporterTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AdscriptReporter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/AdscriptReporter"; + }; + name = Release; + }; + 29994EE42DFDC6DA0016F0E2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.theoplayer.adscript.ios.integration.AdscriptReporterUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = AdscriptReporter; + }; + name = Debug; + }; + 29994EE52DFDC6DA0016F0E2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.theoplayer.adscript.ios.integration.AdscriptReporterUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = AdscriptReporter; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 29994EAD2DFDC6D80016F0E2 /* Build configuration list for PBXProject "AdscriptReporter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 29994EDE2DFDC6DA0016F0E2 /* Debug */, + 29994EDF2DFDC6DA0016F0E2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 29994EDB2DFDC6DA0016F0E2 /* Build configuration list for PBXNativeTarget "AdscriptReporter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 29994EDC2DFDC6DA0016F0E2 /* Debug */, + 29994EDD2DFDC6DA0016F0E2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 29994EE02DFDC6DA0016F0E2 /* Build configuration list for PBXNativeTarget "AdscriptReporterTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 29994EE12DFDC6DA0016F0E2 /* Debug */, + 29994EE22DFDC6DA0016F0E2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 29994EE32DFDC6DA0016F0E2 /* Build configuration list for PBXNativeTarget "AdscriptReporterUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 29994EE42DFDC6DA0016F0E2 /* Debug */, + 29994EE52DFDC6DA0016F0E2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29994EAA2DFDC6D80016F0E2 /* Project object */; +} diff --git a/Code/Adscript-Examples/Cocoapod/AdscriptReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Code/Adscript-Examples/Cocoapod/AdscriptReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/Code/Adscript-Examples/Cocoapod/AdscriptReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Code/Adscript-Examples/Cocoapod/AdscriptReporter.xcworkspace/contents.xcworkspacedata b/Code/Adscript-Examples/Cocoapod/AdscriptReporter.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..abee4e66 --- /dev/null +++ b/Code/Adscript-Examples/Cocoapod/AdscriptReporter.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Code/Adscript-Examples/Cocoapod/Frameworks/AdscriptApiClient.podspec b/Code/Adscript-Examples/Cocoapod/Frameworks/AdscriptApiClient.podspec new file mode 100644 index 00000000..78a09a61 --- /dev/null +++ b/Code/Adscript-Examples/Cocoapod/Frameworks/AdscriptApiClient.podspec @@ -0,0 +1,38 @@ +# +# Be sure to run `pod spec lint AdscriptApiClient.podspec' to ensure this is a +# valid spec and to remove all comments including this before submitting the spec. +# +# To learn more about Podspec attributes see https://guides.cocoapods.org/syntax/podspec.html +# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ +# + +# info_plist_path = "./Frameworks/AdscriptApiClient.xcframework/ios-arm64/AdscriptApiClient.framework/Info.plist" +# info_cflist = CFPropertyList::List.new(:file => info_plist_path) +# info_plist = CFPropertyList.native_types(info_cflist.value) +# adscriptApiClientVersion = info_plist["CFBundleShortVersionString"] + +# puts "Detected AdscriptApiClient XCFramework" +# puts " - version #{theoadscriptApiClientVersionSdkVersion}" + +adscriptApiClientVersion = "1.0.4" + +Pod::Spec.new do |spec| + + spec.name = "AdscriptApiClient" + spec.version = adscriptApiClientVersion + spec.summary = "The Adscript Api Client for iOS" + + spec.description = "T" + + spec.homepage = "https://theoplayer.com" + spec.license = "MIT" + + spec.author = { "Wonne Joosen" => "wonne.joosen@dolby.com" } + + spec.source = { :git => "https://www.theoplayer.com/.git", :tag => "#{spec.version}" } + + spec.source_files = "Classes", "Classes/**/*.{h,m}" + + spec.ios.vendored_frameworks = "AdScriptNoTrackingApiClient.xcframework" + +end diff --git a/Code/Adscript-Examples/Cocoapod/Frameworks/AdscriptApiClient_withidfa.podspec b/Code/Adscript-Examples/Cocoapod/Frameworks/AdscriptApiClient_withidfa.podspec new file mode 100644 index 00000000..250a5982 --- /dev/null +++ b/Code/Adscript-Examples/Cocoapod/Frameworks/AdscriptApiClient_withidfa.podspec @@ -0,0 +1,38 @@ +# +# Be sure to run `pod spec lint AdscriptApiClient.podspec' to ensure this is a +# valid spec and to remove all comments including this before submitting the spec. +# +# To learn more about Podspec attributes see https://guides.cocoapods.org/syntax/podspec.html +# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ +# + +# info_plist_path = "./Frameworks/AdscriptApiClient.xcframework/ios-arm64/AdscriptApiClient.framework/Info.plist" +# info_cflist = CFPropertyList::List.new(:file => info_plist_path) +# info_plist = CFPropertyList.native_types(info_cflist.value) +# adscriptApiClientVersion = info_plist["CFBundleShortVersionString"] + +# puts "Detected AdscriptApiClient XCFramework" +# puts " - version #{theoadscriptApiClientVersionSdkVersion}" + +adscriptApiClientVersion = "1.0.4" + +Pod::Spec.new do |spec| + + spec.name = "AdscriptApiClient" + spec.version = adscriptApiClientVersion + spec.summary = "The Adscript Api Client for iOS" + + spec.description = "T" + + spec.homepage = "https://theoplayer.com" + spec.license = "MIT" + + spec.author = { "Wonne Joosen" => "wonne.joosen@dolby.com" } + + spec.source = { :git => "https://www.theoplayer.com/.git", :tag => "#{spec.version}" } + + spec.source_files = "Classes", "Classes/**/*.{h,m}" + + spec.ios.vendored_frameworks = "AdscriptApiClient.xcframework" + +end diff --git a/Code/Adscript-Examples/Cocoapod/Podfile b/Code/Adscript-Examples/Cocoapod/Podfile new file mode 100644 index 00000000..8a436795 --- /dev/null +++ b/Code/Adscript-Examples/Cocoapod/Podfile @@ -0,0 +1,13 @@ +platform :ios, '13.0' + +target 'AdscriptReporter' do + # Use the AdscriptConnector that is locally defined in the parent directory + pod 'THEOplayer-Connector-Adscript', :path => '../../../' + pod 'AdscriptApiClient', :path => 'Frameworks/' + + # When you want to use a custom THEOplayerSDK build: + # - place your build at '../../../Helpers/TheoPod/Frameworks/THEOplayerSDK.xcframework' + # - uncomment the following line + # pod 'THEOplayerSDK-core', :path => '../../../Helpers/TheoPod' + +end diff --git a/Code/Adscript-Examples/Cocoapod/Podfile.lock b/Code/Adscript-Examples/Cocoapod/Podfile.lock new file mode 100644 index 00000000..cd14db5b --- /dev/null +++ b/Code/Adscript-Examples/Cocoapod/Podfile.lock @@ -0,0 +1,51 @@ +PODS: + - AdscriptApiClient (1.0.4) + - InternalCollectionsUtilities (1.1.1) + - swift-collections (1.1.1): + - swift-collections/BitCollections (= 1.1.1) + - swift-collections/DequeModule (= 1.1.1) + - swift-collections/HashTreeCollections (= 1.1.1) + - swift-collections/HeapModule (= 1.1.1) + - swift-collections/OrderedCollections (= 1.1.1) + - swift-collections/BitCollections (1.1.1): + - InternalCollectionsUtilities (= 1.1.1) + - swift-collections/DequeModule (1.1.1): + - InternalCollectionsUtilities (= 1.1.1) + - swift-collections/HashTreeCollections (1.1.1): + - InternalCollectionsUtilities (= 1.1.1) + - swift-collections/HeapModule (1.1.1): + - InternalCollectionsUtilities (= 1.1.1) + - swift-collections/OrderedCollections (1.1.1): + - InternalCollectionsUtilities (= 1.1.1) + - THEOplayer-Connector-Adscript (9.5.1): + - AdscriptApiClient (>= 1.0.4) + - swift-collections (~> 1.1) + - THEOplayerSDK-core (~> 9) + - THEOplayerSDK-core (9.5.1) + +DEPENDENCIES: + - AdscriptApiClient (from `Frameworks/`) + - THEOplayer-Connector-Adscript (from `../../../`) + +SPEC REPOS: + trunk: + - InternalCollectionsUtilities + - swift-collections + - THEOplayerSDK-core + +EXTERNAL SOURCES: + AdscriptApiClient: + :path: Frameworks/ + THEOplayer-Connector-Adscript: + :path: "../../../" + +SPEC CHECKSUMS: + AdscriptApiClient: 7ef1012a2b6d597c7dd5858d20726c4045768733 + InternalCollectionsUtilities: af3f471602c4a67cbcb0bee0a80f6f55a33ae453 + swift-collections: ba248ecaf44ef500b27d5cf94d304218c89892ff + THEOplayer-Connector-Adscript: 4dfcb0ebb17aa868ddbe6b63b5a53226861deb37 + THEOplayerSDK-core: df3ec4ed64e19bd006f6a5476d96161e07f700a3 + +PODFILE CHECKSUM: 2d601d96608b6ce3d8d2f78d6e205aca8709be50 + +COCOAPODS: 1.16.2 diff --git a/Code/Adscript-Examples/README.md b/Code/Adscript-Examples/README.md new file mode 100644 index 00000000..84efebcd --- /dev/null +++ b/Code/Adscript-Examples/README.md @@ -0,0 +1,6 @@ +# THEOPlayer 🤝 Adscript Samples + +We provide source code of two sample applications that illustrate how to use the connector with different package managers: + +- [Sample using **Swift Package Manager**](./SPM) (works out of the box with Xcode 12 and above) +- [Sample using **Cocoapods**](./Cocoapod) (requires Cocoapods installation through terminal) \ No newline at end of file diff --git a/Code/Adscript-Examples/SPM/AdscriptReporter.xcodeproj/project.pbxproj b/Code/Adscript-Examples/SPM/AdscriptReporter.xcodeproj/project.pbxproj new file mode 100644 index 00000000..1cffcb52 --- /dev/null +++ b/Code/Adscript-Examples/SPM/AdscriptReporter.xcodeproj/project.pbxproj @@ -0,0 +1,398 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXBuildFile section */ + 295C3DD72E174118000C4499 /* THEOplayerConnectorAdscript in Frameworks */ = {isa = PBXBuildFile; productRef = 295C3DD62E174118000C4499 /* THEOplayerConnectorAdscript */; }; + 295ED3D32E16B19B0095420B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 295ED3CB2E16B19B0095420B /* LaunchScreen.storyboard */; }; + 295ED3D42E16B19B0095420B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 295ED3CD2E16B19B0095420B /* Main.storyboard */; }; + 295ED3D52E16B19B0095420B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 295ED3C82E16B19B0095420B /* Assets.xcassets */; }; + 295ED3D62E16B19B0095420B /* PlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295ED3CE2E16B19B0095420B /* PlayerView.swift */; }; + 295ED3D72E16B19B0095420B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295ED3C72E16B19B0095420B /* AppDelegate.swift */; }; + 295ED3D82E16B19B0095420B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295ED3D02E16B19B0095420B /* ViewController.swift */; }; + 295ED3D92E16B19B0095420B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295ED3CF2E16B19B0095420B /* SceneDelegate.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 295ED3AF2E16B1260095420B /* AdscriptReporter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AdscriptReporter.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 295ED3C72E16B19B0095420B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 295ED3C82E16B19B0095420B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 295ED3C92E16B19B0095420B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 295ED3CA2E16B19B0095420B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 295ED3CC2E16B19B0095420B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 295ED3CE2E16B19B0095420B /* PlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerView.swift; sourceTree = ""; }; + 295ED3CF2E16B19B0095420B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 295ED3D02E16B19B0095420B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 295ED3AC2E16B1260095420B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 295C3DD72E174118000C4499 /* THEOplayerConnectorAdscript in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 295ED3A62E16B1260095420B = { + isa = PBXGroup; + children = ( + 295ED3D12E16B19B0095420B /* AdscriptReporter */, + 295ED3B02E16B1260095420B /* Products */, + ); + sourceTree = ""; + }; + 295ED3B02E16B1260095420B /* Products */ = { + isa = PBXGroup; + children = ( + 295ED3AF2E16B1260095420B /* AdscriptReporter.app */, + ); + name = Products; + sourceTree = ""; + }; + 295ED3D12E16B19B0095420B /* AdscriptReporter */ = { + isa = PBXGroup; + children = ( + 295ED3C72E16B19B0095420B /* AppDelegate.swift */, + 295ED3C82E16B19B0095420B /* Assets.xcassets */, + 295ED3C92E16B19B0095420B /* Info.plist */, + 295ED3CB2E16B19B0095420B /* LaunchScreen.storyboard */, + 295ED3CD2E16B19B0095420B /* Main.storyboard */, + 295ED3CE2E16B19B0095420B /* PlayerView.swift */, + 295ED3CF2E16B19B0095420B /* SceneDelegate.swift */, + 295ED3D02E16B19B0095420B /* ViewController.swift */, + ); + name = AdscriptReporter; + path = ../SharedCode; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 295ED3AE2E16B1260095420B /* AdscriptReporter */ = { + isa = PBXNativeTarget; + buildConfigurationList = 295ED3C22E16B1270095420B /* Build configuration list for PBXNativeTarget "AdscriptReporter" */; + buildPhases = ( + 295ED3AB2E16B1260095420B /* Sources */, + 295ED3AC2E16B1260095420B /* Frameworks */, + 295ED3AD2E16B1260095420B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AdscriptReporter; + packageProductDependencies = ( + 295C3DD62E174118000C4499 /* THEOplayerConnectorAdscript */, + ); + productName = AdscriptReporter; + productReference = 295ED3AF2E16B1260095420B /* AdscriptReporter.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 295ED3A72E16B1260095420B /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1640; + LastUpgradeCheck = 1640; + TargetAttributes = { + 295ED3AE2E16B1260095420B = { + CreatedOnToolsVersion = 16.4; + }; + }; + }; + buildConfigurationList = 295ED3AA2E16B1260095420B /* Build configuration list for PBXProject "AdscriptReporter" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 295ED3A62E16B1260095420B; + minimizedProjectReferenceProxies = 1; + packageReferences = ( + 295C3DD52E174118000C4499 /* XCLocalSwiftPackageReference "../../../../iOS-Connector" */, + ); + preferredProjectObjectVersion = 77; + productRefGroup = 295ED3B02E16B1260095420B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 295ED3AE2E16B1260095420B /* AdscriptReporter */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 295ED3AD2E16B1260095420B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 295ED3D32E16B19B0095420B /* LaunchScreen.storyboard in Resources */, + 295ED3D42E16B19B0095420B /* Main.storyboard in Resources */, + 295ED3D52E16B19B0095420B /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 295ED3AB2E16B1260095420B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 295ED3D62E16B19B0095420B /* PlayerView.swift in Sources */, + 295ED3D72E16B19B0095420B /* AppDelegate.swift in Sources */, + 295ED3D82E16B19B0095420B /* ViewController.swift in Sources */, + 295ED3D92E16B19B0095420B /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 295ED3CB2E16B19B0095420B /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 295ED3CA2E16B19B0095420B /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; + 295ED3CD2E16B19B0095420B /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 295ED3CC2E16B19B0095420B /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 295ED3C32E16B1270095420B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 8YAB8ZY55Y; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = ../SharedCode/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.theoplayer.adscript.ios.integration.AdscriptReporter; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 295ED3C42E16B1270095420B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 8YAB8ZY55Y; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = ../SharedCode/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.theoplayer.adscript.ios.integration.AdscriptReporter; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 295ED3C52E16B1270095420B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 8YAB8ZY55Y; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.5; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 295ED3C62E16B1270095420B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 8YAB8ZY55Y; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.5; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 295ED3AA2E16B1260095420B /* Build configuration list for PBXProject "AdscriptReporter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 295ED3C52E16B1270095420B /* Debug */, + 295ED3C62E16B1270095420B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 295ED3C22E16B1270095420B /* Build configuration list for PBXNativeTarget "AdscriptReporter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 295ED3C32E16B1270095420B /* Debug */, + 295ED3C42E16B1270095420B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 295C3DD52E174118000C4499 /* XCLocalSwiftPackageReference "../../../../iOS-Connector" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = "../../../../iOS-Connector"; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 295C3DD62E174118000C4499 /* THEOplayerConnectorAdscript */ = { + isa = XCSwiftPackageProductDependency; + productName = THEOplayerConnectorAdscript; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 295ED3A72E16B1260095420B /* Project object */; +} diff --git a/Code/Adscript-Examples/SPM/AdscriptReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Code/Adscript-Examples/SPM/AdscriptReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/Code/Adscript-Examples/SPM/AdscriptReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Code/Adscript-Examples/SharedCode/AppDelegate.swift b/Code/Adscript-Examples/SharedCode/AppDelegate.swift new file mode 100644 index 00000000..7595a9f8 --- /dev/null +++ b/Code/Adscript-Examples/SharedCode/AppDelegate.swift @@ -0,0 +1,36 @@ +// +// AppDelegate.swift +// AdscriptReporter +// +// Created by Joosen, Wonne on 14/06/2025. +// + +import UIKit + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/Code/Adscript-Examples/SharedCode/Assets.xcassets/AccentColor.colorset/Contents.json b/Code/Adscript-Examples/SharedCode/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/Code/Adscript-Examples/SharedCode/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Code/Adscript-Examples/SharedCode/Assets.xcassets/AppIcon.appiconset/Contents.json b/Code/Adscript-Examples/SharedCode/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..23058801 --- /dev/null +++ b/Code/Adscript-Examples/SharedCode/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Code/Adscript-Examples/SharedCode/Assets.xcassets/Contents.json b/Code/Adscript-Examples/SharedCode/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/Code/Adscript-Examples/SharedCode/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Code/Adscript-Examples/SharedCode/Base.lproj/LaunchScreen.storyboard b/Code/Adscript-Examples/SharedCode/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..865e9329 --- /dev/null +++ b/Code/Adscript-Examples/SharedCode/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Code/Adscript-Examples/SharedCode/Base.lproj/Main.storyboard b/Code/Adscript-Examples/SharedCode/Base.lproj/Main.storyboard new file mode 100644 index 00000000..478dadae --- /dev/null +++ b/Code/Adscript-Examples/SharedCode/Base.lproj/Main.storyboard @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Code/Adscript-Examples/SharedCode/Info.plist b/Code/Adscript-Examples/SharedCode/Info.plist new file mode 100644 index 00000000..dd3c9afd --- /dev/null +++ b/Code/Adscript-Examples/SharedCode/Info.plist @@ -0,0 +1,25 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + + diff --git a/Code/Adscript-Examples/SharedCode/PlayerView.swift b/Code/Adscript-Examples/SharedCode/PlayerView.swift new file mode 100644 index 00000000..8fc1d2da --- /dev/null +++ b/Code/Adscript-Examples/SharedCode/PlayerView.swift @@ -0,0 +1,32 @@ +// +// PlayerView.swift +// AdscriptReporter +// +// Created by Joosen, Wonne on 24/06/2025. +// + +import UIKit +import THEOplayerSDK + +/// A container UIView that holds a `THEOPlayer` and lays it out +/// to stretch the entire frame of this container view +class PlayerView: UIView { + /// The player that is streched out to fit this view + let player: THEOplayer + + required init?(coder: NSCoder) {nil} + + /// Create a container view that holds a `THEOPlayer` and lays it out + /// to stretch its contents to fill the entire frame of the container view. + /// - Parameter player: The player that will be laid out in this view + init(player: THEOplayer) { + self.player = player + super.init(frame: player.frame) + player.addAsSubview(of: self) + } + + override func layoutSubviews() { + super.layoutSubviews() + player.frame = bounds + } +} diff --git a/Code/Adscript-Examples/SharedCode/SceneDelegate.swift b/Code/Adscript-Examples/SharedCode/SceneDelegate.swift new file mode 100644 index 00000000..c917c725 --- /dev/null +++ b/Code/Adscript-Examples/SharedCode/SceneDelegate.swift @@ -0,0 +1,52 @@ +// +// SceneDelegate.swift +// AdscriptReporter +// +// Created by Joosen, Wonne on 14/06/2025. +// + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + guard let _ = (scene as? UIWindowScene) else { return } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/Code/Adscript-Examples/SharedCode/ViewController.swift b/Code/Adscript-Examples/SharedCode/ViewController.swift new file mode 100644 index 00000000..6b7fac5b --- /dev/null +++ b/Code/Adscript-Examples/SharedCode/ViewController.swift @@ -0,0 +1,122 @@ +// +// ViewController.swift +// AdscriptReporter +// +// Created by Joosen, Wonne on 14/06/2025. +// + +import UIKit +import THEOplayerSDK +import THEOplayerConnectorAdscript +import AdScriptNoTrackingApiClient + +#if canImport(THEOplayerGoogleIMAIntegration) +import THEOplayerGoogleIMAIntegration +#endif + +class ViewController: UIViewController { + + + var adscript: AdscriptConnector + @IBOutlet weak var playerViewContainer: UIView! + var player: THEOplayer + + required init?(coder: NSCoder) { +// self.player = THEOplayer(with: nil, configuration: THEOplayerConfiguration(chromeless: false, ads: AdsConfiguration( +// showCountdown: true, +// preload: AdPreloadType.MIDROLL_AND_POSTROLL, +// googleIma: GoogleIMAAdsConfiguration(useNativeIma: false) +// ))) + self.player = THEOplayer(with: nil, configuration: THEOplayerConfigurationBuilder().build()) + let adscriptContentMetadata = AdScriptDataObject() + #if canImport(THEOplayerGoogleIMAIntegration) + let imaIntegration = GoogleIMAIntegrationFactory.createIntegration(on: player) + player.addIntegration(imaIntegration) + #endif + self.adscript = AdscriptConnector( + configuration: AdscriptConfiguration(implementationId: "test123", debug: true), + player: player, + metadata: adscriptContentMetadata + ) + super.init(coder: coder) + } + + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + + let playerView = PlayerView(player: player) + playerView.translatesAutoresizingMaskIntoConstraints = true + playerView.frame = playerViewContainer.bounds + playerView.autoresizingMask = [.flexibleHeight, .flexibleWidth] + playerViewContainer.addSubview(playerView) + + } + + + @IBAction func bbbButtonClicked(_ sender: UIButton) { + player.source = SourceDescription( + source: TypedSource( + src: bigBuckBunnyURL, + type: "application/x-mpegurl" + ), + metadata: MetadataDescription( + metadataKeys: nil, + title: "Big buck bunny" + ) + ) + var adscriptContentMetadata = AdScriptDataObject() + .set(key: .length, value: 596) + .set(key: .assetId, value: "0123ABC") + .set(key: .channelId, value: "Dolby Test Asset") + .set(key: .program, value: "Big Buck Bunny") + .set(key: .livestream, value: "0") + .set(key: .type, value: .content) + + adscript.update(metadata: adscriptContentMetadata) + } + + @IBAction func starWarsButtonClicked(_ sender: UIButton) { + player.source = SourceDescription( + source: TypedSource( + src: starwarsURL.absoluteString, + type: "application/x-mpegurl" + ), + ads: [GoogleImaAdDescription(src: "https://cdn.theoplayer.com/demos/ads/vmap/single-pre-mid-post-no-skip.xml")], + metadata: MetadataDescription( + metadataKeys: nil, + title: "Star wars episode VII the force awakens official comic-con 2015 reel (2015)" + ) + ) + + var adscriptContentMetadata = AdScriptDataObject() + .set(key: .length, value: 211) + .set(key: .assetId, value: "4567DEF") + .set(key: .channelId, value: "Dolby Test Asset 2") + .set(key: .program, value: "Star Wars: Episode VII The Force Awakens") + .set(key: .livestream, value: "0") + .set(key: .attribute, value: "1") + .set(key: .type, value: .content) + adscript.update(metadata: adscriptContentMetadata) + } + + @IBAction func togglePlayPause(_ sender: UIButton) { + if (player.paused) { + player.play() + } else { + player.pause() + } + } + + @IBAction func seekForward(_ sender: Any) { + self.player.currentTime = self.player.currentTime + 10 + } + +} + +let bigBuckBunnyURL = "https://cdn.theoplayer.com/video/big_buck_bunny/big_buck_bunny.m3u8" +let starwarsURL = URL(string: "https://cdn.theoplayer.com/video/star_wars_episode_vii-the_force_awakens_official_comic-con_2015_reel_(2015)/index-daterange.m3u8")! + + + diff --git a/Code/Adscript/README.md b/Code/Adscript/README.md new file mode 100644 index 00000000..ec4a23d8 --- /dev/null +++ b/Code/Adscript/README.md @@ -0,0 +1,99 @@ +# THEOPlayer 🤝 Adscript + +THEOplayer-Connector-Adscript provides an integration between the THEOplayerSDK and Adscript. + +For example xcode projects with this connector see [Adscript-Examples](../Adscript-Examples/README.md). + +## Installation + +### [Swift Package Manager](https://swift.org/package-manager/) + +1. In Xcode, install the Adscript connector by navigating to **File > Add Packages** +2. In the prompt that appears, select the iOS-Connector GitHub repository: `https://github.com/THEOplayer/iOS-Connector` +3. Select the version you want to use. +4. Choose the Connector libraries you want to include in your app. +5. The Adscript SDK is not available as a Swift Package. Download the .xcframework from the Adscript developer portal and drag it onto Project > General > Frameworks, Libraries and Embedded Content. + +To support custom feature builds of THEOplayerSDK perform the following steps: + +1. Clone this repository to your computer. +2. Use a [local override](https://developer.apple.com/documentation/xcode/editing-a-package-dependency-as-a-local-package) of the `theoplayer-sdk-ios` package by selecting the folder `../../Helpers/TheoSPM/theoplayer-sdk-ios` in Finder and dragging it into the Project navigator of your Xcode project. +3. Place your custom THEOplayerSDK.xcframework at `../../Helpers/TheoSPM/theoplayer-sdk-ios/THEOplayerSDK.xcframework`. (It is also possible to place your xcframework somewhere else. In that case make sure to update the [Package.swift](../../Helpers/TheoSPM/theoplayer-sdk-ios/Package.swift) manifest inside the your local override so that it points to your custom THEOplayer build) +4. If Xcode complains about a missing xcframework + 1. Choose `File` > `Packages` > `Reset Package Caches` from the menu bar. + 2. If it is still not working, make sure to remove any `THEOplayerSDK.xcframework` inclusions that you manually installed before installing this THEOplayer-Connector-Adscript package. + +### [Cocoapods](https://guides.cocoapods.org/using/getting-started.html#getting-started) + +1. Create a Podfile if you don't already have one. From the root of your project directory, run the following command: `pod init` +2. To your Podfile, add the Adscript connector pods that you want to use in your app: `pod 'THEOplayer-Connector-Adscript'` +3. The Adscript SDK is not available as a pod. Download the .xcframework from the Adscript developer portal. Place it in a folder next to a custom podspec. Refer to the ones in [Adscript-Example for Cocoapods for an example](./../Adscript-Examples//Cocoapod/Frameworks/). Include a line in you app's Podfile to point to that podspec for the `AscriptApiClient` dependency. +```ruby + pod 'AdscriptApiClient', :path => 'path/to/folder/with/custompodspec/' +``` +4. Install the pods using `pod install` , then open your `.xcworkspace` file to see the project in Xcode. + +**Important note**: You will need to set Project > Build Settings > User Script Sandboxing to `No` + + +To support custom feature builds of THEOplayerSDK perform the following steps: + +1. Clone this repository to your computer. +2. Use a [local override](https://guides.cocoapods.org/using/the-podfile.html#using-the-files-from-a-folder-local-to-the-machine) of the `THEOplayerSDK-basic` pod by adding the following line to your projects Podfile: `pod 'THEOplayerSDK-basic', :path => 'iOS-Connector/Helpers/TheoPod'` and make sure the path points to the [TheoPod folder](../../Helpers/TheoPod). + +## Usage + +Import the `THEOplayerConnectorAdscript` module + +```swift +import THEOplayerConnectorAdscript +``` + +Create a `AdscriptConfiguration` that contains your implementation id and a flag to enable/disable debug logging: + +```swift +let configuration = AdscriptConfiguration( + implementationId: "test123", + debug: true +) +``` + +Create a `AdscriptConnector` that uses this `configuration`, your `THEOplayer` instance and the metadata for the first source you will set on the player: + +```swift +let connector = AdscriptConnector( + configuration: configuration, + player: player, + metadata: adscriptContentMetadata +) +``` + +During the connector's lifecycle, you can update the metadata of the currently set source using the `update` method, which you pass an `AdScriptDataObject`. + +```swift +var adscriptContentMetadata = AdScriptDataObject() + .set(key: .length, value: 596) + .set(key: .assetId, value: "0123ABC") + .set(key: .channelId, value: "Dolby Test Asset") + .set(key: .program, value: "Big Buck Bunny") + .set(key: .livestream, value: "0") + .set(key: .type, value: .content) + +connector.update(metadata: adscriptContentMetadata) +``` + +Change user info with the `updateUser` method, which you pass a `AdScriptI12n` object: +```swift +var adScriptI12n = AdScriptI12n() + .set(key: 1, value: "28c7dacc-e68b-4fb7-9770-efeaaabe6688") // client-side user identifier (customerId) + .set(key: 2, value: "29c7dacc-e68b-4fb7-9770-efeaaabe6688") // client-side user device identifier (deviceId) + .set(key: 3, value: "30c7dacc-e68b-4fb7-9770-efeaaabe6688") // client-side profile identifier of the logged-in user (profileId) + .set(key: 4, value: "31c7dacc-e68b-4fb7-9770-efeaaabe6688") // optional - SW device identifier for a situation where there are multiple device IDs in the client DB (typically a) HW ID - fill in i2, b) SW ID - fill in i4). + .set(key: 5, value: "ef3c6dc72a26912f07f0e733d51b46c771d807bf") // fingerprint of user's email address +connector.updateUser(i12n: adScriptI12n) +``` + +On each DidBecomeActive, you need to call +```swift +connector.sessionStart() +``` \ No newline at end of file diff --git a/Code/Adscript/Source/AdscriptConnector.swift b/Code/Adscript/Source/AdscriptConnector.swift new file mode 100644 index 00000000..2951f240 --- /dev/null +++ b/Code/Adscript/Source/AdscriptConnector.swift @@ -0,0 +1,40 @@ +import THEOplayerSDK +#if canImport(AdScriptNoTrackingApiClient) +import AdScriptNoTrackingApiClient +#endif +#if canImport(AdScriptApiClient) +import AdScriptApiClient +#endif + +public struct AdscriptConfiguration { + let implementationId: String + let debug: Bool + + public init(implementationId: String, debug: Bool) { + self.implementationId = implementationId + self.debug = debug + } +} + +public struct AdscriptConnector { + private let adapter: AdscriptAdapter + private let player: THEOplayer + + + public init(configuration: AdscriptConfiguration, player: THEOplayer, metadata: AdScriptDataObject) { + self.player = player + self.adapter = AdscriptAdapter(configuration: configuration, player: player, metadata: metadata) + } + + public func sessionStart() { + self.adapter.sessionStart() + } + + public func update(metadata: AdScriptDataObject) { + self.adapter.update(metadata: metadata) + } + + public func updateUser(i12n: AdScriptI12n) { + self.adapter.updateUser(i12n: i12n) + } +} diff --git a/Code/Adscript/Source/integration/AdscriptAdapter.swift b/Code/Adscript/Source/integration/AdscriptAdapter.swift new file mode 100644 index 00000000..0440c6af --- /dev/null +++ b/Code/Adscript/Source/integration/AdscriptAdapter.swift @@ -0,0 +1,453 @@ +import THEOplayerSDK +import Collections +#if canImport(AdScriptNoTrackingApiClient) +import AdScriptNoTrackingApiClient +#endif +#if canImport(AdScriptApiClient) +import AdScriptApiClient +#endif + +public struct LogPoint { + let name: AdScriptEventName; + let cue: Double; +} + +let LOG_PLAYER_EVENTS = false +let LOG_ADSCRIPT_EVENTS = false + +public class AdscriptAdapter { + private let player: THEOplayer + private var contentMetadata: AdScriptDataObject + private var contentLogPoints: Deque = Deque() + private var adMetadata: AdScriptDataObject? = nil + private var waitingForFirstSecondOfAd = false + private var waitingForFirstSecondOfSsaiAdSince: Double? = nil + private let configuration: AdscriptConfiguration + private let adscriptCollector: AdScriptCollector + + private var playEventListener: EventListener? + private var playingEventListener: EventListener? + private var errorEventListener: EventListener? + private var sourceChangeEventListener: EventListener? + private var endedEventListener: EventListener? + private var durationChangeEventListener: EventListener? + private var timeUpdateEventListener: EventListener? + private var volumeChangeEventListener: EventListener? + private var rateChangeEventListener: EventListener? + private var presentationModeChangeEventListener: EventListener? + + private var adBreakBeginListener: EventListener? + private var adBeginListener: EventListener? + private var adFirstQuartileListener: EventListener? + private var adMidpointListener: EventListener? + private var adThirdQuartileListener: EventListener? + private var adCompletedListener: EventListener? + private var adBreakEndedListener: EventListener? + + + public init(configuration: AdscriptConfiguration, player: THEOplayer, metadata: AdScriptDataObject) { + self.player = player + self.contentMetadata = metadata + self.configuration = configuration + + self.adscriptCollector = AdScriptCollector(implementationId: configuration.implementationId, isDebug: configuration.debug && LOG_ADSCRIPT_EVENTS) + + reportPlayerState() + addEventListeners() + } + + public func sessionStart() { + self.adscriptCollector.sessionStart() + } + + public func update(metadata: AdScriptDataObject) { + self.contentMetadata = metadata + } + + public func updateUser(i12n: AdScriptI12n) { + self.adscriptCollector.i12n = i12n + } + + private func reportPlayerState() { + reportFullscreen(isFullscreen: player.presentationMode == PresentationMode.fullscreen) + reportDimensions(width: player.videoWidth, height: player.videoHeight) + reportPlaybackSpeed(playbackRate: player.playbackRate) + reportVolumeAndMuted(isMuted: player.muted, volume: player.volume) + reportTriggeredByUser(autoplayEnabled: player.autoplay) + reportVisibility() + } + + private func reportFullscreen(isFullscreen: Bool) { + _ = self.adscriptCollector.playerState.set(key: AdScriptPlayerStateKey.fullscreen, value: isFullscreen ? 1 : 0) + } + + private func reportDimensions(width: Int, height: Int) { + _ = self.adscriptCollector.playerState.set(key: AdScriptPlayerStateKey.width, value: width) + _ = self.adscriptCollector.playerState.set(key: AdScriptPlayerStateKey.height, value: height) + } + + private func reportPlaybackSpeed(playbackRate: Double) { + _ = self.adscriptCollector.playerState.set(key: AdScriptPlayerStateKey.normalSpeed, value: playbackRate == 1 ? 1 : 0) + } + + private func reportVolumeAndMuted(isMuted: Bool, volume: Float) { + _ = self.adscriptCollector.playerState.set(key: AdScriptPlayerStateKey.muted, value: (isMuted || volume == 0) ? 1 : 0) + _ = self.adscriptCollector.playerState.set(key: AdScriptPlayerStateKey.volume, value: Int(volume)) + } + private func reportTriggeredByUser(autoplayEnabled: Bool) { + _ = self.adscriptCollector.playerState.set(key: AdScriptPlayerStateKey.triggeredByUser, value: autoplayEnabled ? 1 : 0) + } + + private func reportVisibility() { + // TODO + } + + private func handlePlaying(event: PlayingEvent) { + if (self.configuration.debug && LOG_PLAYER_EVENTS) { + print("[AdscriptConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") + } + if (self.player.ads.playing) { + if let adMetadata = self.adMetadata { + if (self.configuration.debug) { + print("[AdscriptConnector] Push .start event with adMetadata \(adMetadata.toJsonString())") + } + self.adscriptCollector.push(event: .start, data: adMetadata) + } + } else { + if (self.configuration.debug) { + print("[AdscriptConnector] Push .start event with contentMetadata \(contentMetadata.toJsonString())") + } + self.adscriptCollector.push(event: .start, data: self.contentMetadata) + // TODO check if flag is needed or just one playing event is dispatched on iOS + } + if let playingEventListener: THEOplayerSDK.EventListener = self.playingEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) + } + } + + private func addLogPoints(duration: Double?) { + if let duration = duration { + if (duration.isFinite) { + self.contentLogPoints.append(LogPoint(name: .progress1 , cue: 1.0)) + self.contentLogPoints.append(LogPoint(name: .firstQuartile , cue: 0.25 * duration)) + self.contentLogPoints.append(LogPoint(name: .midpoint , cue: 0.5 * duration)) + self.contentLogPoints.append(LogPoint(name: .thirdQuartile , cue: 0.75 * duration)) + } else { + self.contentLogPoints.append(LogPoint(name: .progress1, cue: 1.0)) + } + if (self.configuration.debug) { + print("[AdscriptConnector] Stored \(self.contentLogPoints.count) logPoints : \(self.contentLogPoints.debugDescription)") + } + } + + } + + private func reportLogPoint(name: AdScriptEventName) { + if (self.configuration.debug) { + print("[AdscriptConnector] Push .\(name.rawValue) event with contentMetadata \(contentMetadata.toJsonString())") + } + self.adscriptCollector.push(event: name, data: self.contentMetadata) + } + + private func maybeReportAdProgress(currentTime: Double) { + if (!self.waitingForFirstSecondOfAd) { return } + if let currentAd = player.ads.currentAds.first { + switch currentAd.integration { + case .google_ima: + if let adMetadata = self.adMetadata, currentTime >= 1 { + if (self.configuration.debug) { + print("[AdscriptConnector] Push .progress1 event with adMetadata \(adMetadata.toJsonString())") + } + self.adscriptCollector.push(event: .progress1, data: adMetadata) + self.waitingForFirstSecondOfAd = false + } + case .google_dai: + if let waitingSince = self.waitingForFirstSecondOfSsaiAdSince, + let adMetadata = self.adMetadata, + currentTime >= waitingSince + 1.0 { + if (self.configuration.debug) { + print("[AdscriptConnector] Push .progress1 event with adMetadata \(adMetadata.toJsonString())") + } + self.adscriptCollector.push(event: .progress1, data: adMetadata) + self.waitingForFirstSecondOfAd = false + self.waitingForFirstSecondOfSsaiAdSince = nil + } + case .theoads: + if (self.configuration.debug) { print("[AdscriptConnector] Ad Integration is not supported (maybeReportAdProgress)") } + case .custom: + if (self.configuration.debug) { print("[AdscriptConnector] Ad Integration is not supported (maybeReportAdProgress)") } + @unknown default: + if (self.configuration.debug) { print("[AdscriptConnector] Ad Integration is not supported (maybeReportAdProgress)") } + } + } + } + + private func maybeReportProgress(currentTime: Double) { + if (player.ads.playing) { + maybeReportAdProgress(currentTime: currentTime) + return + } + + let nextLogPoint = contentLogPoints.first + if (nextLogPoint != nil && currentTime >= nextLogPoint!.cue) { + reportLogPoint(name: nextLogPoint!.name) + contentLogPoints.removeFirst() + } + } + + private func getAdType(offset: Int) -> AdScriptDataValueType { + if (offset == 0) { + return .preroll + } else if (offset == -1) { + return .postroll + } else if let duration = player.duration, offset >= Int(floor(duration)) { + return .postroll + } else { + return .midroll + } + } + + private func buildAdMetadata(ad: THEOplayerSDK.Ad) { + if (false) { + // TODO provide adProcessor + } else { + var currentAdMetadata = AdScriptDataObject() + if let id = ad.id { + _ = currentAdMetadata.set(key: .assetId, value: id) + _ = currentAdMetadata.set(key: .title, value: id) + + } +// _ = currentAdMetadata.set(key: .asmea, value: "TODO") + _ = currentAdMetadata.set(key: .attribute, value: .commercial) + _ = currentAdMetadata.set(key: .type, value: self.getAdType(offset: ad.adBreak.timeOffset)) + if let duration = ad.duration { + _ = currentAdMetadata.set(key: .length, value: duration) + } + + adMetadata = currentAdMetadata + } + } + + + private func addEventListeners() { + self.playEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAY, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[AdscriptConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") + } + }) + self.playingEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handlePlaying(event: event) }) + self.errorEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.ERROR, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if let code = event.errorObject?.code, let cause = event.errorObject?.cause, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[AdscriptConnector] Player Event: \(event.type) : code = \(code) ; cause = \(cause)") + } + }) + self.sourceChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.SOURCE_CHANGE, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[AdscriptConnector] Player Event: \(event.type) : source = \(event.source.debugDescription)") + } + + if let playingEventListener: THEOplayerSDK.EventListener = welf.playingEventListener { + welf.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) + } + welf.contentLogPoints = Deque() + welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handlePlaying(event: event) }) + }) + self.endedEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.ENDED, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[AdscriptConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") + } + if (welf.configuration.debug) { + print("[AdscriptConnector] Push .complete event with contentMetadata \(welf.contentMetadata.toJsonString())") + } + welf.adscriptCollector.push(event: .complete, data: welf.contentMetadata) + }) + self.durationChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.DURATION_CHANGE, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if let duration = event.duration, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[AdscriptConnector] Player Event: \(event.type) : duration = \(duration)") + } + welf.addLogPoints(duration: event.duration) + }) + self.timeUpdateEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.TIME_UPDATE, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[AdscriptConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") + } + welf.maybeReportProgress(currentTime: event.currentTime) + }) + self.volumeChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.VOLUME_CHANGE, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[AdscriptConnector] Player Event: \(event.type) : volume = \(event.volume)") + } + welf.reportVolumeAndMuted(isMuted: welf.player.muted, volume: event.volume) + }) + self.rateChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.RATE_CHANGE, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[AdscriptConnector] Player Event: \(event.type) : playbackRate = \(event.playbackRate)") + } + welf.reportPlaybackSpeed(playbackRate: event.playbackRate) + }) + self.presentationModeChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PRESENTATION_MODE_CHANGE, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[AdscriptConnector] Player Event: \(event.type) : presentationMode = \(event.presentationMode._rawValue)") + } + welf.reportFullscreen(isFullscreen: event.presentationMode == PresentationMode.fullscreen) + }) + + + if (hasAdIntegration()) { + self.adBreakBeginListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BREAK_BEGIN, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if let offset = event.ad?.timeOffset, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[AdscriptConnector] Player Event: \(event.type) : offset = \(offset)") + } + }) + self.adBeginListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BEGIN, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[AdscriptConnector] Player Event: \(event.type) : id = \(id)") + } + guard let ad = event.ad else { return } + welf.buildAdMetadata(ad: ad) + welf.waitingForFirstSecondOfAd = true + if (event.ad?.integration == .google_dai) { + welf.waitingForFirstSecondOfSsaiAdSince = welf.player.currentTime + } + guard let adMetadata = self?.adMetadata else { return } + if (welf.configuration.debug) { + print("[AdscriptConnector] Push .start event with adMetadata \(adMetadata.toJsonString())") + } + welf.adscriptCollector.push(event: .start, data: adMetadata) + }) + self.adFirstQuartileListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_FIRST_QUARTILE, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[AdscriptConnector] Player Event: \(event.type) : id = \(id)") + } + guard let adMetadata = welf.adMetadata else { return } + if (welf.configuration.debug) { + print("[AdscriptConnector] Push .firstQuartile event with adMetadata \(adMetadata.toJsonString())") + } + welf.adscriptCollector.push(event: .firstQuartile, data: adMetadata) + }) + self.adMidpointListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_MIDPOINT, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[AdscriptConnector] Player Event: \(event.type) : id = \(id)") + } + guard let adMetadata = welf.adMetadata else { return } + if (welf.configuration.debug) { + print("[AdscriptConnector] Push .midpoint event with adMetadata \(adMetadata.toJsonString())") + } + welf.adscriptCollector.push(event: .midpoint, data: adMetadata) + }) + self.adThirdQuartileListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_THIRD_QUARTILE, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if let id = event.ad?.id, welf.configuration.debug { + print("[AdscriptConnector] Player Event: \(event.type) : id = \(id)") + } + guard let adMetadata = welf.adMetadata else { return } + if (welf.configuration.debug) { + print("[AdscriptConnector] Push .thirdQuartile event with adMetadata \(adMetadata.toJsonString())") + } + welf.adscriptCollector.push(event: .thirdQuartile, data: adMetadata) + }) + self.adCompletedListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_END, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[AdscriptConnector] Player Event: \(event.type) : id = \(id)") + } + guard let adMetadata = welf.adMetadata else { return } + if (welf.configuration.debug) { + print("[AdscriptConnector] Push .complete event with adMetadata \(adMetadata.toJsonString())") + } + welf.adscriptCollector.push(event: .complete, data: adMetadata) + }) + self.adBreakEndedListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BREAK_END, listener: { [weak self] event in + guard let welf: AdscriptAdapter = self else { return } + if let offset = event.ad?.timeOffset, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[AdscriptConnector] Player Event: \(event.type) : offset = \(offset)") + } + if (event.ad?.timeOffset == 0) { + welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handlePlaying(event: event) }) + } + }) + } + } + + private func removeEventListeners() { + if let playEventListener: THEOplayerSDK.EventListener = self.playEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.TIME_UPDATE, listener: playEventListener) + } + if let playingEventListener: THEOplayerSDK.EventListener = self.playingEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) + } + if let errorEventListener: THEOplayerSDK.EventListener = self.errorEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.ERROR, listener: errorEventListener) + } + if let sourceChangeEventListener: THEOplayerSDK.EventListener = self.sourceChangeEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.SOURCE_CHANGE, listener: sourceChangeEventListener) + } + if let endedEventListener: THEOplayerSDK.EventListener = self.endedEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.ENDED, listener: endedEventListener) + } + if let durationChangeEventListener: THEOplayerSDK.EventListener = self.durationChangeEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.DURATION_CHANGE, listener: durationChangeEventListener) + } + if let timeUpdateEventListener: THEOplayerSDK.EventListener = self.timeUpdateEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.TIME_UPDATE, listener: timeUpdateEventListener) + } + if let volumeChangeEventListener: THEOplayerSDK.EventListener = self.volumeChangeEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.VOLUME_CHANGE, listener: volumeChangeEventListener) + } + if let rateChangeEventListener: THEOplayerSDK.EventListener = self.rateChangeEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.RATE_CHANGE, listener: rateChangeEventListener) + } + if let presentationModeChangeEventListener: THEOplayerSDK.EventListener = self.presentationModeChangeEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PRESENTATION_MODE_CHANGE, listener: presentationModeChangeEventListener) + } + if let adBreakBeginListener: THEOplayerSDK.EventListener = self.adBreakBeginListener { + self.player.removeEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BREAK_BEGIN, listener: adBreakBeginListener) + } + if let adBeginListener: THEOplayerSDK.EventListener = self.adBeginListener { + self.player.removeEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BEGIN, listener: adBeginListener) + } + if let adFirstQuartileListener: THEOplayerSDK.EventListener = self.adFirstQuartileListener { + self.player.removeEventListener(type: THEOplayerSDK.AdsEventTypes.AD_FIRST_QUARTILE, listener: adFirstQuartileListener) + } + if let adMidpointListener: THEOplayerSDK.EventListener = self.adMidpointListener { + self.player.removeEventListener(type: THEOplayerSDK.AdsEventTypes.AD_MIDPOINT, listener: adMidpointListener) + } + if let adThirdQuartileListener: THEOplayerSDK.EventListener = self.adThirdQuartileListener { + self.player.removeEventListener(type: THEOplayerSDK.AdsEventTypes.AD_THIRD_QUARTILE, listener: adThirdQuartileListener) + } + if let adCompletedListener: THEOplayerSDK.EventListener = self.adCompletedListener { + self.player.removeEventListener(type: THEOplayerSDK.AdsEventTypes.AD_END, listener: adCompletedListener) + } + if let adBreakEndedListener: THEOplayerSDK.EventListener = self.adBreakEndedListener { + self.player.removeEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BREAK_END, listener: adBreakEndedListener) + } + } + + private func hasAdIntegration() -> Bool { + let hasAdIntegration = player.getAllIntegrations().contains { integration in + switch integration.kind { + case IntegrationKind.GOOGLE_DAI: + return true + case IntegrationKind.GOOGLE_IMA: + return true + default: + print("[AdscriptConnector] no supported ad integration was found") + return false + } + } + return hasAdIntegration + } +} diff --git a/Package.swift b/Package.swift index 94c685a3..e19db05e 100644 --- a/Package.swift +++ b/Package.swift @@ -13,6 +13,8 @@ let package = Package( .library(name: "THEOplayerConnectorNielsen", targets: ["THEOplayerConnectorNielsen"]), + .library(name: "THEOplayerConnectorAdscript", targets: ["THEOplayerConnectorAdscript"]), + .library(name: "THEOplayerConnectorUtilities", targets: ["THEOplayerConnectorUtilities"]), .library(name: "THEOplayerConnectorSideloadedSubtitle", targets: ["THEOplayerConnectorSideloadedSubtitle"]), @@ -27,6 +29,7 @@ let package = Package( .package(name: "NielsenAppApi", url: "https://github.com/NielsenDigitalSDK/nielsenappsdk-ios-dynamic-spm-global", from: "9.0.0"), .package(name: "Swifter", url: "https://github.com/httpswift/swifter.git", .exactItem("1.5.0")), .package(name: "SwiftSubtitles", url: "https://github.com/dagronf/SwiftSubtitles.git", .exactItem("0.9.1")), + .package(url: "https://github.com/apple/swift-collections.git", .upToNextMinor(from: "1.2.0")), ], targets: [ // CONVIVA \\ @@ -61,6 +64,16 @@ let package = Package( path: "Code/Nielsen/Source" ), + // ADSCRIPT \\ + .target( + name: "THEOplayerConnectorAdscript", + dependencies: [ + "THEOplayerSDK", + .product(name: "Collections", package: "swift-collections") + ], + path: "Code/Adscript/Source" + ), + // UTILITY \\ .target( name: "THEOplayerConnectorUtilities", diff --git a/THEOplayer-Connector-Adscript.podspec b/THEOplayer-Connector-Adscript.podspec new file mode 100644 index 00000000..8b639793 --- /dev/null +++ b/THEOplayer-Connector-Adscript.podspec @@ -0,0 +1,26 @@ +require_relative './THEOplayer-Connector-Version' + +Pod::Spec.new do |s| + s.name = 'THEOplayer-Connector-Adscript' + s.module_name = 'THEOplayerConnectorAdscript' + s.version = theoplayer_connector_version + s.summary = 'Integration between the THEOplayerSDK and Adscript' + + s.description = 'This pod gives you access to classes that let you report playback events from a THEOplayer instance to Adscript' + + s.homepage = 'https://github.com/THEOplayer/iOS-Connector' + s.license = { :type => 'MIT', :file => 'LICENSE' } + s.author = "Dolby Laboratories" + s.source = { :git => 'https://github.com/THEOplayer/iOS-Connector.git', :tag => s.version.to_s } + + s.platforms = { :ios => "13.0", :tvos => "13.0" } + + s.source_files = 'Code/Adscript/Source/**/*' + + s.static_framework = true + s.swift_versions = ['5.3', '5.4', '5.5', '5.6', '5.7'] + s.dependency 'THEOplayerSDK-core', "~> 9" + s.dependency 'AdscriptApiClient', '>= 1.0.4' + s.dependency 'swift-collections', '~> 1.1' + +end