From 6ead72f99dcd1ddc0c48b2a1362d33c09ab1b4de Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Mon, 7 Jul 2025 23:02:44 +0200 Subject: [PATCH 01/31] boilerplate --- .gitignore | 2 +- .../Cocoapods/Frameworks/GemiusSDK.podspec | 38 ++ .../GemiusReporter.xcodeproj/project.pbxproj | 448 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + Code/Gemius-Examples/Cocoapods/Podfile | 13 + Code/Gemius-Examples/README.md | 8 + .../GemiusReporter.xcodeproj/project.pbxproj | 405 ++++++++++++++++ .../contents.xcworkspacedata | 7 + .../SharedCode/AppDelegate.swift | 36 ++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 35 ++ .../SharedCode/Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 + .../SharedCode/Base.lproj/Main.storyboard | 130 +++++ Code/Gemius-Examples/SharedCode/Info.plist | 25 + .../SharedCode/PlayerView.swift | 32 ++ .../SharedCode/SceneDelegate.swift | 52 ++ .../SharedCode/ViewController.swift | 105 ++++ Code/Gemius/README.md | 54 +++ Code/Gemius/Source/GemiusConnector.swift | 31 ++ Package.swift | 11 + THEOplayer-Connector-Gemius.podspec | 24 + 22 files changed, 1504 insertions(+), 1 deletion(-) create mode 100644 Code/Gemius-Examples/Cocoapods/Frameworks/GemiusSDK.podspec create mode 100644 Code/Gemius-Examples/Cocoapods/GemiusReporter.xcodeproj/project.pbxproj create mode 100644 Code/Gemius-Examples/Cocoapods/GemiusReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Code/Gemius-Examples/Cocoapods/Podfile create mode 100644 Code/Gemius-Examples/README.md create mode 100644 Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.pbxproj create mode 100644 Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Code/Gemius-Examples/SharedCode/AppDelegate.swift create mode 100644 Code/Gemius-Examples/SharedCode/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Code/Gemius-Examples/SharedCode/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Code/Gemius-Examples/SharedCode/Assets.xcassets/Contents.json create mode 100644 Code/Gemius-Examples/SharedCode/Base.lproj/LaunchScreen.storyboard create mode 100644 Code/Gemius-Examples/SharedCode/Base.lproj/Main.storyboard create mode 100644 Code/Gemius-Examples/SharedCode/Info.plist create mode 100644 Code/Gemius-Examples/SharedCode/PlayerView.swift create mode 100644 Code/Gemius-Examples/SharedCode/SceneDelegate.swift create mode 100644 Code/Gemius-Examples/SharedCode/ViewController.swift create mode 100644 Code/Gemius/README.md create mode 100644 Code/Gemius/Source/GemiusConnector.swift create mode 100644 THEOplayer-Connector-Gemius.podspec diff --git a/.gitignore b/.gitignore index dba5d7bd..de0b41e2 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,4 @@ Carthage/Build # `pod install` in .travis.yml # Pods/ -/CocoapodExample/ConvivaReporter.xcworkspace +Code/Gemius-Examples/Cocoapods/Frameworks/GemiusSDK.xcframework/ \ No newline at end of file diff --git a/Code/Gemius-Examples/Cocoapods/Frameworks/GemiusSDK.podspec b/Code/Gemius-Examples/Cocoapods/Frameworks/GemiusSDK.podspec new file mode 100644 index 00000000..03f8ffd3 --- /dev/null +++ b/Code/Gemius-Examples/Cocoapods/Frameworks/GemiusSDK.podspec @@ -0,0 +1,38 @@ +# +# Be sure to run `pod spec lint GemiusSDK.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/GemiusSDK.xcframework/ios-arm64/GemiusSDK.framework/Info.plist" +# info_cflist = CFPropertyList::List.new(:file => info_plist_path) +# info_plist = CFPropertyList.native_types(info_cflist.value) +# gemiusSdkVersion = info_plist["CFBundleShortVersionString"] + +# puts "Detected GemiusSDK XCFramework" +# puts " - version #{theogemiusSdkVersionSdkVersion}" + +gemiusSdkVersion = "2.0.6" + +Pod::Spec.new do |spec| + + spec.name = "GemiusSDK" + spec.version = gemiusSdkVersion + spec.summary = "The Gemius SDK 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 = "GemiusSDK.xcframework" + +end \ No newline at end of file diff --git a/Code/Gemius-Examples/Cocoapods/GemiusReporter.xcodeproj/project.pbxproj b/Code/Gemius-Examples/Cocoapods/GemiusReporter.xcodeproj/project.pbxproj new file mode 100644 index 00000000..81f7a0eb --- /dev/null +++ b/Code/Gemius-Examples/Cocoapods/GemiusReporter.xcodeproj/project.pbxproj @@ -0,0 +1,448 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXBuildFile section */ + 290B71202E1C67BB0013C58D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 290B71192E1C67BB0013C58D /* LaunchScreen.storyboard */; }; + 290B71212E1C67BB0013C58D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 290B71162E1C67BB0013C58D /* Assets.xcassets */; }; + 290B71222E1C67BB0013C58D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 290B711B2E1C67BB0013C58D /* Main.storyboard */; }; + 290B71242E1C67BB0013C58D /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 290B711D2E1C67BB0013C58D /* SceneDelegate.swift */; }; + 290B71252E1C67BB0013C58D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 290B71152E1C67BB0013C58D /* AppDelegate.swift */; }; + 290B71262E1C67BB0013C58D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 290B711E2E1C67BB0013C58D /* ViewController.swift */; }; + 290B71272E1C67BB0013C58D /* PlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 290B711C2E1C67BB0013C58D /* PlayerView.swift */; }; + C92E69F5BCBCC3C3718A0AB2 /* libPods-GemiusReporter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6ADEF4F05CF86B05378A24E7 /* libPods-GemiusReporter.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 290B70FD2E1C67A90013C58D /* GemiusReporter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GemiusReporter.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 290B71152E1C67BB0013C58D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 290B71162E1C67BB0013C58D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 290B71172E1C67BB0013C58D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 290B71182E1C67BB0013C58D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 290B711A2E1C67BB0013C58D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 290B711C2E1C67BB0013C58D /* PlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerView.swift; sourceTree = ""; }; + 290B711D2E1C67BB0013C58D /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 290B711E2E1C67BB0013C58D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 3CDE0DE7F9F317CFC4934FDE /* Pods-GemiusReporter.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GemiusReporter.release.xcconfig"; path = "Target Support Files/Pods-GemiusReporter/Pods-GemiusReporter.release.xcconfig"; sourceTree = ""; }; + 655C037A73A394B6A41E39D2 /* Pods-GemiusReporter.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GemiusReporter.debug.xcconfig"; path = "Target Support Files/Pods-GemiusReporter/Pods-GemiusReporter.debug.xcconfig"; sourceTree = ""; }; + 6ADEF4F05CF86B05378A24E7 /* libPods-GemiusReporter.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GemiusReporter.a"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 290B70FA2E1C67A90013C58D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C92E69F5BCBCC3C3718A0AB2 /* libPods-GemiusReporter.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 290B70F42E1C67A90013C58D = { + isa = PBXGroup; + children = ( + 290B711F2E1C67BB0013C58D /* GemiusReporter */, + 290B70FE2E1C67A90013C58D /* Products */, + C9594EB6CA0DEAD03053DC89 /* Pods */, + 942505A2BDA9156624C6F5B7 /* Frameworks */, + ); + sourceTree = ""; + }; + 290B70FE2E1C67A90013C58D /* Products */ = { + isa = PBXGroup; + children = ( + 290B70FD2E1C67A90013C58D /* GemiusReporter.app */, + ); + name = Products; + sourceTree = ""; + }; + 290B711F2E1C67BB0013C58D /* GemiusReporter */ = { + isa = PBXGroup; + children = ( + 290B71152E1C67BB0013C58D /* AppDelegate.swift */, + 290B71162E1C67BB0013C58D /* Assets.xcassets */, + 290B71172E1C67BB0013C58D /* Info.plist */, + 290B71192E1C67BB0013C58D /* LaunchScreen.storyboard */, + 290B711B2E1C67BB0013C58D /* Main.storyboard */, + 290B711C2E1C67BB0013C58D /* PlayerView.swift */, + 290B711D2E1C67BB0013C58D /* SceneDelegate.swift */, + 290B711E2E1C67BB0013C58D /* ViewController.swift */, + ); + name = GemiusReporter; + path = "/Users/wjoos/Code/customers/nfl/iOS-Connector/Code/Gemius-Examples/SharedCode"; + sourceTree = ""; + }; + 942505A2BDA9156624C6F5B7 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6ADEF4F05CF86B05378A24E7 /* libPods-GemiusReporter.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + C9594EB6CA0DEAD03053DC89 /* Pods */ = { + isa = PBXGroup; + children = ( + 655C037A73A394B6A41E39D2 /* Pods-GemiusReporter.debug.xcconfig */, + 3CDE0DE7F9F317CFC4934FDE /* Pods-GemiusReporter.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 290B70FC2E1C67A90013C58D /* GemiusReporter */ = { + isa = PBXNativeTarget; + buildConfigurationList = 290B71102E1C67AB0013C58D /* Build configuration list for PBXNativeTarget "GemiusReporter" */; + buildPhases = ( + FCB1552C376EB0AE4A014E81 /* [CP] Check Pods Manifest.lock */, + 290B70F92E1C67A90013C58D /* Sources */, + 290B70FA2E1C67A90013C58D /* Frameworks */, + 290B70FB2E1C67A90013C58D /* Resources */, + 820F1C2DF8C2A9AC0521FFE9 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GemiusReporter; + productName = GemiusReporter; + productReference = 290B70FD2E1C67A90013C58D /* GemiusReporter.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 290B70F52E1C67A90013C58D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1640; + LastUpgradeCheck = 1640; + TargetAttributes = { + 290B70FC2E1C67A90013C58D = { + CreatedOnToolsVersion = 16.4; + }; + }; + }; + buildConfigurationList = 290B70F82E1C67A90013C58D /* Build configuration list for PBXProject "GemiusReporter" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 290B70F42E1C67A90013C58D; + minimizedProjectReferenceProxies = 1; + preferredProjectObjectVersion = 77; + productRefGroup = 290B70FE2E1C67A90013C58D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 290B70FC2E1C67A90013C58D /* GemiusReporter */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 290B70FB2E1C67A90013C58D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 290B71202E1C67BB0013C58D /* LaunchScreen.storyboard in Resources */, + 290B71212E1C67BB0013C58D /* Assets.xcassets in Resources */, + 290B71222E1C67BB0013C58D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 820F1C2DF8C2A9AC0521FFE9 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-GemiusReporter/Pods-GemiusReporter-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-GemiusReporter/Pods-GemiusReporter-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-GemiusReporter/Pods-GemiusReporter-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + FCB1552C376EB0AE4A014E81 /* [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-GemiusReporter-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 290B70F92E1C67A90013C58D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 290B71242E1C67BB0013C58D /* SceneDelegate.swift in Sources */, + 290B71252E1C67BB0013C58D /* AppDelegate.swift in Sources */, + 290B71262E1C67BB0013C58D /* ViewController.swift in Sources */, + 290B71272E1C67BB0013C58D /* PlayerView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 290B71192E1C67BB0013C58D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 290B71182E1C67BB0013C58D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; + 290B711B2E1C67BB0013C58D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 290B711A2E1C67BB0013C58D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 290B71112E1C67AB0013C58D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 655C037A73A394B6A41E39D2 /* Pods-GemiusReporter.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 = ""; + 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.gemius.ios.integration.GemiusReporter; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 290B71122E1C67AB0013C58D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3CDE0DE7F9F317CFC4934FDE /* Pods-GemiusReporter.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 = ""; + 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.gemius.ios.integration.GemiusReporter; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 290B71132E1C67AB0013C58D /* 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; + }; + 290B71142E1C67AB0013C58D /* 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; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 290B70F82E1C67A90013C58D /* Build configuration list for PBXProject "GemiusReporter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 290B71132E1C67AB0013C58D /* Debug */, + 290B71142E1C67AB0013C58D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 290B71102E1C67AB0013C58D /* Build configuration list for PBXNativeTarget "GemiusReporter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 290B71112E1C67AB0013C58D /* Debug */, + 290B71122E1C67AB0013C58D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 290B70F52E1C67A90013C58D /* Project object */; +} diff --git a/Code/Gemius-Examples/Cocoapods/GemiusReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Code/Gemius-Examples/Cocoapods/GemiusReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/Code/Gemius-Examples/Cocoapods/GemiusReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Code/Gemius-Examples/Cocoapods/Podfile b/Code/Gemius-Examples/Cocoapods/Podfile new file mode 100644 index 00000000..369d5304 --- /dev/null +++ b/Code/Gemius-Examples/Cocoapods/Podfile @@ -0,0 +1,13 @@ +platform :ios, '13.0' + +target 'GemiusReporter' do + # Use the AdscriptConnector that is locally defined in the parent directory + pod 'THEOplayer-Connector-Gemius', :path => '../../../' + pod 'GemiusSDK', :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 \ No newline at end of file diff --git a/Code/Gemius-Examples/README.md b/Code/Gemius-Examples/README.md new file mode 100644 index 00000000..034530d1 --- /dev/null +++ b/Code/Gemius-Examples/README.md @@ -0,0 +1,8 @@ +# THEOPlayer 🤝 Gemius 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) + diff --git a/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.pbxproj b/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.pbxproj new file mode 100644 index 00000000..c944503e --- /dev/null +++ b/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.pbxproj @@ -0,0 +1,405 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXBuildFile section */ + 290B70F32E1C650F0013C58D /* THEOplayerConnectorGemius in Frameworks */ = {isa = PBXBuildFile; productRef = 290B70F22E1C650F0013C58D /* THEOplayerConnectorGemius */; }; + 295C3E152E1C6159000C4499 /* THEOplayerConnectorGemius in Frameworks */ = {isa = PBXBuildFile; productRef = 295C3E142E1C6159000C4499 /* THEOplayerConnectorGemius */; }; + 295C3E222E1C640D000C4499 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295C3E202E1C640D000C4499 /* ViewController.swift */; }; + 295C3E232E1C640D000C4499 /* PlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295C3E1E2E1C640D000C4499 /* PlayerView.swift */; }; + 295C3E242E1C640D000C4499 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295C3E1F2E1C640D000C4499 /* SceneDelegate.swift */; }; + 295C3E252E1C640D000C4499 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295C3E172E1C640D000C4499 /* AppDelegate.swift */; }; + 295C3E262E1C640D000C4499 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 295C3E1B2E1C640D000C4499 /* LaunchScreen.storyboard */; }; + 295C3E272E1C640D000C4499 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 295C3E182E1C640D000C4499 /* Assets.xcassets */; }; + 295C3E292E1C640D000C4499 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 295C3E1D2E1C640D000C4499 /* Main.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 295C3DE62E1C5E14000C4499 /* GemiusReporter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GemiusReporter.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 295C3E172E1C640D000C4499 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 295C3E182E1C640D000C4499 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 295C3E192E1C640D000C4499 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 295C3E1A2E1C640D000C4499 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 295C3E1C2E1C640D000C4499 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 295C3E1E2E1C640D000C4499 /* PlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerView.swift; sourceTree = ""; }; + 295C3E1F2E1C640D000C4499 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 295C3E202E1C640D000C4499 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 295C3DE32E1C5E14000C4499 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 295C3E152E1C6159000C4499 /* THEOplayerConnectorGemius in Frameworks */, + 290B70F32E1C650F0013C58D /* THEOplayerConnectorGemius in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 295C3DDD2E1C5E14000C4499 = { + isa = PBXGroup; + children = ( + 295C3E212E1C640D000C4499 /* GemiusReporter */, + 295C3DE72E1C5E14000C4499 /* Products */, + ); + sourceTree = ""; + }; + 295C3DE72E1C5E14000C4499 /* Products */ = { + isa = PBXGroup; + children = ( + 295C3DE62E1C5E14000C4499 /* GemiusReporter.app */, + ); + name = Products; + sourceTree = ""; + }; + 295C3E212E1C640D000C4499 /* GemiusReporter */ = { + isa = PBXGroup; + children = ( + 295C3E172E1C640D000C4499 /* AppDelegate.swift */, + 295C3E182E1C640D000C4499 /* Assets.xcassets */, + 295C3E192E1C640D000C4499 /* Info.plist */, + 295C3E1B2E1C640D000C4499 /* LaunchScreen.storyboard */, + 295C3E1D2E1C640D000C4499 /* Main.storyboard */, + 295C3E1E2E1C640D000C4499 /* PlayerView.swift */, + 295C3E1F2E1C640D000C4499 /* SceneDelegate.swift */, + 295C3E202E1C640D000C4499 /* ViewController.swift */, + ); + name = GemiusReporter; + path = "/Users/wjoos/Code/customers/nfl/iOS-Connector/Code/Gemius-Examples/SharedCode"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 295C3DE52E1C5E14000C4499 /* GemiusReporter */ = { + isa = PBXNativeTarget; + buildConfigurationList = 295C3DF92E1C5E16000C4499 /* Build configuration list for PBXNativeTarget "GemiusReporter" */; + buildPhases = ( + 295C3DE22E1C5E14000C4499 /* Sources */, + 295C3DE32E1C5E14000C4499 /* Frameworks */, + 295C3DE42E1C5E14000C4499 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GemiusReporter; + packageProductDependencies = ( + 295C3E142E1C6159000C4499 /* THEOplayerConnectorGemius */, + 290B70F22E1C650F0013C58D /* THEOplayerConnectorGemius */, + ); + productName = GemiusReporter; + productReference = 295C3DE62E1C5E14000C4499 /* GemiusReporter.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 295C3DDE2E1C5E14000C4499 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1640; + LastUpgradeCheck = 1640; + TargetAttributes = { + 295C3DE52E1C5E14000C4499 = { + CreatedOnToolsVersion = 16.4; + }; + }; + }; + buildConfigurationList = 295C3DE12E1C5E14000C4499 /* Build configuration list for PBXProject "GemiusReporter" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 295C3DDD2E1C5E14000C4499; + minimizedProjectReferenceProxies = 1; + packageReferences = ( + 290B70F12E1C650F0013C58D /* XCLocalSwiftPackageReference "../../../../iOS-Connector" */, + ); + preferredProjectObjectVersion = 77; + productRefGroup = 295C3DE72E1C5E14000C4499 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 295C3DE52E1C5E14000C4499 /* GemiusReporter */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 295C3DE42E1C5E14000C4499 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 295C3E262E1C640D000C4499 /* LaunchScreen.storyboard in Resources */, + 295C3E272E1C640D000C4499 /* Assets.xcassets in Resources */, + 295C3E292E1C640D000C4499 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 295C3DE22E1C5E14000C4499 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 295C3E222E1C640D000C4499 /* ViewController.swift in Sources */, + 295C3E232E1C640D000C4499 /* PlayerView.swift in Sources */, + 295C3E242E1C640D000C4499 /* SceneDelegate.swift in Sources */, + 295C3E252E1C640D000C4499 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 295C3E1B2E1C640D000C4499 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 295C3E1A2E1C640D000C4499 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; + 295C3E1D2E1C640D000C4499 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 295C3E1C2E1C640D000C4499 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 295C3DFA2E1C5E16000C4499 /* 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 = ""; + 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.gemius.ios.integration.GemiusReporter; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 295C3DFB2E1C5E16000C4499 /* 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 = ""; + 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.gemius.ios.integration.GemiusReporter; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 295C3DFC2E1C5E16000C4499 /* 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; + }; + 295C3DFD2E1C5E16000C4499 /* 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 */ + 295C3DE12E1C5E14000C4499 /* Build configuration list for PBXProject "GemiusReporter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 295C3DFC2E1C5E16000C4499 /* Debug */, + 295C3DFD2E1C5E16000C4499 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 295C3DF92E1C5E16000C4499 /* Build configuration list for PBXNativeTarget "GemiusReporter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 295C3DFA2E1C5E16000C4499 /* Debug */, + 295C3DFB2E1C5E16000C4499 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 290B70F12E1C650F0013C58D /* XCLocalSwiftPackageReference "../../../../iOS-Connector" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = "../../../../iOS-Connector"; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 290B70F22E1C650F0013C58D /* THEOplayerConnectorGemius */ = { + isa = XCSwiftPackageProductDependency; + productName = THEOplayerConnectorGemius; + }; + 295C3E142E1C6159000C4499 /* THEOplayerConnectorGemius */ = { + isa = XCSwiftPackageProductDependency; + productName = THEOplayerConnectorGemius; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 295C3DDE2E1C5E14000C4499 /* Project object */; +} diff --git a/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Code/Gemius-Examples/SharedCode/AppDelegate.swift b/Code/Gemius-Examples/SharedCode/AppDelegate.swift new file mode 100644 index 00000000..61e2fa8f --- /dev/null +++ b/Code/Gemius-Examples/SharedCode/AppDelegate.swift @@ -0,0 +1,36 @@ +// +// AppDelegate.swift +// GemiusReporter +// +// Created by Joosen, Wonne on 07/07/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/Gemius-Examples/SharedCode/Assets.xcassets/AccentColor.colorset/Contents.json b/Code/Gemius-Examples/SharedCode/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/Code/Gemius-Examples/SharedCode/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Code/Gemius-Examples/SharedCode/Assets.xcassets/AppIcon.appiconset/Contents.json b/Code/Gemius-Examples/SharedCode/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..23058801 --- /dev/null +++ b/Code/Gemius-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/Gemius-Examples/SharedCode/Assets.xcassets/Contents.json b/Code/Gemius-Examples/SharedCode/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/Code/Gemius-Examples/SharedCode/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Code/Gemius-Examples/SharedCode/Base.lproj/LaunchScreen.storyboard b/Code/Gemius-Examples/SharedCode/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..865e9329 --- /dev/null +++ b/Code/Gemius-Examples/SharedCode/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Code/Gemius-Examples/SharedCode/Base.lproj/Main.storyboard b/Code/Gemius-Examples/SharedCode/Base.lproj/Main.storyboard new file mode 100644 index 00000000..478dadae --- /dev/null +++ b/Code/Gemius-Examples/SharedCode/Base.lproj/Main.storyboard @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Code/Gemius-Examples/SharedCode/Info.plist b/Code/Gemius-Examples/SharedCode/Info.plist new file mode 100644 index 00000000..dd3c9afd --- /dev/null +++ b/Code/Gemius-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/Gemius-Examples/SharedCode/PlayerView.swift b/Code/Gemius-Examples/SharedCode/PlayerView.swift new file mode 100644 index 00000000..44f6bac7 --- /dev/null +++ b/Code/Gemius-Examples/SharedCode/PlayerView.swift @@ -0,0 +1,32 @@ +// +// PlayerView.swift +// GemiusReporter +// +// Created by Joosen, Wonne on 07/07/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/Gemius-Examples/SharedCode/SceneDelegate.swift b/Code/Gemius-Examples/SharedCode/SceneDelegate.swift new file mode 100644 index 00000000..e2fd6d06 --- /dev/null +++ b/Code/Gemius-Examples/SharedCode/SceneDelegate.swift @@ -0,0 +1,52 @@ +// +// SceneDelegate.swift +// GemiusReporter +// +// Created by Joosen, Wonne on 07/07/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/Gemius-Examples/SharedCode/ViewController.swift b/Code/Gemius-Examples/SharedCode/ViewController.swift new file mode 100644 index 00000000..72df4c2c --- /dev/null +++ b/Code/Gemius-Examples/SharedCode/ViewController.swift @@ -0,0 +1,105 @@ +// +// ViewController.swift +// GemiusReporter +// +// Created by Joosen, Wonne on 07/07/2025. +// + +import UIKit +import THEOplayerSDK +import THEOplayerConnectorGemius +//import GemiusSDK + +#if canImport(THEOplayerGoogleIMAIntegration) +import THEOplayerGoogleIMAIntegration +#endif + +class ViewController: UIViewController { + + + var gemius: GemiusConnector + @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()) + #if canImport(THEOplayerGoogleIMAIntegration) + let imaIntegration = GoogleIMAIntegrationFactory.createIntegration(on: player) + player.addIntegration(imaIntegration) + #endif + self.gemius = GemiusConnector( + configuration: GemiusConfiguration(implementationId: "test123", debug: true), + player: player + ) + 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" + ) + ) + + gemius.update() + } + + @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)" + ) + ) + + gemius.update() + } + + @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/Gemius/README.md b/Code/Gemius/README.md new file mode 100644 index 00000000..c68fc22e --- /dev/null +++ b/Code/Gemius/README.md @@ -0,0 +1,54 @@ +# THEOPlayer 🤝 Gemius + +THEOplayer-Connector-Gemius for iOS provides an integration between the THEOplayerSDK and Gemius. + +For example xcode projects with this connector see [Gemius-Examples](../Gemius-Examples/README.md). + + +## Installation + +### [Swift Package Manager](https://swift.org/package-manager/) + +1. In Xcode, install the Gemius libraries 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. + +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-Gemius 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 Gemius connector pods that you want to use in your app: `pod 'THEOplayer-Connector-Gemius'` +3. Install the pods using `pod install` , then open your `.xcworkspace` file to see the project in Xcode. + +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 `THEOplayerConnectorGemius` module + +```swift +import THEOplayerConnectorGemius +``` + +Create a `GemiusConnector` that uses this `configuration` and your `THEOplayer` instance: + +```swift +let connector = GemiusConnector( + configuration: configuration, + player: yourTHEOplayer +) +``` + + diff --git a/Code/Gemius/Source/GemiusConnector.swift b/Code/Gemius/Source/GemiusConnector.swift new file mode 100644 index 00000000..ef4c26af --- /dev/null +++ b/Code/Gemius/Source/GemiusConnector.swift @@ -0,0 +1,31 @@ +import THEOplayerSDK +#if canImport(GemiusSDK) +import GemiusSDK +#endif + +public struct GemiusConfiguration { + let implementationId: String + let debug: Bool + + public init(implementationId: String, debug: Bool) { + self.implementationId = implementationId + self.debug = debug + } +} + +public struct GemiusConnector { +// private let adapter: GemiusAdapter + private let player: THEOplayer + + + public init(configuration: GemiusConfiguration, player: THEOplayer) { + self.player = player +// self.adapter = GemiusAdapter(configuration: configuration, player: player, metadata: metadata) + } + + public func update() { + // TODO +// self.adapter.update() + } + +} diff --git a/Package.swift b/Package.swift index 94c685a3..14bb98aa 100644 --- a/Package.swift +++ b/Package.swift @@ -12,6 +12,8 @@ let package = Package( .library(name: "THEOplayerConnectorConvivaVerizonMedia", targets: ["THEOplayerConnectorConvivaVerizonMedia"]), .library(name: "THEOplayerConnectorNielsen", targets: ["THEOplayerConnectorNielsen"]), + + .library(name: "THEOplayerConnectorGemius", targets: ["THEOplayerConnectorGemius"]), .library(name: "THEOplayerConnectorUtilities", targets: ["THEOplayerConnectorUtilities"]), @@ -60,6 +62,15 @@ let package = Package( ], path: "Code/Nielsen/Source" ), + + // GEMIUS \\ + .target( + name: "THEOplayerConnectorGemius", + dependencies: [ + "THEOplayerSDK", + ], + path: "Code/Gemius/Source" + ), // UTILITY \\ .target( diff --git a/THEOplayer-Connector-Gemius.podspec b/THEOplayer-Connector-Gemius.podspec new file mode 100644 index 00000000..c591465f --- /dev/null +++ b/THEOplayer-Connector-Gemius.podspec @@ -0,0 +1,24 @@ +require_relative './THEOplayer-Connector-Version' + +Pod::Spec.new do |s| + s.name = 'THEOplayer-Connector-Gemius' + s.module_name = 'THEOplayerConnectorGemius' + s.version = theoplayer_connector_version + s.summary = 'Integration between the THEOplayerSDK and GemiusSDK' + + s.description = 'This pod gives you access to classes that let you report playback events from a THEOplayer instance to Gemius' + + s.homepage = 'https://github.com/THEOplayer/iOS-Connector' + s.license = { :type => 'MIT', :file => 'LICENSE' } + s.author = "THEO technologies" + 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/Gemius/Source/**/*' + + s.static_framework = true + s.swift_versions = ['5.3', '5.4', '5.5', '5.6', '5.7'] + s.dependency 'GemiusSDK', '2.0.6' + s.dependency 'THEOplayerSDK-core', "~> 9" +end From 7ad056e41c8f7e75314c97856d8853388efecea0 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Wed, 9 Jul 2025 00:19:12 +0200 Subject: [PATCH 02/31] initial skeleton --- .../SharedCode/ViewController.swift | 11 +- Code/Gemius/Source/GemiusAdapter.swift | 251 ++++++++++++++++++ Code/Gemius/Source/GemiusConnector.swift | 19 +- 3 files changed, 269 insertions(+), 12 deletions(-) create mode 100644 Code/Gemius/Source/GemiusAdapter.swift diff --git a/Code/Gemius-Examples/SharedCode/ViewController.swift b/Code/Gemius-Examples/SharedCode/ViewController.swift index 72df4c2c..81f05b6d 100644 --- a/Code/Gemius-Examples/SharedCode/ViewController.swift +++ b/Code/Gemius-Examples/SharedCode/ViewController.swift @@ -8,7 +8,7 @@ import UIKit import THEOplayerSDK import THEOplayerConnectorGemius -//import GemiusSDK +import GemiusSDK #if canImport(THEOplayerGoogleIMAIntegration) import THEOplayerGoogleIMAIntegration @@ -33,7 +33,12 @@ class ViewController: UIViewController { player.addIntegration(imaIntegration) #endif self.gemius = GemiusConnector( - configuration: GemiusConfiguration(implementationId: "test123", debug: true), + configuration: GemiusConfiguration( + playerId: "test", + hitCollectorHost: "https://prefix.gemius.pl", + gemiusId: "abcde", + debug: true + ), player: player ) super.init(coder: coder) @@ -65,7 +70,6 @@ class ViewController: UIViewController { ) ) - gemius.update() } @IBAction func starWarsButtonClicked(_ sender: UIButton) { @@ -81,7 +85,6 @@ class ViewController: UIViewController { ) ) - gemius.update() } @IBAction func togglePlayPause(_ sender: UIButton) { diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift new file mode 100644 index 00000000..02546446 --- /dev/null +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -0,0 +1,251 @@ +import THEOplayerSDK +#if canImport(GemiusSDK) +import GemiusSDK +#endif + +let LOG_PLAYER_EVENTS = false +let LOG_GEMIUS_EVENTS = false + +public class GemiusAdapter { + private let player: THEOplayer + private let configuration: GemiusConfiguration + private var gsmPlayer: GSMPlayer + + private var programId: String? + private var programData: GemiusSDK.GSMProgramData? + + 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: GemiusConfiguration, player: THEOplayer) { + self.player = player + self.configuration = configuration + let playerData = GemiusSDK.GSMPlayerData() + playerData.resolution = "\(player.frame.width)x\(player.frame.height)" + if (player.muted) { + playerData.volume = -1 + } else { + playerData.volume = NSNumber(value: player.volume * 100) + } + self.gsmPlayer = GemiusSDK.GSMPlayer(id: configuration.playerId, withHost: configuration.hitCollectorHost, withGemiusID: configuration.gemiusId, with: playerData) + + addEventListeners() + } + + public func update(programId: String, programData: GemiusSDK.GSMProgramData) { + self.programId = programId + self.programData = programData + } + + + private func addEventListeners() { + self.playEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAY, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[GemiusConnector] 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: GemiusAdapter = self else { return } + if let code = event.errorObject?.code, let cause = event.errorObject?.cause, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[GemiusConnector] 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: GemiusAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[GemiusConnector] Player Event: \(event.type) : source = \(event.source.debugDescription)") + } + if let programData = welf.programData, let programId = welf.programId { + welf.gsmPlayer.newProgram(programId, with: programData) + } + + if let playingEventListener: THEOplayerSDK.EventListener = welf.playingEventListener { + welf.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) + } + 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: GemiusAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") + } + }) + self.durationChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.DURATION_CHANGE, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if let duration = event.duration, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[GemiusConnector] Player Event: \(event.type) : duration = \(duration)") + } + }) + self.timeUpdateEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.TIME_UPDATE, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") + } + }) + self.volumeChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.VOLUME_CHANGE, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[GemiusConnector] Player Event: \(event.type) : volume = \(event.volume)") + } + }) + self.rateChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.RATE_CHANGE, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[GemiusConnector] Player Event: \(event.type) : playbackRate = \(event.playbackRate)") + } + }) + self.presentationModeChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PRESENTATION_MODE_CHANGE, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[GemiusConnector] Player Event: \(event.type) : presentationMode = \(event.presentationMode._rawValue)") + } + }) + + + if (hasAdIntegration()) { + self.adBreakBeginListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BREAK_BEGIN, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if let offset = event.ad?.timeOffset, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[GemiusConnector] Player Event: \(event.type) : offset = \(offset)") + } + }) + self.adBeginListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BEGIN, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[GemiusConnector] Player Event: \(event.type) : id = \(id)") + } + guard let ad = event.ad else { return } + }) + self.adFirstQuartileListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_FIRST_QUARTILE, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[GemiusConnector] Player Event: \(event.type) : id = \(id)") + } + }) + self.adMidpointListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_MIDPOINT, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[GemiusConnector] Player Event: \(event.type) : id = \(id)") + } + }) + self.adThirdQuartileListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_THIRD_QUARTILE, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if let id = event.ad?.id, welf.configuration.debug { + print("[GemiusConnector] Player Event: \(event.type) : id = \(id)") + } + }) + self.adCompletedListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_END, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[GemiusConnector] Player Event: \(event.type) : id = \(id)") + } + }) + self.adBreakEndedListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BREAK_END, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if let offset = event.ad?.timeOffset, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[GemiusConnector] 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 handlePlaying(event: PlayingEvent) { + if (self.configuration.debug && LOG_PLAYER_EVENTS) { + print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") + } + if let playingEventListener: THEOplayerSDK.EventListener = self.playingEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) + } + } + + 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("[GemiusConnector] no supported ad integration was found") + return false + } + } + return hasAdIntegration + } +} diff --git a/Code/Gemius/Source/GemiusConnector.swift b/Code/Gemius/Source/GemiusConnector.swift index ef4c26af..5aa11bff 100644 --- a/Code/Gemius/Source/GemiusConnector.swift +++ b/Code/Gemius/Source/GemiusConnector.swift @@ -4,28 +4,31 @@ import GemiusSDK #endif public struct GemiusConfiguration { - let implementationId: String + let playerId: String + let hitCollectorHost: String + let gemiusId: String let debug: Bool - public init(implementationId: String, debug: Bool) { - self.implementationId = implementationId + public init(playerId: String, hitCollectorHost: String, gemiusId: String, debug: Bool) { + self.playerId = playerId + self.hitCollectorHost = hitCollectorHost + self.gemiusId = gemiusId self.debug = debug } } public struct GemiusConnector { -// private let adapter: GemiusAdapter + private let adapter: GemiusAdapter private let player: THEOplayer public init(configuration: GemiusConfiguration, player: THEOplayer) { self.player = player -// self.adapter = GemiusAdapter(configuration: configuration, player: player, metadata: metadata) + self.adapter = GemiusAdapter(configuration: configuration, player: player) } - public func update() { - // TODO -// self.adapter.update() + public func update(programId: String, programData: GemiusSDK.GSMProgramData) { + self.adapter.update(programId: programId, programData: programData) } } From 1a82d106be14fc479642402fd5abc5e035f7e141 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Fri, 11 Jul 2025 10:08:09 +0200 Subject: [PATCH 03/31] pass adprocessor --- Code/Gemius/Source/GemiusConnector.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Code/Gemius/Source/GemiusConnector.swift b/Code/Gemius/Source/GemiusConnector.swift index 5aa11bff..53251b53 100644 --- a/Code/Gemius/Source/GemiusConnector.swift +++ b/Code/Gemius/Source/GemiusConnector.swift @@ -8,12 +8,14 @@ public struct GemiusConfiguration { let hitCollectorHost: String let gemiusId: String let debug: Bool + let adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? = nil - public init(playerId: String, hitCollectorHost: String, gemiusId: String, debug: Bool) { + public init(playerId: String, hitCollectorHost: String, gemiusId: String, debug: Bool, adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? = nil) { self.playerId = playerId self.hitCollectorHost = hitCollectorHost self.gemiusId = gemiusId self.debug = debug + self.adProcessor = adProcessor } } @@ -24,7 +26,7 @@ public struct GemiusConnector { public init(configuration: GemiusConfiguration, player: THEOplayer) { self.player = player - self.adapter = GemiusAdapter(configuration: configuration, player: player) + self.adapter = GemiusAdapter(configuration: configuration, player: player, adProcessor: configuration.adProcessor) } public func update(programId: String, programData: GemiusSDK.GSMProgramData) { From 96b8824d529bef2697c2190f63e2d08311a8b470 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Fri, 11 Jul 2025 10:08:54 +0200 Subject: [PATCH 04/31] use ad processor in adapter --- Code/Gemius/Source/GemiusAdapter.swift | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index 02546446..31c6ee0f 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -10,6 +10,7 @@ public class GemiusAdapter { private let player: THEOplayer private let configuration: GemiusConfiguration private var gsmPlayer: GSMPlayer + private let adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? private var programId: String? private var programData: GemiusSDK.GSMProgramData? @@ -34,9 +35,10 @@ public class GemiusAdapter { private var adBreakEndedListener: EventListener? - public init(configuration: GemiusConfiguration, player: THEOplayer) { + public init(configuration: GemiusConfiguration, player: THEOplayer, adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? = nil) { self.player = player self.configuration = configuration + self.adProcessor = adProcessor let playerData = GemiusSDK.GSMPlayerData() playerData.resolution = "\(player.frame.width)x\(player.frame.height)" if (player.muted) { @@ -248,4 +250,25 @@ public class GemiusAdapter { } return hasAdIntegration } + + private func buildAdData(ad: THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData { + if let adProcessor = self.adProcessor { + return adProcessor(ad) + } + let adData = GemiusSDK.GSMAdData() + if [AdIntegrationKind.google_ima, AdIntegrationKind.google_dai].contains(ad.integration), + let imaAd = ad as? GoogleImaAd { + adData.name = imaAd.creativeId + } + + adData.adFormat = .video + adData.adType = .AD_BREAK + if let duration = ad.duration { + adData.duration = NSNumber(value: duration) + } + adData.name = ad.id + adData.quality = "\(ad.width)x\(ad.height)" + adData.resolution = "\(player.frame.width)x\(player.frame.height)" + return adData + } } From 523d73575052cded3d8634e40dd8e7b2a8d96338 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Fri, 11 Jul 2025 10:09:18 +0200 Subject: [PATCH 05/31] ad event reporting --- Code/Gemius/Source/GemiusAdapter.swift | 59 ++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index 31c6ee0f..c2fa26cd 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -15,10 +15,14 @@ public class GemiusAdapter { private var programId: String? private var programData: GemiusSDK.GSMProgramData? + private var partCount = 1 + private var adCount = 1 + private var currentAd: Ad? = nil + private var playEventListener: EventListener? private var playingEventListener: EventListener? private var errorEventListener: EventListener? - private var sourceChangeEventListener: EventListener? + private var sourceChangeEventListener: EventListener? //DONE private var endedEventListener: EventListener? private var durationChangeEventListener: EventListener? private var timeUpdateEventListener: EventListener? @@ -27,7 +31,9 @@ public class GemiusAdapter { private var presentationModeChangeEventListener: EventListener? private var adBreakBeginListener: EventListener? - private var adBeginListener: EventListener? + private var adBeginListener: EventListener? // DONE + private var adEndListener: EventListener? // DONE + private var adSkipListener: EventListener? // DONE private var adFirstQuartileListener: EventListener? private var adMidpointListener: EventListener? private var adThirdQuartileListener: EventListener? @@ -76,8 +82,12 @@ public class GemiusAdapter { if (welf.configuration.debug && LOG_PLAYER_EVENTS) { print("[GemiusConnector] Player Event: \(event.type) : source = \(event.source.debugDescription)") } + welf.partCount = 1 + welf.currentAd = nil if let programData = welf.programData, let programId = welf.programId { welf.gsmPlayer.newProgram(programId, with: programData) + } else { + print("[GemiusConnector] No program parameters were provided") } if let playingEventListener: THEOplayerSDK.EventListener = welf.playingEventListener { @@ -135,7 +145,33 @@ public class GemiusAdapter { if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { print("[GemiusConnector] Player Event: \(event.type) : id = \(id)") } - guard let ad = event.ad else { return } + guard let ad = event.ad, let id = ad.id else { return } + welf.currentAd = ad + let adData = welf.buildAdData(ad: ad) + welf.gsmPlayer.newAd(id, with: adData) + }) + self.adEndListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_END, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[GemiusConnector] Player Event: \(event.type) : id = \(id)") + } + guard let ad = event.ad, let id = ad.id else { return } + welf.reportBasicEvent(event: .COMPLETE) + welf.reportBasicEvent(event: .CLOSE) + welf.adCount += 1 + welf.currentAd = nil + if let playingEventListener: THEOplayerSDK.EventListener = welf.playingEventListener { + welf.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) + } + welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handlePlaying(event: event) }) + + }) + self.adSkipListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_SKIP, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[GemiusConnector] Player Event: \(event.type) : id = \(id)") + } + welf.reportBasicEvent(event: .SKIP) }) self.adFirstQuartileListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_FIRST_QUARTILE, listener: { [weak self] event in guard let welf: GemiusAdapter = self else { return } @@ -210,6 +246,12 @@ public class GemiusAdapter { if let adBeginListener: THEOplayerSDK.EventListener = self.adBeginListener { self.player.removeEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BEGIN, listener: adBeginListener) } + if let adEndListener: THEOplayerSDK.EventListener = self.adEndListener { + self.player.removeEventListener(type: THEOplayerSDK.AdsEventTypes.AD_END, listener: adEndListener) + } + if let adSkipListener: THEOplayerSDK.EventListener = self.adSkipListener { + self.player.removeEventListener(type: THEOplayerSDK.AdsEventTypes.AD_SKIP, listener: adSkipListener) + } if let adFirstQuartileListener: THEOplayerSDK.EventListener = self.adFirstQuartileListener { self.player.removeEventListener(type: THEOplayerSDK.AdsEventTypes.AD_FIRST_QUARTILE, listener: adFirstQuartileListener) } @@ -271,4 +313,15 @@ public class GemiusAdapter { adData.resolution = "\(player.frame.width)x\(player.frame.height)" return adData } + + private func reportBasicEvent(event: GemiusSDK.GSMEventType) { + guard let programId = self.programId else { return } + if let currentAd = self.currentAd { + self.gsmPlayer.adEvent(event, forProgram: programId, forAd: currentAd.id, atOffset: NSNumber(value: currentAd.adBreak.timeOffset), with: nil) + + } else { + self.gsmPlayer.program(event, forProgram: programId, atOffset: NSNumber(value: player.currentTime), with: nil) + + } + } } From 42cacb152c1f1970cf8faa06e9e483333710f78b Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Fri, 11 Jul 2025 10:13:08 +0200 Subject: [PATCH 06/31] don't use ad progress listeners --- Code/Gemius/Source/GemiusAdapter.swift | 40 -------------------------- 1 file changed, 40 deletions(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index c2fa26cd..8cf5ede1 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -34,10 +34,6 @@ public class GemiusAdapter { private var adBeginListener: EventListener? // DONE private var adEndListener: EventListener? // DONE private var adSkipListener: EventListener? // DONE - private var adFirstQuartileListener: EventListener? - private var adMidpointListener: EventListener? - private var adThirdQuartileListener: EventListener? - private var adCompletedListener: EventListener? private var adBreakEndedListener: EventListener? @@ -173,30 +169,6 @@ public class GemiusAdapter { } welf.reportBasicEvent(event: .SKIP) }) - self.adFirstQuartileListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_FIRST_QUARTILE, listener: { [weak self] event in - guard let welf: GemiusAdapter = self else { return } - if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { - print("[GemiusConnector] Player Event: \(event.type) : id = \(id)") - } - }) - self.adMidpointListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_MIDPOINT, listener: { [weak self] event in - guard let welf: GemiusAdapter = self else { return } - if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { - print("[GemiusConnector] Player Event: \(event.type) : id = \(id)") - } - }) - self.adThirdQuartileListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_THIRD_QUARTILE, listener: { [weak self] event in - guard let welf: GemiusAdapter = self else { return } - if let id = event.ad?.id, welf.configuration.debug { - print("[GemiusConnector] Player Event: \(event.type) : id = \(id)") - } - }) - self.adCompletedListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_END, listener: { [weak self] event in - guard let welf: GemiusAdapter = self else { return } - if let id = event.ad?.id, welf.configuration.debug && LOG_PLAYER_EVENTS { - print("[GemiusConnector] Player Event: \(event.type) : id = \(id)") - } - }) self.adBreakEndedListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BREAK_END, listener: { [weak self] event in guard let welf: GemiusAdapter = self else { return } if let offset = event.ad?.timeOffset, welf.configuration.debug && LOG_PLAYER_EVENTS { @@ -252,18 +224,6 @@ public class GemiusAdapter { if let adSkipListener: THEOplayerSDK.EventListener = self.adSkipListener { self.player.removeEventListener(type: THEOplayerSDK.AdsEventTypes.AD_SKIP, listener: adSkipListener) } - 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) } From 732eb0bd001a8132834db99692906c3652226d82 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Fri, 11 Jul 2025 10:50:12 +0200 Subject: [PATCH 07/31] adbreak related event handling --- Code/Gemius/Source/GemiusAdapter.swift | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index 8cf5ede1..a2f8b840 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -30,11 +30,11 @@ public class GemiusAdapter { private var rateChangeEventListener: EventListener? private var presentationModeChangeEventListener: EventListener? - private var adBreakBeginListener: EventListener? + private var adBreakBeginListener: EventListener? // DONE private var adBeginListener: EventListener? // DONE private var adEndListener: EventListener? // DONE private var adSkipListener: EventListener? // DONE - private var adBreakEndedListener: EventListener? + private var adBreakEndedListener: EventListener? // DONE public init(configuration: GemiusConfiguration, player: THEOplayer, adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? = nil) { @@ -135,6 +135,11 @@ public class GemiusAdapter { if let offset = event.ad?.timeOffset, welf.configuration.debug && LOG_PLAYER_EVENTS { print("[GemiusConnector] Player Event: \(event.type) : offset = \(offset)") } + welf.reportBasicEvent(event: .BREAK) + if let playingEventListener: THEOplayerSDK.EventListener = welf.playingEventListener { + welf.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) + } + welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handlePlaying(event: event) }) }) self.adBeginListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BEGIN, listener: { [weak self] event in guard let welf: GemiusAdapter = self else { return } @@ -170,10 +175,20 @@ public class GemiusAdapter { welf.reportBasicEvent(event: .SKIP) }) self.adBreakEndedListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BREAK_END, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } - if let offset = event.ad?.timeOffset, welf.configuration.debug && LOG_PLAYER_EVENTS { + welf.adCount = 1 + guard let offset = event.ad?.timeOffset else { return } + if welf.configuration.debug && LOG_PLAYER_EVENTS { print("[GemiusConnector] Player Event: \(event.type) : offset = \(offset)") } + if (offset > 0) { + welf.partCount += 1 + } + welf.gsmPlayer.newProgram(welf.programId, with: welf.programData) + if let playingEventListener: THEOplayerSDK.EventListener = welf.playingEventListener { + welf.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) + } if (event.ad?.timeOffset == 0) { welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handlePlaying(event: event) }) } From 147d6aaf86c45f7838bc36d2c744ae78ac593db9 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Fri, 11 Jul 2025 11:03:51 +0200 Subject: [PATCH 08/31] remove some listeners --- Code/Gemius/Source/GemiusAdapter.swift | 48 ++++---------------------- 1 file changed, 6 insertions(+), 42 deletions(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index a2f8b840..0c5fe2ea 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -19,16 +19,16 @@ public class GemiusAdapter { private var adCount = 1 private var currentAd: Ad? = nil - private var playEventListener: EventListener? + private var sourceChangeEventListener: EventListener? //DONE private var playingEventListener: EventListener? + private var playEventListener: EventListener? + private var pauseEventListener: EventListener? + private var waitingEventListener: EventListener? + private var seekingEventListener: EventListener? private var errorEventListener: EventListener? - private var sourceChangeEventListener: EventListener? //DONE 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? // DONE private var adBeginListener: EventListener? // DONE @@ -97,36 +97,12 @@ public class GemiusAdapter { print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") } }) - self.durationChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.DURATION_CHANGE, listener: { [weak self] event in - guard let welf: GemiusAdapter = self else { return } - if let duration = event.duration, welf.configuration.debug && LOG_PLAYER_EVENTS { - print("[GemiusConnector] Player Event: \(event.type) : duration = \(duration)") - } - }) - self.timeUpdateEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.TIME_UPDATE, listener: { [weak self] event in - guard let welf: GemiusAdapter = self else { return } - if (welf.configuration.debug && LOG_PLAYER_EVENTS) { - print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") - } - }) self.volumeChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.VOLUME_CHANGE, listener: { [weak self] event in guard let welf: GemiusAdapter = self else { return } if (welf.configuration.debug && LOG_PLAYER_EVENTS) { print("[GemiusConnector] Player Event: \(event.type) : volume = \(event.volume)") } }) - self.rateChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.RATE_CHANGE, listener: { [weak self] event in - guard let welf: GemiusAdapter = self else { return } - if (welf.configuration.debug && LOG_PLAYER_EVENTS) { - print("[GemiusConnector] Player Event: \(event.type) : playbackRate = \(event.playbackRate)") - } - }) - self.presentationModeChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PRESENTATION_MODE_CHANGE, listener: { [weak self] event in - guard let welf: GemiusAdapter = self else { return } - if (welf.configuration.debug && LOG_PLAYER_EVENTS) { - print("[GemiusConnector] Player Event: \(event.type) : presentationMode = \(event.presentationMode._rawValue)") - } - }) if (hasAdIntegration()) { @@ -212,21 +188,9 @@ public class GemiusAdapter { 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) } From a10e3b2907ea352f2a6343c765adb6a7c02978b1 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Fri, 11 Jul 2025 11:38:12 +0200 Subject: [PATCH 09/31] add necessary listeners --- Code/Gemius/Source/GemiusAdapter.swift | 63 ++++++++++++++++++-------- 1 file changed, 45 insertions(+), 18 deletions(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index 0c5fe2ea..4ae832bb 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -60,19 +60,6 @@ public class GemiusAdapter { private func addEventListeners() { - self.playEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAY, listener: { [weak self] event in - guard let welf: GemiusAdapter = self else { return } - if (welf.configuration.debug && LOG_PLAYER_EVENTS) { - print("[GemiusConnector] 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: GemiusAdapter = self else { return } - if let code = event.errorObject?.code, let cause = event.errorObject?.cause, welf.configuration.debug && LOG_PLAYER_EVENTS { - print("[GemiusConnector] 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: GemiusAdapter = self else { return } if (welf.configuration.debug && LOG_PLAYER_EVENTS) { @@ -91,6 +78,37 @@ public class GemiusAdapter { } welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handlePlaying(event: event) }) }) + self.playingEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handlePlaying(event: event) }) + self.playEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAY, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") + } + }) + self.pauseEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PAUSE, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") + } + }) + self.waitingEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.WAITING, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") + } + }) + self.seekingEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.SEEKING, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if (welf.configuration.debug && LOG_PLAYER_EVENTS) { + print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") + } + }) + self.errorEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.ERROR, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + if let code = event.errorObject?.code, let cause = event.errorObject?.cause, welf.configuration.debug && LOG_PLAYER_EVENTS { + print("[GemiusConnector] Player Event: \(event.type) : code = \(code) ; cause = \(cause)") + } + }) self.endedEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.ENDED, listener: { [weak self] event in guard let welf: GemiusAdapter = self else { return } if (welf.configuration.debug && LOG_PLAYER_EVENTS) { @@ -173,18 +191,27 @@ public class GemiusAdapter { } private func removeEventListeners() { - if let playEventListener: THEOplayerSDK.EventListener = self.playEventListener { - self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.TIME_UPDATE, listener: playEventListener) + if let sourceChangeEventListener: THEOplayerSDK.EventListener = self.sourceChangeEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.SOURCE_CHANGE, listener: sourceChangeEventListener) } if let playingEventListener: THEOplayerSDK.EventListener = self.playingEventListener { self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) } + if let playEventListener: THEOplayerSDK.EventListener = self.playEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAY, listener: playEventListener) + } + if let pauseEventListener: THEOplayerSDK.EventListener = self.pauseEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PAUSE, listener: pauseEventListener) + } + if let waitingEventListener: THEOplayerSDK.EventListener = self.waitingEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.WAITING, listener: waitingEventListener) + } + if let seekingEventListener: THEOplayerSDK.EventListener = self.seekingEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.SEEKING, listener: seekingEventListener) + } 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) } From 039cc942586ad9c46b437bad2e5a51b859a87618 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Fri, 11 Jul 2025 11:38:37 +0200 Subject: [PATCH 10/31] rename handler --- Code/Gemius/Source/GemiusAdapter.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index 4ae832bb..dba1c9ec 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -76,9 +76,9 @@ public class GemiusAdapter { if let playingEventListener: THEOplayerSDK.EventListener = welf.playingEventListener { welf.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) } - welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handlePlaying(event: event) }) + welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handleFirstPlaying(event: event) }) }) - self.playingEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handlePlaying(event: event) }) + self.playingEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handleFirstPlaying(event: event) }) self.playEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAY, listener: { [weak self] event in guard let welf: GemiusAdapter = self else { return } if (welf.configuration.debug && LOG_PLAYER_EVENTS) { @@ -133,7 +133,7 @@ public class GemiusAdapter { if let playingEventListener: THEOplayerSDK.EventListener = welf.playingEventListener { welf.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) } - welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handlePlaying(event: event) }) + welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handleFirstPlaying(event: event) }) }) self.adBeginListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BEGIN, listener: { [weak self] event in guard let welf: GemiusAdapter = self else { return } @@ -158,7 +158,7 @@ public class GemiusAdapter { if let playingEventListener: THEOplayerSDK.EventListener = welf.playingEventListener { welf.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) } - welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handlePlaying(event: event) }) + welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handleFirstPlaying(event: event) }) }) self.adSkipListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_SKIP, listener: { [weak self] event in @@ -184,7 +184,7 @@ public class GemiusAdapter { welf.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) } if (event.ad?.timeOffset == 0) { - welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handlePlaying(event: event) }) + welf.playingEventListener = welf.player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: { [weak self] event in self?.handleFirstPlaying(event: event) }) } }) } @@ -235,7 +235,7 @@ public class GemiusAdapter { } } - private func handlePlaying(event: PlayingEvent) { + private func handleFirstPlaying(event: PlayingEvent) { if (self.configuration.debug && LOG_PLAYER_EVENTS) { print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") } From 54009047aba25e570455c7a69e672b5674a10514 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Fri, 11 Jul 2025 12:04:39 +0200 Subject: [PATCH 11/31] handle playing --- Code/Gemius/Source/GemiusAdapter.swift | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index dba1c9ec..59342e40 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -239,6 +239,27 @@ public class GemiusAdapter { if (self.configuration.debug && LOG_PLAYER_EVENTS) { print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") } + let computedVolume = player.muted ? -1 : Int(player.volume * 100) + if let currentAd = self.currentAd, let id = currentAd.id { + let adBreak = currentAd.adBreak + let offset = adBreak.timeOffset + let adEventData = GSMEventAdData() + adEventData.adDuration = NSNumber(value: currentAd.duration ?? 0) + adEventData.autoPlay = self.player.autoplay ? 1 : 0 + adEventData.adPosition = NSNumber(value: self.adCount) + adEventData.breakSize = NSNumber(value: adBreak.ads.count) + adEventData.volume = NSNumber(value: computedVolume) + self.gsmPlayer.adEvent(.PLAY, forProgram: self.programId, forAd: id, atOffset: NSNumber(value: offset), with: adEventData) + } else { + if (hasPrerollScheduled()) { return } + let programEventData = GSMEventProgramData() + programEventData.autoPlay = self.player.autoplay ? 1 : 0 + programEventData.volume = NSNumber(value: computedVolume) + programEventData.partID = NSNumber(value: self.partCount) + programEventData.programDuration = NSNumber(value: self.player.duration ?? 0) + self.gsmPlayer.program(.PLAY, forProgram: self.programId, atOffset: NSNumber(value: self.player.currentTime), with: programEventData) + } + if let playingEventListener: THEOplayerSDK.EventListener = self.playingEventListener { self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) } @@ -290,4 +311,8 @@ public class GemiusAdapter { } } + + private func hasPrerollScheduled() -> Bool { + player.ads.scheduledAdBreaks.contains(where: {adBreak in adBreak.timeOffset == 0}) + } } From 1a58619681000da7ad4132fc719e05e80ce6471b Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Fri, 11 Jul 2025 12:07:56 +0200 Subject: [PATCH 12/31] handle play --- Code/Gemius/Source/GemiusAdapter.swift | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index 59342e40..45379250 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -20,7 +20,7 @@ public class GemiusAdapter { private var currentAd: Ad? = nil private var sourceChangeEventListener: EventListener? //DONE - private var playingEventListener: EventListener? + private var playingEventListener: EventListener? // DONE private var playEventListener: EventListener? private var pauseEventListener: EventListener? private var waitingEventListener: EventListener? @@ -84,6 +84,26 @@ public class GemiusAdapter { if (welf.configuration.debug && LOG_PLAYER_EVENTS) { print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") } + let computedVolume = welf.player.muted ? -1 : Int(welf.player.volume * 100) + if let currentAd = welf.currentAd, let id = currentAd.id { + let adBreak = currentAd.adBreak + let offset = adBreak.timeOffset + let adEventData = GSMEventAdData() + adEventData.adDuration = NSNumber(value: currentAd.duration ?? 0) + adEventData.autoPlay = welf.player.autoplay ? 1 : 0 + adEventData.adPosition = NSNumber(value: welf.adCount) + adEventData.breakSize = NSNumber(value: adBreak.ads.count) + adEventData.volume = NSNumber(value: computedVolume) + welf.gsmPlayer.adEvent(.PLAY, forProgram: welf.programId, forAd: id, atOffset: NSNumber(value: offset), with: adEventData) + } else { + if (welf.hasPrerollScheduled()) { return } + let programEventData = GSMEventProgramData() + programEventData.autoPlay = welf.player.autoplay ? 1 : 0 + programEventData.volume = NSNumber(value: computedVolume) + programEventData.partID = NSNumber(value: welf.partCount) + programEventData.programDuration = NSNumber(value: welf.player.duration ?? 0) + welf.gsmPlayer.program(.PLAY, forProgram: welf.programId, atOffset: NSNumber(value: welf.player.currentTime), with: programEventData) + } }) self.pauseEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.PAUSE, listener: { [weak self] event in guard let welf: GemiusAdapter = self else { return } From ec6aec4cf5bff932285105613e6530a6f9b60627 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 09:31:31 +0200 Subject: [PATCH 13/31] handle pause events --- Code/Gemius/Source/GemiusAdapter.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index 45379250..05fd62e4 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -21,8 +21,8 @@ public class GemiusAdapter { private var sourceChangeEventListener: EventListener? //DONE private var playingEventListener: EventListener? // DONE - private var playEventListener: EventListener? - private var pauseEventListener: EventListener? + private var playEventListener: EventListener? // DONE + private var pauseEventListener: EventListener? // DONE private var waitingEventListener: EventListener? private var seekingEventListener: EventListener? private var errorEventListener: EventListener? @@ -110,6 +110,7 @@ public class GemiusAdapter { if (welf.configuration.debug && LOG_PLAYER_EVENTS) { print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") } + welf.reportBasicEvent(event: .PAUSE) }) self.waitingEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.WAITING, listener: { [weak self] event in guard let welf: GemiusAdapter = self else { return } From e8b4dca7f174c75d3849b87a77f22ecc40cf69e1 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 09:32:21 +0200 Subject: [PATCH 14/31] handle waiting events --- Code/Gemius/Source/GemiusAdapter.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index 05fd62e4..f027439a 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -23,7 +23,7 @@ public class GemiusAdapter { private var playingEventListener: EventListener? // DONE private var playEventListener: EventListener? // DONE private var pauseEventListener: EventListener? // DONE - private var waitingEventListener: EventListener? + private var waitingEventListener: EventListener? // DONE private var seekingEventListener: EventListener? private var errorEventListener: EventListener? private var endedEventListener: EventListener? @@ -117,6 +117,7 @@ public class GemiusAdapter { if (welf.configuration.debug && LOG_PLAYER_EVENTS) { print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") } + welf.reportBasicEvent(event: .BUFFER) }) self.seekingEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.SEEKING, listener: { [weak self] event in guard let welf: GemiusAdapter = self else { return } From e5333780db7b67e8c91ed5a028fc5dbbca1558c1 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 09:36:12 +0200 Subject: [PATCH 15/31] handle seeking events --- Code/Gemius/Source/GemiusAdapter.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index f027439a..2893d124 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -24,7 +24,7 @@ public class GemiusAdapter { private var playEventListener: EventListener? // DONE private var pauseEventListener: EventListener? // DONE private var waitingEventListener: EventListener? // DONE - private var seekingEventListener: EventListener? + private var seekingEventListener: EventListener? // DONE private var errorEventListener: EventListener? private var endedEventListener: EventListener? private var volumeChangeEventListener: EventListener? @@ -124,6 +124,7 @@ public class GemiusAdapter { if (welf.configuration.debug && LOG_PLAYER_EVENTS) { print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") } + welf.reportBasicEvent(event: .SEEK) }) self.errorEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.ERROR, listener: { [weak self] event in guard let welf: GemiusAdapter = self else { return } From 394f3e5c24f62b3f50a86b87d6c723bf97b2f22d Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 09:38:55 +0200 Subject: [PATCH 16/31] handle error and ended events --- Code/Gemius/Source/GemiusAdapter.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index 2893d124..a086cbbb 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -25,8 +25,8 @@ public class GemiusAdapter { private var pauseEventListener: EventListener? // DONE private var waitingEventListener: EventListener? // DONE private var seekingEventListener: EventListener? // DONE - private var errorEventListener: EventListener? - private var endedEventListener: EventListener? + private var errorEventListener: EventListener? // DONE + private var endedEventListener: EventListener? // DONE private var volumeChangeEventListener: EventListener? @@ -131,12 +131,14 @@ public class GemiusAdapter { if let code = event.errorObject?.code, let cause = event.errorObject?.cause, welf.configuration.debug && LOG_PLAYER_EVENTS { print("[GemiusConnector] Player Event: \(event.type) : code = \(code) ; cause = \(cause)") } + welf.reportBasicEvent(event: .COMPLETE) }) self.endedEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.ENDED, listener: { [weak self] event in guard let welf: GemiusAdapter = self else { return } if (welf.configuration.debug && LOG_PLAYER_EVENTS) { print("[GemiusConnector] Player Event: \(event.type) : currentTime = \(event.currentTime)") } + welf.reportBasicEvent(event: .COMPLETE) }) self.volumeChangeEventListener = player.addEventListener(type: THEOplayerSDK.PlayerEventTypes.VOLUME_CHANGE, listener: { [weak self] event in guard let welf: GemiusAdapter = self else { return } From 20d2874ace9b82afcf1ca5d64c5bf390bd2efdf9 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 10:15:56 +0200 Subject: [PATCH 17/31] handle volume change events --- Code/Gemius/Source/GemiusAdapter.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index a086cbbb..5fbdef60 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -27,7 +27,7 @@ public class GemiusAdapter { private var seekingEventListener: EventListener? // DONE private var errorEventListener: EventListener? // DONE private var endedEventListener: EventListener? // DONE - private var volumeChangeEventListener: EventListener? + private var volumeChangeEventListener: EventListener? // DONE private var adBreakBeginListener: EventListener? // DONE @@ -145,6 +145,18 @@ public class GemiusAdapter { if (welf.configuration.debug && LOG_PLAYER_EVENTS) { print("[GemiusConnector] Player Event: \(event.type) : volume = \(event.volume)") } + let computedVolume = welf.player.muted ? -1 : Int(welf.player.volume * 100) + let programId = welf.programId + if let currentAd = welf.currentAd, let id = currentAd.id { + let adBreak = currentAd.adBreak + let adEventData = GSMEventAdData() + adEventData.volume = NSNumber(value: computedVolume) + welf.gsmPlayer.adEvent(.CHANGE_VOL, forProgram: programId, forAd: id, atOffset: NSNumber(value: adBreak.timeOffset), with: adEventData) + } else { + let programEventData = GSMEventProgramData() + programEventData.volume = NSNumber(value: computedVolume) + welf.gsmPlayer.program(.CHANGE_VOL, forProgram: programId, atOffset: NSNumber( value: welf.player.currentTime), with: programEventData) + } }) From 4d18d409cefa459994926ae8b3acf279cd8044ff Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 12:18:01 +0200 Subject: [PATCH 18/31] handle quality change events --- Code/Gemius/Source/GemiusAdapter.swift | 39 +++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index 5fbdef60..ac6c05dd 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -28,8 +28,11 @@ public class GemiusAdapter { private var errorEventListener: EventListener? // DONE private var endedEventListener: EventListener? // DONE private var volumeChangeEventListener: EventListener? // DONE - + private var addVideoTrackEventListener: EventListener? + private var removeVideoTrackEventListener: EventListener? + private var videoQualityChangedEventListener: EventListener? + private var adBreakBeginListener: EventListener? // DONE private var adBeginListener: EventListener? // DONE private var adEndListener: EventListener? // DONE @@ -159,6 +162,34 @@ public class GemiusAdapter { } }) + self.addVideoTrackEventListener = player.videoTracks.addEventListener(type: VideoTrackListEventTypes.ADD_TRACK, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + let videoTrack = event.track + welf.videoQualityChangedEventListener = videoTrack.addEventListener(type: MediaTrackEventTypes.ACTIVE_QUALITY_CHANGED) { [weak self] event in + let programId = welf.programId + let height = welf.player.videoHeight + let width = welf.player.videoWidth + if let currentAd = welf.currentAd, let id = currentAd.id { + let adBreak = currentAd.adBreak + let adEventData = GSMEventAdData() + adEventData.quality = "\(width)x\(height)" + welf.gsmPlayer.adEvent(.CHANGE_QUAL, forProgram: programId, forAd: id, atOffset: NSNumber(value: adBreak.timeOffset), with: adEventData) + } else { + let programEventData = GSMEventProgramData() + programEventData.quality = "\(width)x\(height)" + welf.gsmPlayer.program(.CHANGE_QUAL, forProgram: programId, atOffset: NSNumber(value: welf.player.currentTime), with: programEventData) + } + } + }) + self.removeVideoTrackEventListener = player.videoTracks.addEventListener(type: VideoTrackListEventTypes.REMOVE_TRACK, listener: { [weak self] event in + guard let welf: GemiusAdapter = self else { return } + let videoTrack = event.track + if let videoQualityChangedEventListener: THEOplayerSDK.EventListener = welf.videoQualityChangedEventListener { + videoTrack.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: videoQualityChangedEventListener) + } + }) + + if (hasAdIntegration()) { self.adBreakBeginListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BREAK_BEGIN, listener: { [weak self] event in @@ -270,6 +301,12 @@ public class GemiusAdapter { if let adBreakEndedListener: THEOplayerSDK.EventListener = self.adBreakEndedListener { self.player.removeEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BREAK_END, listener: adBreakEndedListener) } + if let addVideoTrackEventListener: THEOplayerSDK.EventListener = self.addVideoTrackEventListener { + self.player.videoTracks.removeEventListener(type: THEOplayerSDK.VideoTrackListEventTypes.ADD_TRACK, listener: addVideoTrackEventListener) + } + if let removeVideoTrackEventListener: THEOplayerSDK.EventListener = self.removeVideoTrackEventListener { + self.player.videoTracks.removeEventListener(type: THEOplayerSDK.VideoTrackListEventTypes.REMOVE_TRACK, listener: removeVideoTrackEventListener) + } } private func handleFirstPlaying(event: PlayingEvent) { From 9bce342324811f4a1cce86f373e30007f2005881 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 12:45:56 +0200 Subject: [PATCH 19/31] initialize only once --- Code/Gemius/Source/GemiusConnector.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Gemius/Source/GemiusConnector.swift b/Code/Gemius/Source/GemiusConnector.swift index 53251b53..8685ba72 100644 --- a/Code/Gemius/Source/GemiusConnector.swift +++ b/Code/Gemius/Source/GemiusConnector.swift @@ -8,7 +8,7 @@ public struct GemiusConfiguration { let hitCollectorHost: String let gemiusId: String let debug: Bool - let adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? = nil + let adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? public init(playerId: String, hitCollectorHost: String, gemiusId: String, debug: Bool, adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? = nil) { self.playerId = playerId From b0e39a1eda8d5e84d3a10b682d7bf3c1aaf47c74 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 15:38:22 +0200 Subject: [PATCH 20/31] add appinfo,remove plyrid,use debug flag in config --- Code/Gemius/Source/GemiusAdapter.swift | 4 +++- Code/Gemius/Source/GemiusConnector.swift | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index ac6c05dd..84f8c71d 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -51,7 +51,9 @@ public class GemiusAdapter { } else { playerData.volume = NSNumber(value: player.volume * 100) } - self.gsmPlayer = GemiusSDK.GSMPlayer(id: configuration.playerId, withHost: configuration.hitCollectorHost, withGemiusID: configuration.gemiusId, with: playerData) + GemiusSDK.GEMConfig.sharedInstance().loggingEnabled = configuration.debug + GemiusSDK.GEMConfig.sharedInstance().setAppInfo(configuration.applicationName, version: configuration.applicationVersion) + self.gsmPlayer = GemiusSDK.GSMPlayer(id: "THEOplayer", withHost: configuration.hitCollectorHost, withGemiusID: configuration.gemiusId, with: playerData) addEventListeners() } diff --git a/Code/Gemius/Source/GemiusConnector.swift b/Code/Gemius/Source/GemiusConnector.swift index 8685ba72..c0145a90 100644 --- a/Code/Gemius/Source/GemiusConnector.swift +++ b/Code/Gemius/Source/GemiusConnector.swift @@ -4,14 +4,16 @@ import GemiusSDK #endif public struct GemiusConfiguration { - let playerId: String + let applicationName: String + let applicationVersion: String let hitCollectorHost: String let gemiusId: String let debug: Bool let adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? - public init(playerId: String, hitCollectorHost: String, gemiusId: String, debug: Bool, adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? = nil) { - self.playerId = playerId + public init(applicationName: String, applicationVersion: String, hitCollectorHost: String, gemiusId: String, debug: Bool, adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? = nil) { + self.applicationName = applicationName + self.applicationVersion = applicationVersion self.hitCollectorHost = hitCollectorHost self.gemiusId = gemiusId self.debug = debug From 785938af3b3176203393b379e1ee06db210396be Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 15:42:31 +0200 Subject: [PATCH 21/31] example configuration --- Code/Gemius-Examples/SharedCode/ViewController.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Code/Gemius-Examples/SharedCode/ViewController.swift b/Code/Gemius-Examples/SharedCode/ViewController.swift index 81f05b6d..f4a50525 100644 --- a/Code/Gemius-Examples/SharedCode/ViewController.swift +++ b/Code/Gemius-Examples/SharedCode/ViewController.swift @@ -34,9 +34,10 @@ class ViewController: UIViewController { #endif self.gemius = GemiusConnector( configuration: GemiusConfiguration( - playerId: "test", - hitCollectorHost: "https://prefix.gemius.pl", - gemiusId: "abcde", + applicationName: "GemiusReporter", + applicationVersion: "0.0.1", + hitCollectorHost: "https://.hit.gemius.pl", + gemiusId: "", debug: true ), player: player From 022fd59ee9ce67d2d35a6d2f5d70c870d9f08849 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 15:43:02 +0200 Subject: [PATCH 22/31] example program data --- Code/Gemius-Examples/SharedCode/ViewController.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Code/Gemius-Examples/SharedCode/ViewController.swift b/Code/Gemius-Examples/SharedCode/ViewController.swift index f4a50525..b2cda8bd 100644 --- a/Code/Gemius-Examples/SharedCode/ViewController.swift +++ b/Code/Gemius-Examples/SharedCode/ViewController.swift @@ -60,6 +60,15 @@ class ViewController: UIViewController { @IBAction func bbbButtonClicked(_ sender: UIButton) { + let programData = GemiusSDK.GSMProgramData() + programData.name = "Big Bug Bunny Movie" + programData.programGenre = .series + programData.programSeason = "1" + programData.transmissionType = .onDemand + programData.programProducer = "Blender Studio" + programData.series = "Test Content" + programData.duration = 634 + gemius.update(programId: "BigBuckBunny", programData: programData) player.source = SourceDescription( source: TypedSource( src: bigBuckBunnyURL, From e33bc9da42264cdbbeee6ce1fc6553780c65da25 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 15:45:36 +0200 Subject: [PATCH 23/31] example program data --- Code/Gemius-Examples/SharedCode/ViewController.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Code/Gemius-Examples/SharedCode/ViewController.swift b/Code/Gemius-Examples/SharedCode/ViewController.swift index b2cda8bd..e14ffd8a 100644 --- a/Code/Gemius-Examples/SharedCode/ViewController.swift +++ b/Code/Gemius-Examples/SharedCode/ViewController.swift @@ -83,6 +83,15 @@ class ViewController: UIViewController { } @IBAction func starWarsButtonClicked(_ sender: UIButton) { + let programData = GemiusSDK.GSMProgramData() + programData.name = "Star Wars" + programData.programGenre = .series + programData.programSeason = "1" + programData.transmissionType = .onDemand + programData.programProducer = "GWL" + programData.series = "Star Wars" + programData.duration = 211 + gemius.update(programId: "Episode VII The Force Awakens", programData: programData) player.source = SourceDescription( source: TypedSource( src: starwarsURL.absoluteString, From c1dff495909855f14bfa4c19cae5efaede70f22e Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 15:59:49 +0200 Subject: [PATCH 24/31] remove comments --- Code/Gemius/Source/GemiusAdapter.swift | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index 84f8c71d..3ef95f9f 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -19,25 +19,25 @@ public class GemiusAdapter { private var adCount = 1 private var currentAd: Ad? = nil - private var sourceChangeEventListener: EventListener? //DONE - private var playingEventListener: EventListener? // DONE - private var playEventListener: EventListener? // DONE - private var pauseEventListener: EventListener? // DONE - private var waitingEventListener: EventListener? // DONE - private var seekingEventListener: EventListener? // DONE - private var errorEventListener: EventListener? // DONE - private var endedEventListener: EventListener? // DONE - private var volumeChangeEventListener: EventListener? // DONE + private var sourceChangeEventListener: EventListener? + private var playingEventListener: EventListener? + private var playEventListener: EventListener? + private var pauseEventListener: EventListener? + private var waitingEventListener: EventListener? + private var seekingEventListener: EventListener? + private var errorEventListener: EventListener? + private var endedEventListener: EventListener? + private var volumeChangeEventListener: EventListener? private var addVideoTrackEventListener: EventListener? private var removeVideoTrackEventListener: EventListener? private var videoQualityChangedEventListener: EventListener? - private var adBreakBeginListener: EventListener? // DONE - private var adBeginListener: EventListener? // DONE - private var adEndListener: EventListener? // DONE - private var adSkipListener: EventListener? // DONE - private var adBreakEndedListener: EventListener? // DONE + private var adBreakBeginListener: EventListener? + private var adBeginListener: EventListener? + private var adEndListener: EventListener? + private var adSkipListener: EventListener? + private var adBreakEndedListener: EventListener? public init(configuration: GemiusConfiguration, player: THEOplayer, adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? = nil) { From a838dc3e7bf9993259e08959fcf2586ed5e309bc Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 22:16:11 +0200 Subject: [PATCH 25/31] import ima integration --- Code/Gemius-Examples/SharedCode/ViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Gemius-Examples/SharedCode/ViewController.swift b/Code/Gemius-Examples/SharedCode/ViewController.swift index e14ffd8a..0ec96291 100644 --- a/Code/Gemius-Examples/SharedCode/ViewController.swift +++ b/Code/Gemius-Examples/SharedCode/ViewController.swift @@ -7,6 +7,7 @@ import UIKit import THEOplayerSDK +import THEOplayerGoogleIMAIntegration import THEOplayerConnectorGemius import GemiusSDK From 8bcd91a28b7d5d514849890bb861c87d805222b4 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 22:17:53 +0200 Subject: [PATCH 26/31] add linker flags --- .../SPM/GemiusReporter.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.pbxproj b/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.pbxproj index c944503e..c299f4cd 100644 --- a/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.pbxproj +++ b/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.pbxproj @@ -203,6 +203,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_BUNDLE_IDENTIFIER = com.theoplayer.gemius.ios.integration.GemiusReporter; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -231,6 +232,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_BUNDLE_IDENTIFIER = com.theoplayer.gemius.ios.integration.GemiusReporter; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; From 3df8fbde6049aa99a93fb0900ae536c92bcc4975 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 15 Jul 2025 22:20:43 +0200 Subject: [PATCH 27/31] add missing dependencies --- .../GemiusReporter.xcodeproj/project.pbxproj | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.pbxproj b/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.pbxproj index c299f4cd..933dee41 100644 --- a/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.pbxproj +++ b/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.pbxproj @@ -8,6 +8,11 @@ /* Begin PBXBuildFile section */ 290B70F32E1C650F0013C58D /* THEOplayerConnectorGemius in Frameworks */ = {isa = PBXBuildFile; productRef = 290B70F22E1C650F0013C58D /* THEOplayerConnectorGemius */; }; + 290B712A2E1DC6F70013C58D /* GemiusSDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 290B71292E1DC6F70013C58D /* GemiusSDK.xcframework */; }; + 290B712B2E1DC6F70013C58D /* GemiusSDK.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 290B71292E1DC6F70013C58D /* GemiusSDK.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 290B71312E268E680013C58D /* (null) in Frameworks */ = {isa = PBXBuildFile; }; + 290B71342E2697EE0013C58D /* THEOplayerGoogleIMAIntegration in Frameworks */ = {isa = PBXBuildFile; productRef = 290B71332E2697EE0013C58D /* THEOplayerGoogleIMAIntegration */; }; + 290B71372E269B840013C58D /* GoogleInteractiveMediaAds in Frameworks */ = {isa = PBXBuildFile; productRef = 290B71362E269B840013C58D /* GoogleInteractiveMediaAds */; }; 295C3E152E1C6159000C4499 /* THEOplayerConnectorGemius in Frameworks */ = {isa = PBXBuildFile; productRef = 295C3E142E1C6159000C4499 /* THEOplayerConnectorGemius */; }; 295C3E222E1C640D000C4499 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295C3E202E1C640D000C4499 /* ViewController.swift */; }; 295C3E232E1C640D000C4499 /* PlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295C3E1E2E1C640D000C4499 /* PlayerView.swift */; }; @@ -18,7 +23,23 @@ 295C3E292E1C640D000C4499 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 295C3E1D2E1C640D000C4499 /* Main.storyboard */; }; /* End PBXBuildFile section */ +/* Begin PBXCopyFilesBuildPhase section */ + 290B712C2E1DC6F70013C58D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 290B712B2E1DC6F70013C58D /* GemiusSDK.xcframework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ + 290B71292E1DC6F70013C58D /* GemiusSDK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = GemiusSDK.xcframework; path = "../../../../../../../Downloads/GemiusSDK_iOS_2.0.6 2/Framework/iOS/GemiusSDK.xcframework"; sourceTree = ""; }; + 290B712D2E2683E00013C58D /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = ../../../../../../../AdSupport.framework; sourceTree = ""; }; 295C3DE62E1C5E14000C4499 /* GemiusReporter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GemiusReporter.app; sourceTree = BUILT_PRODUCTS_DIR; }; 295C3E172E1C640D000C4499 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 295C3E182E1C640D000C4499 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -35,7 +56,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 290B712A2E1DC6F70013C58D /* GemiusSDK.xcframework in Frameworks */, + 290B71312E268E680013C58D /* (null) in Frameworks */, + 290B71372E269B840013C58D /* GoogleInteractiveMediaAds in Frameworks */, 295C3E152E1C6159000C4499 /* THEOplayerConnectorGemius in Frameworks */, + 290B71342E2697EE0013C58D /* THEOplayerGoogleIMAIntegration in Frameworks */, 290B70F32E1C650F0013C58D /* THEOplayerConnectorGemius in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -43,10 +68,20 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 290B71282E1DC6F70013C58D /* Frameworks */ = { + isa = PBXGroup; + children = ( + 290B712D2E2683E00013C58D /* AdSupport.framework */, + 290B71292E1DC6F70013C58D /* GemiusSDK.xcframework */, + ); + name = Frameworks; + sourceTree = ""; + }; 295C3DDD2E1C5E14000C4499 = { isa = PBXGroup; children = ( 295C3E212E1C640D000C4499 /* GemiusReporter */, + 290B71282E1DC6F70013C58D /* Frameworks */, 295C3DE72E1C5E14000C4499 /* Products */, ); sourceTree = ""; @@ -85,6 +120,7 @@ 295C3DE22E1C5E14000C4499 /* Sources */, 295C3DE32E1C5E14000C4499 /* Frameworks */, 295C3DE42E1C5E14000C4499 /* Resources */, + 290B712C2E1DC6F70013C58D /* Embed Frameworks */, ); buildRules = ( ); @@ -94,6 +130,8 @@ packageProductDependencies = ( 295C3E142E1C6159000C4499 /* THEOplayerConnectorGemius */, 290B70F22E1C650F0013C58D /* THEOplayerConnectorGemius */, + 290B71332E2697EE0013C58D /* THEOplayerGoogleIMAIntegration */, + 290B71362E269B840013C58D /* GoogleInteractiveMediaAds */, ); productName = GemiusReporter; productReference = 295C3DE62E1C5E14000C4499 /* GemiusReporter.app */; @@ -125,6 +163,8 @@ minimizedProjectReferenceProxies = 1; packageReferences = ( 290B70F12E1C650F0013C58D /* XCLocalSwiftPackageReference "../../../../iOS-Connector" */, + 290B71322E2697EE0013C58D /* XCRemoteSwiftPackageReference "theoplayer-sdk-apple" */, + 290B71352E269B840013C58D /* XCRemoteSwiftPackageReference "swift-package-manager-google-interactive-media-ads-ios" */, ); preferredProjectObjectVersion = 77; productRefGroup = 295C3DE72E1C5E14000C4499 /* Products */; @@ -392,11 +432,40 @@ }; /* End XCLocalSwiftPackageReference section */ +/* Begin XCRemoteSwiftPackageReference section */ + 290B71322E2697EE0013C58D /* XCRemoteSwiftPackageReference "theoplayer-sdk-apple" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/THEOplayer/theoplayer-sdk-apple"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 9.8.0; + }; + }; + 290B71352E269B840013C58D /* XCRemoteSwiftPackageReference "swift-package-manager-google-interactive-media-ads-ios" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/googleads/swift-package-manager-google-interactive-media-ads-ios"; + requirement = { + branch = main; + kind = branch; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + /* Begin XCSwiftPackageProductDependency section */ 290B70F22E1C650F0013C58D /* THEOplayerConnectorGemius */ = { isa = XCSwiftPackageProductDependency; productName = THEOplayerConnectorGemius; }; + 290B71332E2697EE0013C58D /* THEOplayerGoogleIMAIntegration */ = { + isa = XCSwiftPackageProductDependency; + package = 290B71322E2697EE0013C58D /* XCRemoteSwiftPackageReference "theoplayer-sdk-apple" */; + productName = THEOplayerGoogleIMAIntegration; + }; + 290B71362E269B840013C58D /* GoogleInteractiveMediaAds */ = { + isa = XCSwiftPackageProductDependency; + package = 290B71352E269B840013C58D /* XCRemoteSwiftPackageReference "swift-package-manager-google-interactive-media-ads-ios" */; + productName = GoogleInteractiveMediaAds; + }; 295C3E142E1C6159000C4499 /* THEOplayerConnectorGemius */ = { isa = XCSwiftPackageProductDependency; productName = THEOplayerConnectorGemius; From 678cf4c0936d5b253d0714b73a166eb1571217cc Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Thu, 17 Jul 2025 22:43:54 +0200 Subject: [PATCH 28/31] add google ima integration dependency --- Code/Gemius-Examples/Cocoapods/Podfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Gemius-Examples/Cocoapods/Podfile b/Code/Gemius-Examples/Cocoapods/Podfile index 369d5304..91a01648 100644 --- a/Code/Gemius-Examples/Cocoapods/Podfile +++ b/Code/Gemius-Examples/Cocoapods/Podfile @@ -3,6 +3,7 @@ platform :ios, '13.0' target 'GemiusReporter' do # Use the AdscriptConnector that is locally defined in the parent directory pod 'THEOplayer-Connector-Gemius', :path => '../../../' + pod 'THEOplayer-Integration-GoogleIMA', '~> 9' pod 'GemiusSDK', :path => 'Frameworks/' # When you want to use a custom THEOplayerSDK build: From 627cf43f9055465184f38bd34ab4f832f8f627c9 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Sat, 19 Jul 2025 15:33:02 +0200 Subject: [PATCH 29/31] listen for quality change event --- Code/Gemius/Source/GemiusAdapter.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift index 3ef95f9f..b9408249 100644 --- a/Code/Gemius/Source/GemiusAdapter.swift +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -187,7 +187,7 @@ public class GemiusAdapter { guard let welf: GemiusAdapter = self else { return } let videoTrack = event.track if let videoQualityChangedEventListener: THEOplayerSDK.EventListener = welf.videoQualityChangedEventListener { - videoTrack.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: videoQualityChangedEventListener) + videoTrack.removeEventListener(type: THEOplayerSDK.MediaTrackEventTypes.ACTIVE_QUALITY_CHANGED, listener: videoQualityChangedEventListener) } }) From 39dbffdaccdd030a5bed706c8ea1528f52f65de2 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 29 Jul 2025 10:18:09 +0200 Subject: [PATCH 30/31] add config and metadata update to readme --- Code/Gemius/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Code/Gemius/README.md b/Code/Gemius/README.md index c68fc22e..767ebe8e 100644 --- a/Code/Gemius/README.md +++ b/Code/Gemius/README.md @@ -42,6 +42,18 @@ Import the `THEOplayerConnectorGemius` module import THEOplayerConnectorGemius ``` +Create a `GemiusConfiguration` + +```swift +let configuration = GemiusConfiguration( + applicationName: "GemiusReporter", + applicationVersion: "0.0.1", + hitCollectorHost: "", + gemiusId: "", + debug: true +) +``` + Create a `GemiusConnector` that uses this `configuration` and your `THEOplayer` instance: ```swift @@ -51,4 +63,12 @@ let connector = GemiusConnector( ) ``` +Update metadata using the `update` method + +```swift +let programId = "" +let programData: GemiusSDK.GSMProgramData = +connector.update(programId,programData) +``` + From ee6eefaf7c9a98411d19d3523d365af4795ae9a6 Mon Sep 17 00:00:00 2001 From: Wonne Joosen Date: Tue, 29 Jul 2025 11:22:53 +0200 Subject: [PATCH 31/31] finish readme --- Code/Gemius/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Code/Gemius/README.md b/Code/Gemius/README.md index 767ebe8e..606a9876 100644 --- a/Code/Gemius/README.md +++ b/Code/Gemius/README.md @@ -13,6 +13,8 @@ For example xcode projects with this connector see [Gemius-Examples](../Gemius-E 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 Gemius SDK is not available as a Swift Package. Download the .xcframework from the Gemius developer portal and drag it onto Project > General > Frameworks, Libraries and Embedded Content. + To support custom feature builds of THEOplayerSDK perform the following steps: @@ -27,7 +29,14 @@ To support custom feature builds of THEOplayerSDK perform the following steps: 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 Gemius connector pods that you want to use in your app: `pod 'THEOplayer-Connector-Gemius'` -3. Install the pods using `pod install` , then open your `.xcworkspace` file to see the project in Xcode. +3. The Gemius SDK is not available as a pod. Download the .xcframework from the Gemius developer portal. Place it in a folder next to a custom podspec. Refer to the ones in [Gemius-Example for Cocoapods for an example](./../Gemius-Examples//Cocoapod/Frameworks/). Include a line in you app's Podfile to point to that podspec for the `GemiusSDK` dependency. +```ruby + pod 'GemiusSDK', :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: