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..91a01648 --- /dev/null +++ b/Code/Gemius-Examples/Cocoapods/Podfile @@ -0,0 +1,14 @@ +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: + # - 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..933dee41 --- /dev/null +++ b/Code/Gemius-Examples/SPM/GemiusReporter.xcodeproj/project.pbxproj @@ -0,0 +1,476 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* 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 */; }; + 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 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 = ""; }; + 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 = ( + 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; + }; +/* 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 = ""; + }; + 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 */, + 290B712C2E1DC6F70013C58D /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GemiusReporter; + packageProductDependencies = ( + 295C3E142E1C6159000C4499 /* THEOplayerConnectorGemius */, + 290B70F22E1C650F0013C58D /* THEOplayerConnectorGemius */, + 290B71332E2697EE0013C58D /* THEOplayerGoogleIMAIntegration */, + 290B71362E269B840013C58D /* GoogleInteractiveMediaAds */, + ); + 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" */, + 290B71322E2697EE0013C58D /* XCRemoteSwiftPackageReference "theoplayer-sdk-apple" */, + 290B71352E269B840013C58D /* XCRemoteSwiftPackageReference "swift-package-manager-google-interactive-media-ads-ios" */, + ); + 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; + OTHER_LDFLAGS = "-ObjC"; + 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; + OTHER_LDFLAGS = "-ObjC"; + 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 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; + }; +/* 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..0ec96291 --- /dev/null +++ b/Code/Gemius-Examples/SharedCode/ViewController.swift @@ -0,0 +1,128 @@ +// +// ViewController.swift +// GemiusReporter +// +// Created by Joosen, Wonne on 07/07/2025. +// + +import UIKit +import THEOplayerSDK +import THEOplayerGoogleIMAIntegration +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( + applicationName: "GemiusReporter", + applicationVersion: "0.0.1", + hitCollectorHost: "https://.hit.gemius.pl", + gemiusId: "", + 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) { + 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, + type: "application/x-mpegurl" + ), + metadata: MetadataDescription( + metadataKeys: nil, + title: "Big buck bunny" + ) + ) + + } + + @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, + 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)" + ) + ) + + } + + @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..606a9876 --- /dev/null +++ b/Code/Gemius/README.md @@ -0,0 +1,83 @@ +# 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. +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: + +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. 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: + +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 `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 +let connector = GemiusConnector( + configuration: configuration, + player: yourTHEOplayer +) +``` + +Update metadata using the `update` method + +```swift +let programId = "" +let programData: GemiusSDK.GSMProgramData = +connector.update(programId,programData) +``` + + diff --git a/Code/Gemius/Source/GemiusAdapter.swift b/Code/Gemius/Source/GemiusAdapter.swift new file mode 100644 index 00000000..b9408249 --- /dev/null +++ b/Code/Gemius/Source/GemiusAdapter.swift @@ -0,0 +1,394 @@ +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 let adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? + + private var programId: String? + private var programData: GemiusSDK.GSMProgramData? + + private var partCount = 1 + private var adCount = 1 + private var currentAd: Ad? = nil + + 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? + 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) { + 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) { + playerData.volume = -1 + } else { + playerData.volume = NSNumber(value: player.volume * 100) + } + 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() + } + + public func update(programId: String, programData: GemiusSDK.GSMProgramData) { + self.programId = programId + self.programData = programData + } + + + private func addEventListeners() { + 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)") + } + 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 { + welf.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.PLAYING, listener: playingEventListener) + } + 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?.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) { + 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 } + 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 } + 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 } + 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 } + 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 } + 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) + } + }) + + 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.MediaTrackEventTypes.ACTIVE_QUALITY_CHANGED, listener: videoQualityChangedEventListener) + } + }) + + + + 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)") + } + 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?.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 } + 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.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?.handleFirstPlaying(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.adBreakEndedListener = player.ads.addEventListener(type: THEOplayerSDK.AdsEventTypes.AD_BREAK_END, listener: { [weak self] event in + + guard let welf: GemiusAdapter = self else { return } + 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?.handleFirstPlaying(event: event) }) + } + }) + } + } + + private func removeEventListeners() { + 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 endedEventListener: THEOplayerSDK.EventListener = self.endedEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.ENDED, listener: endedEventListener) + } + if let volumeChangeEventListener: THEOplayerSDK.EventListener = self.volumeChangeEventListener { + self.player.removeEventListener(type: THEOplayerSDK.PlayerEventTypes.VOLUME_CHANGE, listener: volumeChangeEventListener) + } + 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 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 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) { + 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) + } + } + + 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 + } + + 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 + } + + 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) + + } + } + + private func hasPrerollScheduled() -> Bool { + player.ads.scheduledAdBreaks.contains(where: {adBreak in adBreak.timeOffset == 0}) + } +} diff --git a/Code/Gemius/Source/GemiusConnector.swift b/Code/Gemius/Source/GemiusConnector.swift new file mode 100644 index 00000000..c0145a90 --- /dev/null +++ b/Code/Gemius/Source/GemiusConnector.swift @@ -0,0 +1,38 @@ +import THEOplayerSDK +#if canImport(GemiusSDK) +import GemiusSDK +#endif + +public struct GemiusConfiguration { + let applicationName: String + let applicationVersion: String + let hitCollectorHost: String + let gemiusId: String + let debug: Bool + let adProcessor: ((THEOplayerSDK.Ad) -> GemiusSDK.GSMAdData)? + + 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 + self.adProcessor = adProcessor + } +} + +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, adProcessor: configuration.adProcessor) + } + + public func update(programId: String, programData: GemiusSDK.GSMProgramData) { + self.adapter.update(programId: programId, programData: programData) + } + +} 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