From 82764ca2ef711ec32715993bb68490585a122a54 Mon Sep 17 00:00:00 2001 From: Smira Ibrahim Rassas Date: Sun, 25 Aug 2024 19:07:11 +0300 Subject: [PATCH] Release Verve Adapter 4.3.0 supports SDK 3.0.4 --- Adapters/Verve/BuildScript/add_Git_Hash.sh | 23 + .../Verve/BuildScript/build_XCFramework.sh | 50 ++ .../ISVerveAdapter.xcodeproj/project.pbxproj | 547 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../contents.xcworkspacedata | 10 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../Banner/ISVerveBannerAdapter.h | 21 + .../Banner/ISVerveBannerAdapter.m | 166 ++++++ .../Banner/ISVerveBannerDelegate.h | 19 + .../Banner/ISVerveBannerDelegate.m | 53 ++ .../ISVerveAdapter/ISVerveAdapter+Internal.h | 25 + .../Verve/ISVerveAdapter/ISVerveAdapter.h | 18 + .../Verve/ISVerveAdapter/ISVerveAdapter.m | 185 ++++++ .../Verve/ISVerveAdapter/ISVerveConstants.h | 26 + .../Interstitial/ISVerveInterstitialAdapter.h | 16 + .../Interstitial/ISVerveInterstitialAdapter.m | 158 +++++ .../ISVerveInterstitialDelegate.h | 25 + .../ISVerveInterstitialDelegate.m | 58 ++ .../ISVerveRewardedVideoAdapter.h | 15 + .../ISVerveRewardedVideoAdapter.m | 162 ++++++ .../ISVerveRewardedVideoDelegate.h | 22 + .../ISVerveRewardedVideoDelegate.m | 66 +++ Adapters/Verve/Podfile | 9 + 24 files changed, 1697 insertions(+) create mode 100755 Adapters/Verve/BuildScript/add_Git_Hash.sh create mode 100755 Adapters/Verve/BuildScript/build_XCFramework.sh create mode 100644 Adapters/Verve/ISVerveAdapter.xcodeproj/project.pbxproj create mode 100644 Adapters/Verve/ISVerveAdapter.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Adapters/Verve/ISVerveAdapter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Adapters/Verve/ISVerveAdapter.xcworkspace/contents.xcworkspacedata create mode 100644 Adapters/Verve/ISVerveAdapter.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerAdapter.h create mode 100644 Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerAdapter.m create mode 100644 Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerDelegate.h create mode 100644 Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerDelegate.m create mode 100644 Adapters/Verve/ISVerveAdapter/ISVerveAdapter+Internal.h create mode 100644 Adapters/Verve/ISVerveAdapter/ISVerveAdapter.h create mode 100644 Adapters/Verve/ISVerveAdapter/ISVerveAdapter.m create mode 100644 Adapters/Verve/ISVerveAdapter/ISVerveConstants.h create mode 100644 Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialAdapter.h create mode 100644 Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialAdapter.m create mode 100644 Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialDelegate.h create mode 100644 Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialDelegate.m create mode 100644 Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoAdapter.h create mode 100644 Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoAdapter.m create mode 100644 Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoDelegate.h create mode 100644 Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoDelegate.m create mode 100644 Adapters/Verve/Podfile diff --git a/Adapters/Verve/BuildScript/add_Git_Hash.sh b/Adapters/Verve/BuildScript/add_Git_Hash.sh new file mode 100755 index 0000000..90704fd --- /dev/null +++ b/Adapters/Verve/BuildScript/add_Git_Hash.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +version=$(git rev-parse --verify HEAD --short) + +cd .. + + echo 'Adding Git Hash To '${PROJECT_DIR}'' + cd ${PROJECT_DIR}/${PROJECT_NAME} + sed -i -e 's/Githash.*/Githash = @"'$version'";/g' ${PROJECT_NAME}.h + rm -f ${PROJECT_NAME}.h-e + cd ../BuildScript + + + + + + + +printf '\e[1;32m%-6s\e[m\n' "<----==============================BUILD PASSED==============================---->" + + + diff --git a/Adapters/Verve/BuildScript/build_XCFramework.sh b/Adapters/Verve/BuildScript/build_XCFramework.sh new file mode 100755 index 0000000..df88ee6 --- /dev/null +++ b/Adapters/Verve/BuildScript/build_XCFramework.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -e + +if [ -n "$RW_MULTIPLATFORM_BUILD_IN_PROGRESS" ]; then +exit 0 +fi +export RW_MULTIPLATFORM_BUILD_IN_PROGRESS=1 + +ADAPTER_WORKSPACE="${PROJECT_DIR}/${PROJECT_NAME}.xcworkspace" + + + + +#Remove framework if exists. +if [ -d "${PROJECT_DIR}/ReleaseCandidates/${PROJECT_NAME}" ]; then + rm -rf "${PROJECT_DIR}/ReleaseCandidates/${PROJECT_NAME}" +fi + + + +createFramework() { + +xcrun xcodebuild -workspace "${ADAPTER_WORKSPACE}" \ + -scheme "${PROJECT_NAME}" \ + -configuration "${CONFIGURATION}" \ + -sdk "$1" \ + ONLY_ACTIVE_ARCH=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=NO \ + SKIP_INSTALL=NO \ + ARCHS="$2" \ + BUILD_DIR="${BUILD_DIR}" \ + OBJROOT="${OBJROOT}/DependentBuilds" \ + BUILD_ROOT="${BUILD_ROOT}" \ + SYMROOT="${SYMROOT}" $ACTION + + +} + + + createFramework "iphoneos" "arm64 x86_64" + createFramework "iphonesimulator" "arm64 x86_64" + + + + +#Create dynamic framework using the frameworks generated above. +xcodebuild -create-xcframework \ +-framework "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" \ +-framework "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework" \ +-output "${PROJECT_DIR}/ReleaseCandidates/${PROJECT_NAME}/${PROJECT_NAME}.xcframework" diff --git a/Adapters/Verve/ISVerveAdapter.xcodeproj/project.pbxproj b/Adapters/Verve/ISVerveAdapter.xcodeproj/project.pbxproj new file mode 100644 index 0000000..dcde300 --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter.xcodeproj/project.pbxproj @@ -0,0 +1,547 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + 2EFEAF1E2C7B82610041EB22 /* ISVerveInterstitialAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EFEAF0B2C7B82610041EB22 /* ISVerveInterstitialAdapter.h */; }; + 2EFEAF1F2C7B82610041EB22 /* ISVerveInterstitialAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EFEAF0C2C7B82610041EB22 /* ISVerveInterstitialAdapter.m */; }; + 2EFEAF202C7B82610041EB22 /* ISVerveInterstitialDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EFEAF0D2C7B82610041EB22 /* ISVerveInterstitialDelegate.h */; }; + 2EFEAF212C7B82610041EB22 /* ISVerveInterstitialDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EFEAF0E2C7B82610041EB22 /* ISVerveInterstitialDelegate.m */; }; + 2EFEAF222C7B82610041EB22 /* ISVerveBannerAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EFEAF102C7B82610041EB22 /* ISVerveBannerAdapter.h */; }; + 2EFEAF232C7B82610041EB22 /* ISVerveBannerAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EFEAF112C7B82610041EB22 /* ISVerveBannerAdapter.m */; }; + 2EFEAF242C7B82610041EB22 /* ISVerveBannerDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EFEAF122C7B82610041EB22 /* ISVerveBannerDelegate.h */; }; + 2EFEAF252C7B82610041EB22 /* ISVerveBannerDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EFEAF132C7B82610041EB22 /* ISVerveBannerDelegate.m */; }; + 2EFEAF262C7B82610041EB22 /* ISVerveAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EFEAF152C7B82610041EB22 /* ISVerveAdapter.m */; }; + 2EFEAF272C7B82610041EB22 /* ISVerveAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EFEAF162C7B82610041EB22 /* ISVerveAdapter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2EFEAF282C7B82610041EB22 /* ISVerveConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EFEAF172C7B82610041EB22 /* ISVerveConstants.h */; }; + 2EFEAF292C7B82610041EB22 /* ISVerveAdapter+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EFEAF182C7B82610041EB22 /* ISVerveAdapter+Internal.h */; }; + 2EFEAF2A2C7B82610041EB22 /* ISVerveRewardedVideoAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EFEAF192C7B82610041EB22 /* ISVerveRewardedVideoAdapter.h */; }; + 2EFEAF2B2C7B82610041EB22 /* ISVerveRewardedVideoAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EFEAF1A2C7B82610041EB22 /* ISVerveRewardedVideoAdapter.m */; }; + 2EFEAF2C2C7B82610041EB22 /* ISVerveRewardedVideoDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EFEAF1B2C7B82610041EB22 /* ISVerveRewardedVideoDelegate.h */; }; + 2EFEAF2D2C7B82610041EB22 /* ISVerveRewardedVideoDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EFEAF1C2C7B82610041EB22 /* ISVerveRewardedVideoDelegate.m */; }; + FC9D17DA8FC4BDA571D781BA /* Pods_ISVerveAdapter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA89C2BEB2BA14B46D3BBAE7 /* Pods_ISVerveAdapter.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2D8ED075FBE8A1B2ABFAD850 /* Pods-ISVerveAdapter.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ISVerveAdapter.release.xcconfig"; path = "Target Support Files/Pods-ISVerveAdapter/Pods-ISVerveAdapter.release.xcconfig"; sourceTree = ""; }; + 2EFEAF0B2C7B82610041EB22 /* ISVerveInterstitialAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISVerveInterstitialAdapter.h; sourceTree = ""; }; + 2EFEAF0C2C7B82610041EB22 /* ISVerveInterstitialAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISVerveInterstitialAdapter.m; sourceTree = ""; }; + 2EFEAF0D2C7B82610041EB22 /* ISVerveInterstitialDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISVerveInterstitialDelegate.h; sourceTree = ""; }; + 2EFEAF0E2C7B82610041EB22 /* ISVerveInterstitialDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISVerveInterstitialDelegate.m; sourceTree = ""; }; + 2EFEAF102C7B82610041EB22 /* ISVerveBannerAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISVerveBannerAdapter.h; sourceTree = ""; }; + 2EFEAF112C7B82610041EB22 /* ISVerveBannerAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISVerveBannerAdapter.m; sourceTree = ""; }; + 2EFEAF122C7B82610041EB22 /* ISVerveBannerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISVerveBannerDelegate.h; sourceTree = ""; }; + 2EFEAF132C7B82610041EB22 /* ISVerveBannerDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISVerveBannerDelegate.m; sourceTree = ""; }; + 2EFEAF152C7B82610041EB22 /* ISVerveAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISVerveAdapter.m; sourceTree = ""; }; + 2EFEAF162C7B82610041EB22 /* ISVerveAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISVerveAdapter.h; sourceTree = ""; }; + 2EFEAF172C7B82610041EB22 /* ISVerveConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISVerveConstants.h; sourceTree = ""; }; + 2EFEAF182C7B82610041EB22 /* ISVerveAdapter+Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ISVerveAdapter+Internal.h"; sourceTree = ""; }; + 2EFEAF192C7B82610041EB22 /* ISVerveRewardedVideoAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISVerveRewardedVideoAdapter.h; sourceTree = ""; }; + 2EFEAF1A2C7B82610041EB22 /* ISVerveRewardedVideoAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISVerveRewardedVideoAdapter.m; sourceTree = ""; }; + 2EFEAF1B2C7B82610041EB22 /* ISVerveRewardedVideoDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISVerveRewardedVideoDelegate.h; sourceTree = ""; }; + 2EFEAF1C2C7B82610041EB22 /* ISVerveRewardedVideoDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ISVerveRewardedVideoDelegate.m; sourceTree = ""; }; + 3982C3BAD337D763864BD4CC /* Pods-ISYandexAdapter.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ISYandexAdapter.release.xcconfig"; path = "Target Support Files/Pods-ISYandexAdapter/Pods-ISYandexAdapter.release.xcconfig"; sourceTree = ""; }; + 56DF0D5230531444E6138BAB /* Pods-ISYandexAdapter.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ISYandexAdapter.debug.xcconfig"; path = "Target Support Files/Pods-ISYandexAdapter/Pods-ISYandexAdapter.debug.xcconfig"; sourceTree = ""; }; + 9DD57911DD90F2B376BD39DC /* Pods-ISPangleAdapter.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ISPangleAdapter.debug.xcconfig"; path = "Target Support Files/Pods-ISPangleAdapter/Pods-ISPangleAdapter.debug.xcconfig"; sourceTree = ""; }; + AB2C8575DC0B8854D4FE1731 /* Pods-ISMolocoAdapter.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ISMolocoAdapter.debug.xcconfig"; path = "Target Support Files/Pods-ISMolocoAdapter/Pods-ISMolocoAdapter.debug.xcconfig"; sourceTree = ""; }; + BA0F98CAC355FA0E2D26CC0A /* Pods-ISPangleAdapter.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ISPangleAdapter.release.xcconfig"; path = "Target Support Files/Pods-ISPangleAdapter/Pods-ISPangleAdapter.release.xcconfig"; sourceTree = ""; }; + DC812AD749E4AE6065F77820 /* Pods-ISMolocoAdapter.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ISMolocoAdapter.release.xcconfig"; path = "Target Support Files/Pods-ISMolocoAdapter/Pods-ISMolocoAdapter.release.xcconfig"; sourceTree = ""; }; + E7A49A9E198A078432E92511 /* libPods-ISMolocoAdapter.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ISMolocoAdapter.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + EFE27C0428337CC500391127 /* ISVerveAdapter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ISVerveAdapter.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F439834A4D9923F0402713D3 /* Pods-ISVerveAdapter.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ISVerveAdapter.debug.xcconfig"; path = "Target Support Files/Pods-ISVerveAdapter/Pods-ISVerveAdapter.debug.xcconfig"; sourceTree = ""; }; + FA89C2BEB2BA14B46D3BBAE7 /* Pods_ISVerveAdapter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ISVerveAdapter.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + EFE27C0128337CC500391127 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FC9D17DA8FC4BDA571D781BA /* Pods_ISVerveAdapter.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2B13A6DEF45C8EF527BE2EBC /* Pods */ = { + isa = PBXGroup; + children = ( + 9DD57911DD90F2B376BD39DC /* Pods-ISPangleAdapter.debug.xcconfig */, + BA0F98CAC355FA0E2D26CC0A /* Pods-ISPangleAdapter.release.xcconfig */, + 56DF0D5230531444E6138BAB /* Pods-ISYandexAdapter.debug.xcconfig */, + 3982C3BAD337D763864BD4CC /* Pods-ISYandexAdapter.release.xcconfig */, + AB2C8575DC0B8854D4FE1731 /* Pods-ISMolocoAdapter.debug.xcconfig */, + DC812AD749E4AE6065F77820 /* Pods-ISMolocoAdapter.release.xcconfig */, + F439834A4D9923F0402713D3 /* Pods-ISVerveAdapter.debug.xcconfig */, + 2D8ED075FBE8A1B2ABFAD850 /* Pods-ISVerveAdapter.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + 2EFEAF0F2C7B82610041EB22 /* Interstitial */ = { + isa = PBXGroup; + children = ( + 2EFEAF0B2C7B82610041EB22 /* ISVerveInterstitialAdapter.h */, + 2EFEAF0C2C7B82610041EB22 /* ISVerveInterstitialAdapter.m */, + 2EFEAF0D2C7B82610041EB22 /* ISVerveInterstitialDelegate.h */, + 2EFEAF0E2C7B82610041EB22 /* ISVerveInterstitialDelegate.m */, + ); + path = Interstitial; + sourceTree = ""; + }; + 2EFEAF142C7B82610041EB22 /* Banner */ = { + isa = PBXGroup; + children = ( + 2EFEAF102C7B82610041EB22 /* ISVerveBannerAdapter.h */, + 2EFEAF112C7B82610041EB22 /* ISVerveBannerAdapter.m */, + 2EFEAF122C7B82610041EB22 /* ISVerveBannerDelegate.h */, + 2EFEAF132C7B82610041EB22 /* ISVerveBannerDelegate.m */, + ); + path = Banner; + sourceTree = ""; + }; + 2EFEAF1D2C7B82610041EB22 /* RewardedVideo */ = { + isa = PBXGroup; + children = ( + 2EFEAF192C7B82610041EB22 /* ISVerveRewardedVideoAdapter.h */, + 2EFEAF1A2C7B82610041EB22 /* ISVerveRewardedVideoAdapter.m */, + 2EFEAF1B2C7B82610041EB22 /* ISVerveRewardedVideoDelegate.h */, + 2EFEAF1C2C7B82610041EB22 /* ISVerveRewardedVideoDelegate.m */, + ); + path = RewardedVideo; + sourceTree = ""; + }; + BC81E8CEBEBC633400C70159 /* Frameworks */ = { + isa = PBXGroup; + children = ( + E7A49A9E198A078432E92511 /* libPods-ISMolocoAdapter.a */, + FA89C2BEB2BA14B46D3BBAE7 /* Pods_ISVerveAdapter.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + C769D67D293CFB500064876A /* ISVerveAdapter */ = { + isa = PBXGroup; + children = ( + 2EFEAF142C7B82610041EB22 /* Banner */, + 2EFEAF0F2C7B82610041EB22 /* Interstitial */, + 2EFEAF162C7B82610041EB22 /* ISVerveAdapter.h */, + 2EFEAF152C7B82610041EB22 /* ISVerveAdapter.m */, + 2EFEAF182C7B82610041EB22 /* ISVerveAdapter+Internal.h */, + 2EFEAF172C7B82610041EB22 /* ISVerveConstants.h */, + 2EFEAF1D2C7B82610041EB22 /* RewardedVideo */, + ); + path = ISVerveAdapter; + sourceTree = ""; + }; + EFE27BFA28337CC500391127 = { + isa = PBXGroup; + children = ( + C769D67D293CFB500064876A /* ISVerveAdapter */, + EFE27C0528337CC500391127 /* Products */, + 2B13A6DEF45C8EF527BE2EBC /* Pods */, + BC81E8CEBEBC633400C70159 /* Frameworks */, + ); + sourceTree = ""; + }; + EFE27C0528337CC500391127 /* Products */ = { + isa = PBXGroup; + children = ( + EFE27C0428337CC500391127 /* ISVerveAdapter.framework */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + EFE27BFF28337CC500391127 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 2EFEAF272C7B82610041EB22 /* ISVerveAdapter.h in Headers */, + 2EFEAF2C2C7B82610041EB22 /* ISVerveRewardedVideoDelegate.h in Headers */, + 2EFEAF222C7B82610041EB22 /* ISVerveBannerAdapter.h in Headers */, + 2EFEAF202C7B82610041EB22 /* ISVerveInterstitialDelegate.h in Headers */, + 2EFEAF242C7B82610041EB22 /* ISVerveBannerDelegate.h in Headers */, + 2EFEAF1E2C7B82610041EB22 /* ISVerveInterstitialAdapter.h in Headers */, + 2EFEAF2A2C7B82610041EB22 /* ISVerveRewardedVideoAdapter.h in Headers */, + 2EFEAF282C7B82610041EB22 /* ISVerveConstants.h in Headers */, + 2EFEAF292C7B82610041EB22 /* ISVerveAdapter+Internal.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + EFE27C0328337CC500391127 /* ISVerveAdapter */ = { + isa = PBXNativeTarget; + buildConfigurationList = EFE27C0B28337CC500391127 /* Build configuration list for PBXNativeTarget "ISVerveAdapter" */; + buildPhases = ( + EC959F3FC840634FE254C06B /* [CP] Check Pods Manifest.lock */, + EFE27BFF28337CC500391127 /* Headers */, + EFE27C0028337CC500391127 /* Sources */, + EFE27C0128337CC500391127 /* Frameworks */, + EFE27C0228337CC500391127 /* Resources */, + EFE27C1C28337E5800391127 /* Create XCFramework */, + 61EB250A396A87D1796A5D0A /* [CP] Copy Pods Resources */, + FC4B03C229C98FF200354D90 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ISVerveAdapter; + productName = ISAdColonyAdapter; + productReference = EFE27C0428337CC500391127 /* ISVerveAdapter.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + EFE27BFB28337CC500391127 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastUpgradeCheck = 1330; + TargetAttributes = { + EFE27C0328337CC500391127 = { + CreatedOnToolsVersion = 13.3.1; + }; + }; + }; + buildConfigurationList = EFE27BFE28337CC500391127 /* Build configuration list for PBXProject "ISVerveAdapter" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = EFE27BFA28337CC500391127; + productRefGroup = EFE27C0528337CC500391127 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + EFE27C0328337CC500391127 /* ISVerveAdapter */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + EFE27C0228337CC500391127 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 61EB250A396A87D1796A5D0A /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ISVerveAdapter/Pods-ISVerveAdapter-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ISVerveAdapter/Pods-ISVerveAdapter-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ISVerveAdapter/Pods-ISVerveAdapter-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + EC959F3FC840634FE254C06B /* [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-ISVerveAdapter-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; + }; + EFE27C1C28337E5800391127 /* Create XCFramework */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Create XCFramework"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "chmod +x BuildScript/add_Git_Hash.sh\nBuildScript/add_Git_Hash.sh\nBuildScript/build_XCFramework.sh\n"; + }; + FC4B03C229C98FF200354D90 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Type a script or drag a script file from your workspace to insert its path.\ncd \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\"\nrm -fr *.bundle\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + EFE27C0028337CC500391127 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2EFEAF1F2C7B82610041EB22 /* ISVerveInterstitialAdapter.m in Sources */, + 2EFEAF232C7B82610041EB22 /* ISVerveBannerAdapter.m in Sources */, + 2EFEAF2B2C7B82610041EB22 /* ISVerveRewardedVideoAdapter.m in Sources */, + 2EFEAF212C7B82610041EB22 /* ISVerveInterstitialDelegate.m in Sources */, + 2EFEAF262C7B82610041EB22 /* ISVerveAdapter.m in Sources */, + 2EFEAF2D2C7B82610041EB22 /* ISVerveRewardedVideoDelegate.m in Sources */, + 2EFEAF252C7B82610041EB22 /* ISVerveBannerDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + EFE27C0928337CC500391127 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + 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; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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 = 15.4; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + EFE27C0A28337CC500391127 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + 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; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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 = 15.4; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + EFE27C0C28337CC500391127 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F439834A4D9923F0402713D3 /* Pods-ISVerveAdapter.debug.xcconfig */; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = NLKYWCU5C3; + DYLIB_COMPATIBILITY_VERSION = ""; + DYLIB_CURRENT_VERSION = ""; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MACH_O_TYPE = staticlib; + MARKETING_VERSION = 1.0; + OTHER_CFLAGS = "-fno-objc-msgsend-selector-stubs"; + PRODUCT_BUNDLE_IDENTIFIER = com.ironsource.ISVerveAdapter; + PRODUCT_NAME = ISVerveAdapter; + SKIP_INSTALL = NO; + SUPPORTS_MACCATALYST = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + EFE27C0D28337CC500391127 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2D8ED075FBE8A1B2ABFAD850 /* Pods-ISVerveAdapter.release.xcconfig */; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = NLKYWCU5C3; + DYLIB_COMPATIBILITY_VERSION = ""; + DYLIB_CURRENT_VERSION = ""; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MACH_O_TYPE = staticlib; + MARKETING_VERSION = 1.0; + OTHER_CFLAGS = "-fno-objc-msgsend-selector-stubs"; + PRODUCT_BUNDLE_IDENTIFIER = com.ironsource.ISVerveAdapter; + PRODUCT_NAME = ISVerveAdapter; + SKIP_INSTALL = NO; + SUPPORTS_MACCATALYST = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + EFE27BFE28337CC500391127 /* Build configuration list for PBXProject "ISVerveAdapter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EFE27C0928337CC500391127 /* Debug */, + EFE27C0A28337CC500391127 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EFE27C0B28337CC500391127 /* Build configuration list for PBXNativeTarget "ISVerveAdapter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EFE27C0C28337CC500391127 /* Debug */, + EFE27C0D28337CC500391127 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = EFE27BFB28337CC500391127 /* Project object */; +} diff --git a/Adapters/Verve/ISVerveAdapter.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Adapters/Verve/ISVerveAdapter.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Adapters/Verve/ISVerveAdapter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Adapters/Verve/ISVerveAdapter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Adapters/Verve/ISVerveAdapter.xcworkspace/contents.xcworkspacedata b/Adapters/Verve/ISVerveAdapter.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..9ca2ec1 --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Adapters/Verve/ISVerveAdapter.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Adapters/Verve/ISVerveAdapter.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerAdapter.h b/Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerAdapter.h new file mode 100644 index 0000000..d88fc50 --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerAdapter.h @@ -0,0 +1,21 @@ +// +// ISVerveBannerAdapter.h +// ISVerveAdapter +// +// Copyright © 2024 ironSource. All rights reserved. +// + +#import +#import "ISVerveAdapter+Internal.h" +#if __has_include() + #import +#else + #import "HyBid-Swift.h" +#endif + + +@interface ISVerveBannerAdapter : ISBaseBannerAdapter + +- (instancetype)initWithVerveAdapter:(ISVerveAdapter *)adapter; + +@end diff --git a/Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerAdapter.m b/Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerAdapter.m new file mode 100644 index 0000000..5a1f657 --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerAdapter.m @@ -0,0 +1,166 @@ +// +// ISVerveBannerAdapter.m +// ISVerveAdapter +// +// Copyright © 2024 ironSource. All rights reserved. +// + +#import "ISVerveBannerAdapter.h" +#import "ISVerveBannerDelegate.h" + +@interface ISVerveBannerAdapter () + +@property (nonatomic, weak) ISVerveAdapter *adapter; +@property (nonatomic, strong) HyBidAdView *ad; +@property (nonatomic, strong) ISVerveBannerDelegate *verveAdDelegate; +@property (nonatomic, weak) id smashDelegate; + +@end + +@implementation ISVerveBannerAdapter + +- (instancetype)initWithVerveAdapter:(ISVerveAdapter *)adapter { + self = [super init]; + if (self) { + _adapter = adapter; + _smashDelegate = nil; + _ad = nil; + _verveAdDelegate = nil; + } + return self; +} + +- (void)initBannerForBiddingWithUserId:(NSString *)userId + adapterConfig:(ISAdapterConfig *)adapterConfig + delegate:(id)delegate { + NSString *appToken = [self getStringValueFromAdapterConfig:adapterConfig + forKey:kAppToken]; + + /* Configuration Validation */ + if (![self.adapter isConfigValueValid:appToken]) { + NSError *error = [self.adapter errorForMissingCredentialFieldWithName:kAppToken]; + LogAdapterApi_Internal(@"error = %@", error); + [delegate adapterBannerInitFailedWithError:error]; + return; + } + + NSString *adUnitId = [self getStringValueFromAdapterConfig:adapterConfig + forKey:kZoneId]; + /* Configuration Validation */ + if (![self.adapter isConfigValueValid:adUnitId]) { + NSError *error = [self.adapter errorForMissingCredentialFieldWithName:kZoneId]; + LogAdapterApi_Internal(@"error = %@", error); + [delegate adapterBannerInitFailedWithError:error]; + return; + } + + self.smashDelegate = delegate; + + LogAdapterApi_Internal(@"appToken = %@, adUnitId = %@", appToken, adUnitId); + + switch ([self.adapter getInitState]) { + case INIT_STATE_NONE: + case INIT_STATE_IN_PROGRESS: + [self.adapter initSDKWithAppToken:appToken]; + break; + case INIT_STATE_SUCCESS: + [delegate adapterBannerInitSuccess]; + break; + case INIT_STATE_FAILED: + LogAdapterApi_Internal(@"init failed - appToken = %@", appToken); + [delegate adapterBannerInitFailedWithError:[ISError createError:ERROR_CODE_INIT_FAILED + withMessage:@"Verve SDK init failed"]]; + break; + } +} + +- (void)loadBannerForBiddingWithAdapterConfig:(ISAdapterConfig *)adapterConfig + adData:(NSDictionary *)adData + serverData:(NSString *)serverData + viewController:(UIViewController *)viewController + size:(ISBannerSize *)size + delegate:(id)delegate { + + NSString *zoneId = [self getStringValueFromAdapterConfig:adapterConfig + forKey:kZoneId]; + LogAdapterApi_Internal(@"zoneId = %@", zoneId); + + // create banner ad delegate + ISVerveBannerDelegate *bannerAdDelegate = [[ISVerveBannerDelegate alloc] + initWithZoneId:zoneId + andDelegate:delegate]; + self.verveAdDelegate = bannerAdDelegate; + + dispatch_async(dispatch_get_main_queue(), ^{ + self.ad = [[HyBidAdView alloc] initWithSize:[self getBannerSize:size]]; + [self.ad renderAdWithContent: serverData + withDelegate: self.verveAdDelegate]; + }); +} + +- (void)destroyBannerWithAdapterConfig:(ISAdapterConfig *)adapterConfig { + NSString *zoneId = [self getStringValueFromAdapterConfig:adapterConfig + forKey:kZoneId]; + + LogAdapterDelegate_Internal(@"zoneId = %@", zoneId); + + dispatch_async(dispatch_get_main_queue(), ^{ + if (self.ad) { + self.ad = nil; + } + if (self.ad && self.ad.delegate) { + self.ad.delegate = nil; + } + }); + + self.smashDelegate = nil; + self.verveAdDelegate = nil; +} + +- (void)collectBannerBiddingDataWithAdapterConfig:(ISAdapterConfig *)adapterConfig + adData:(NSDictionary *)adData + delegate:(id)delegate { + + [self.adapter collectBiddingDataWithDelegate:delegate]; +} + +#pragma mark - Init Delegate + +- (void)onNetworkInitCallbackSuccess { + [self.smashDelegate adapterBannerInitSuccess]; +} + +- (void)onNetworkInitCallbackFailed:(NSString *)errorMessage { + NSError *error = [ISError createErrorWithDomain:kAdapterName + code:ERROR_CODE_INIT_FAILED + message:errorMessage]; + [self.smashDelegate adapterBannerInitFailedWithError:error]; +} + +#pragma mark - Memory Handling + +- (void)releaseMemoryWithAdapterConfig:(ISAdapterConfig *)adapterConfig { + NSString *zoneId = [self getStringValueFromAdapterConfig:adapterConfig + forKey:kZoneId]; + LogAdapterDelegate_Internal(@"zoneId = %@", zoneId); + + [self destroyBannerWithAdapterConfig:adapterConfig]; +} + +#pragma mark - Helper Methods + +- (HyBidAdSize *)getBannerSize:(ISBannerSize *)ironSourceAdSize { + if ([ironSourceAdSize.sizeDescription isEqualToString:kSizeRectangle]) { + return HyBidAdSize.SIZE_300x250; + } else if ([ironSourceAdSize.sizeDescription isEqualToString:kSizeSmart]) { + if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad){ + return HyBidAdSize.SIZE_728x90; + } else { + return HyBidAdSize.SIZE_320x50; + } + } else { + return HyBidAdSize.SIZE_320x50; + } +} + +@end diff --git a/Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerDelegate.h b/Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerDelegate.h new file mode 100644 index 0000000..1fcb54e --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerDelegate.h @@ -0,0 +1,19 @@ +// +// ISVerveBannerDelegate.h +// ISVerveAdapter +// +// Copyright © 2024 ironSource Mobile Ltd. All rights reserved. +// + +#import +#import +#import + +@interface ISVerveBannerDelegate : NSObject + +@property (nonatomic, strong) NSString* zoneId; +@property (nonatomic, weak) id delegate; + +- (instancetype)initWithZoneId:(NSString *)adUnitId + andDelegate:(id)delegate; +@end diff --git a/Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerDelegate.m b/Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerDelegate.m new file mode 100644 index 0000000..960060e --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerDelegate.m @@ -0,0 +1,53 @@ +// +// ISVerveBannerDelegate.m +// ISVerveAdapter +// +// Copyright © 2024 ironSource Mobile Ltd. All rights reserved. +// + +#import "ISVerveBannerDelegate.h" +#import "ISVerveBannerAdapter.h" + +@implementation ISVerveBannerDelegate + +- (instancetype)initWithZoneId:(NSString *)zoneId + andDelegate:(id)delegate { + self = [super init]; + if (self) { + _zoneId = zoneId; + _delegate = delegate; + } + return self; +} + +/// calls this method when ad successfully loaded and ready to be displayed. +/// @param adView adView object that was loaded +- (void)adViewDidLoad:(HyBidAdView *)adView { + LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); + [self.delegate adapterBannerDidLoad:adView]; +} +/// calls this method when ad was not loaded for some reasons +/// @param adView adView object that was loaded +/// @param error the reason of failing loading +- (void)adView:(HyBidAdView *)adView didFailWithError:(NSError *)error { + LogAdapterDelegate_Internal(@"zoneId = %@ with error = %@", self.zoneId, error); + NSError *smashError = error.code == HyBidErrorCodeNoFill ? [ISError createError:ERROR_BN_LOAD_NO_FILL + withMessage:@"Verve no fill"] : error; + + [self.delegate adapterBannerDidFailToLoadWithError:smashError]; + +} + +/// calls this method when user clicked on the ad +/// @param adView adView object that was clicked +- (void)adViewDidTrackClick:(HyBidAdView *)adView { + LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); + [self.delegate adapterBannerDidClick]; +} +/// calls this method when ad was displayed and is viewable by the user +- (void)adViewDidTrackImpression:(HyBidAdView *)adView { + LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); + [self.delegate adapterBannerDidShow]; +} + +@end diff --git a/Adapters/Verve/ISVerveAdapter/ISVerveAdapter+Internal.h b/Adapters/Verve/ISVerveAdapter/ISVerveAdapter+Internal.h new file mode 100644 index 0000000..d9a8531 --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/ISVerveAdapter+Internal.h @@ -0,0 +1,25 @@ +// +// ISVerveAdapter+Internal.h +// ISVerveAdapter +// +// Copyright © 2024 ironSource. All rights reserved. +// + +#import "ISVerveAdapter.h" +#import "ISVerveConstants.h" +#import +#if __has_include() + #import +#else + #import "HyBid-Swift.h" +#endif + +@interface ISVerveAdapter() + +- (void)initSDKWithAppToken:(NSString *)appToken; + +- (void)collectBiddingDataWithDelegate:(id)delegate; + +- (InitState)getInitState; + +@end diff --git a/Adapters/Verve/ISVerveAdapter/ISVerveAdapter.h b/Adapters/Verve/ISVerveAdapter/ISVerveAdapter.h new file mode 100644 index 0000000..e2a2559 --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/ISVerveAdapter.h @@ -0,0 +1,18 @@ +// +// ISVerveAdapter.h +// ISVerveAdapter +// +// Copyright © 2024 ironSource Mobile Ltd. All rights reserved. +// + +#import +#import + +static NSString * const VerveAdapterVersion = @"4.3.0"; +static NSString * Githash = @""; + +//System Frameworks For VerveAdapter + +@interface ISVerveAdapter : ISBaseAdapter + +@end diff --git a/Adapters/Verve/ISVerveAdapter/ISVerveAdapter.m b/Adapters/Verve/ISVerveAdapter/ISVerveAdapter.m new file mode 100644 index 0000000..8162390 --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/ISVerveAdapter.m @@ -0,0 +1,185 @@ +// +// ISVerveAdapter.m +// ISVerveAdapter +// +// Copyright © 2024 ironSource Mobile Ltd. All rights reserved. +// + +#import "ISVerveAdapter.h" +#import "ISVerveConstants.h" +#import "ISVerveRewardedVideoAdapter.h" +#import "ISVerveInterstitialAdapter.h" +#import "ISVerveBannerAdapter.h" + +#import +#if __has_include() + #import +#else + #import "HyBid-Swift.h" +#endif + +// Handle init callback for all adapter instances +static InitState initState = INIT_STATE_NONE; +static ISConcurrentMutableSet *initCallbackDelegates = nil; + +@interface ISVerveAdapter() + +@end + +@implementation ISVerveAdapter + +#pragma mark - IronSource Protocol Methods + +// Get adapter version +- (NSString *)version { + return VerveAdapterVersion; +} + +// Get network sdk version +- (NSString *)sdkVersion { + return HyBid.sdkVersion; +} + +#pragma mark - Initializations Methods And Callbacks + +- (instancetype)initAdapter:(NSString *)name { + self = [super initAdapter:name]; + + if (self) { + if (initCallbackDelegates == nil) { + initCallbackDelegates = [ISConcurrentMutableSet set]; + } + + // Rewarded video + ISVerveRewardedVideoAdapter *rewardedVideoAdapter = [[ISVerveRewardedVideoAdapter alloc] initWithVerveAdapter:self]; + [self setRewardedVideoAdapter:rewardedVideoAdapter]; + + // Interstitial + ISVerveInterstitialAdapter *interstitialAdapter = [[ISVerveInterstitialAdapter alloc] initWithVerveAdapter:self]; + [self setInterstitialAdapter:interstitialAdapter]; + + //Banner + ISVerveBannerAdapter *bannerAdapter = [[ISVerveBannerAdapter alloc] initWithVerveAdapter:self]; + [self setBannerAdapter:bannerAdapter]; + + // The network's capability to load a Rewarded Video ad while another Rewarded Video ad of that network is showing + LWSState = LOAD_WHILE_SHOW_BY_NETWORK; + } + + return self; +} + +- (void)initSDKWithAppToken:(NSString *)appToken { + + // Add self to the init delegates only in case the initialization has not finished yet + if (initState == INIT_STATE_NONE || initState == INIT_STATE_IN_PROGRESS) { + [initCallbackDelegates addObject:self]; + } + + static dispatch_once_t initSdkOnceToken; + dispatch_once(&initSdkOnceToken, ^{ + LogAdapterApi_Internal(@"appToken = %@", appToken); + + initState = INIT_STATE_IN_PROGRESS; + [HyBid initWithAppToken:appToken + completion: ^(BOOL initSuccess){ + if(initSuccess) { + [self initializationSuccess]; + } + else { + [self initializationFailure]; + } + }]; + + }); +} + +- (void)initializationSuccess { + LogAdapterDelegate_Internal(@""); + + initState = INIT_STATE_SUCCESS; + + NSArray *initDelegatesList = initCallbackDelegates.allObjects; + + for (id initDelegate in initDelegatesList) { + [initDelegate onNetworkInitCallbackSuccess]; + } + + [initCallbackDelegates removeAllObjects]; +} + +- (void)initializationFailure { + LogAdapterDelegate_Internal(@""); + + initState = INIT_STATE_FAILED; + + NSArray* initDelegatesList = initCallbackDelegates.allObjects; + + for(id initDelegate in initDelegatesList){ + [initDelegate onNetworkInitCallbackFailed:@"Verve SDK init failed"]; + } + + [initCallbackDelegates removeAllObjects]; +} + +#pragma mark - Legal Methods + +- (void)setMetaDataWithKey:(NSString *)key + andValues:(NSMutableArray *)values { + if (values.count == 0) { + return; + } + + // This is an array of 1 value + NSString *value = values[0]; + LogAdapterApi_Internal(@"key = %@, value = %@", key, value); + + if ([ISMetaDataUtils isValidCCPAMetaDataWithKey:key + andValue:value]) { + [self setCCPAValue:[ISMetaDataUtils getMetaDataBooleanValue:value]]; + + } else { + NSString *formattedValue = [ISMetaDataUtils formatValue:value + forType:(META_DATA_VALUE_BOOL)]; + + if ([ISMetaDataUtils isValidMetaDataWithKey:key + flag:kMetaDataCOPPAKey + andValue:value]) { + [self setCOPPAValue:[ISMetaDataUtils getMetaDataBooleanValue:formattedValue]]; + } + } +} + +- (void)setCCPAValue:(BOOL)value { + LogAdapterApi_Internal(@"value = %@", value ? @"YES" : @"NO"); + + NSString *ccpaConsentString = value ? kMetaDataCCPAConsentValue : kMetaDataCCPANoConsentValue; + [[HyBidUserDataManager sharedInstance] setIABUSPrivacyString:ccpaConsentString]; + +} + +- (void)setCOPPAValue:(BOOL)value { + LogAdapterApi_Internal(@"value = %@", value ? @"YES" : @"NO"); + [HyBid setCoppa:value]; +} + +#pragma mark - Helper Methods + +- (InitState)getInitState { + return initState; +} + +- (void)collectBiddingDataWithDelegate:(id)delegate { + NSString *signal = [HyBid getCustomRequestSignalData:kMediation]; + if (signal && signal.length >= 0) { + NSDictionary *biddingDataDictionary = @{kMediationTokenKey: signal}; + NSString *returnedToken = signal ?: @""; + LogAdapterApi_Internal(@"%@ = %@", kMediationTokenKey, returnedToken); + [delegate successWithBiddingData:biddingDataDictionary]; + } + else{ + [delegate failureWithError:@"Token is nil or empty - Verve"]; + } +} + +@end diff --git a/Adapters/Verve/ISVerveAdapter/ISVerveConstants.h b/Adapters/Verve/ISVerveAdapter/ISVerveConstants.h new file mode 100644 index 0000000..4db96e1 --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/ISVerveConstants.h @@ -0,0 +1,26 @@ +// +// ISVerveConstants.h +// ISVerveAdapter +// +// Copyright © 2024 ironSource. All rights reserved. +// + +// Network keys +static NSString * const kAppToken = @"appToken"; +static NSString * const kZoneId = @"zoneId"; +static NSString * const kAdapterName = @"Verve"; +static NSString * const kMediation = @"lp"; +static NSString * const kMediationTokenKey = @"token"; + +// MetaData +static NSString * const kMetaDataCOPPAKey = @"LevelPlay_ChildDirected"; +static NSString * const kMetaDataCCPAConsentValue = @"1YY-"; +static NSString * const kMetaDataCCPANoConsentValue = @"1YN-"; + +// init state possible values +typedef NS_ENUM(NSInteger, InitState) { + INIT_STATE_NONE, + INIT_STATE_IN_PROGRESS, + INIT_STATE_SUCCESS, + INIT_STATE_FAILED +}; diff --git a/Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialAdapter.h b/Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialAdapter.h new file mode 100644 index 0000000..41b51f2 --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialAdapter.h @@ -0,0 +1,16 @@ +// +// ISVerveInterstitialAdapter.h +// ISVerveAdapter +// +// Copyright © 2024 ironSource. All rights reserved. +// + +#import +#import "ISVerveAdapter+Internal.h" + +@interface ISVerveInterstitialAdapter : ISBaseInterstitialAdapter + +- (instancetype)initWithVerveAdapter:(ISVerveAdapter *)adapter; + +@end + diff --git a/Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialAdapter.m b/Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialAdapter.m new file mode 100644 index 0000000..108343a --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialAdapter.m @@ -0,0 +1,158 @@ +// +// ISVerveInterstitialAdapter.m +// ISVerveAdapter +// +// Copyright © 2024 ironSource. All rights reserved. +// + +#import "ISVerveInterstitialAdapter.h" +#import "ISVerveInterstitialDelegate.h" + +@interface ISVerveInterstitialAdapter () + +@property (nonatomic, weak) ISVerveAdapter *adapter; +@property (nonatomic, strong) HyBidInterstitialAd *ad; +@property (nonatomic, strong) ISVerveInterstitialDelegate *verveAdDelegate; +@property (nonatomic, weak) id smashDelegate; + +@end + +@implementation ISVerveInterstitialAdapter + +- (instancetype)initWithVerveAdapter:(ISVerveAdapter *)adapter { + self = [super init]; + if (self) { + _adapter = adapter; + _ad = nil; + _smashDelegate = nil; + _verveAdDelegate = nil; + } + return self; +} + +#pragma mark - Interstitial API + +- (void)initInterstitialForBiddingWithUserId:(NSString *)userId + adapterConfig:(ISAdapterConfig *)adapterConfig + delegate:(id)delegate { + NSString *appToken = [self getStringValueFromAdapterConfig:adapterConfig + forKey:kAppToken]; + + /* Configuration Validation */ + if (![self.adapter isConfigValueValid:appToken]) { + NSError *error = [self.adapter errorForMissingCredentialFieldWithName:kAppToken]; + LogAdapterApi_Internal(@"error = %@", error); + [delegate adapterInterstitialInitFailedWithError:error]; + return; + } + + NSString *zoneId = [self getStringValueFromAdapterConfig:adapterConfig + forKey:kZoneId]; + /* Configuration Validation */ + if (![self.adapter isConfigValueValid:zoneId]) { + NSError *error = [self.adapter errorForMissingCredentialFieldWithName:kZoneId]; + LogAdapterApi_Internal(@"error = %@", error); + [delegate adapterInterstitialInitFailedWithError:error]; + return; + } + + self.smashDelegate = delegate; + + LogAdapterApi_Internal(@"appToken = %@, zoneId = %@", appToken, zoneId); + + switch ([self.adapter getInitState]) { + case INIT_STATE_NONE: + case INIT_STATE_IN_PROGRESS: + [self.adapter initSDKWithAppToken:appToken]; + break; + case INIT_STATE_SUCCESS: + [delegate adapterInterstitialInitSuccess]; + break; + case INIT_STATE_FAILED: + LogAdapterApi_Internal(@"init failed - adUnitId = %@", zoneId); + [delegate adapterInterstitialInitFailedWithError:[ISError createError:ERROR_CODE_INIT_FAILED + withMessage:@"Verve SDK init failed"]]; + break; + } +} + +- (NSString *)getZoneId:(ISAdapterConfig *)adapterConfig { + return [self getStringValueFromAdapterConfig:adapterConfig + forKey:kZoneId]; +} + +- (void)loadInterstitialForBiddingWithAdapterConfig:(ISAdapterConfig *)adapterConfig + adData:(NSDictionary *)adData + serverData:(NSString *)serverData + delegate:(id)delegate { + NSString *zoneId = [self getZoneId:adapterConfig]; + + LogAdapterApi_Internal(@"zoneId = %@", zoneId); + + // create interstitial ad delegate + ISVerveInterstitialDelegate *adDelegate = [[ISVerveInterstitialDelegate alloc] initWithZoneId:zoneId + andDelegate:delegate]; + self.verveAdDelegate = adDelegate; + self.ad = [[HyBidInterstitialAd alloc] initWithDelegate:adDelegate]; + [self.ad prepareAdWithContent:serverData]; +} + +- (void)showInterstitialWithViewController:(UIViewController *)viewController + adapterConfig:(ISAdapterConfig *)adapterConfig + delegate:(id)delegate { + NSString *zoneId = [self getZoneId:adapterConfig]; + + LogAdapterDelegate_Internal(@"zoneId = %@", zoneId); + + if (![self hasInterstitialWithAdapterConfig:adapterConfig]) { + + NSError *error = [ISError createError:ERROR_CODE_NO_ADS_TO_SHOW + withMessage:[NSString stringWithFormat: @"%@ show failed", kAdapterName]]; + LogAdapterApi_Internal(@"error = %@", error); + [delegate adapterInterstitialDidFailToShowWithError:error]; + return; + } + + dispatch_async(dispatch_get_main_queue(), ^{ + [self.ad showFromViewController: viewController]; + }); + +} + +- (BOOL)hasInterstitialWithAdapterConfig:(ISAdapterConfig *)adapterConfig { + return self.ad != nil && self.ad.isReady; +} + + +- (void)collectInterstitialBiddingDataWithAdapterConfig:(ISAdapterConfig *)adapterConfig + adData:(NSDictionary *)adData + delegate:(id)delegate { + [self.adapter collectBiddingDataWithDelegate:delegate]; +} + +#pragma mark - Init Delegate + +- (void)onNetworkInitCallbackSuccess { + [self.smashDelegate adapterInterstitialInitSuccess]; +} + +- (void)onNetworkInitCallbackFailed:(NSString *)errorMessage { + NSError *error = [ISError createErrorWithDomain:kAdapterName + code:ERROR_CODE_INIT_FAILED + message:errorMessage]; + [self.smashDelegate adapterInterstitialInitFailedWithError:error]; +} + +#pragma mark - Memory Handling + +- (void)releaseMemoryWithAdapterConfig:(ISAdapterConfig *)adapterConfig { + NSString *zoneId = [self getStringValueFromAdapterConfig:adapterConfig + forKey:kZoneId]; + LogAdapterDelegate_Internal(@"zoneId = %@", zoneId); + + self.ad = nil; + self.smashDelegate = nil; + self.verveAdDelegate = nil; +} + +@end diff --git a/Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialDelegate.h b/Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialDelegate.h new file mode 100644 index 0000000..71bf04e --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialDelegate.h @@ -0,0 +1,25 @@ +// +// ISVerveInterstitialDelegate.h +// ISVerveAdapter +// +// Copyright © 2024 ironSource Mobile Ltd. All rights reserved. +// + +#import +#import +#import "ISVerveInterstitialAdapter.h" +#if __has_include() + #import +#else + #import "HyBid-Swift.h" +#endif + +@interface ISVerveInterstitialDelegate : NSObject + +@property (nonatomic, strong) NSString *zoneId; +@property (nonatomic, weak) id delegate; + +- (instancetype)initWithZoneId:(NSString *)adUnitId + andDelegate:(id)delegate; + +@end diff --git a/Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialDelegate.m b/Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialDelegate.m new file mode 100644 index 0000000..253bfe6 --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/Interstitial/ISVerveInterstitialDelegate.m @@ -0,0 +1,58 @@ +// +// ISVerveInterstitialDelegate.m +// ISVerveAdapter +// +// Copyright © 2024 ironSource Mobile Ltd. All rights reserved. +// + +#import "ISVerveInterstitialDelegate.h" + +@implementation ISVerveInterstitialDelegate + +- (instancetype)initWithZoneId:(NSString *)zoneId + andDelegate:(id)delegate { + self = [super init]; + if (self) { + _zoneId = zoneId; + _delegate = delegate; + } + return self; +} + +/// calls this method when ad successfully loaded and ready to be displayed. +- (void)interstitialDidLoad { + LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); + [self.delegate adapterInterstitialDidLoad]; +} + +/// calls this method when ad was not loaded for some reasons +/// @param error the reason of failing loading +- (void)interstitialDidFailWithError:(NSError * _Null_unspecified)error { + LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); + NSError *smashError = error.code == HyBidErrorCodeNoFill ? [ISError createError:ERROR_IS_LOAD_NO_FILL + withMessage:@"Verve no fill"] : error; + + [self.delegate adapterInterstitialDidFailToLoadWithError:smashError]; +} + +/// calls this method when user clicked on the ad +- (void)interstitialDidTrackClick { + LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); + [self.delegate adapterInterstitialDidClick]; +} + +/// calls this method when ad was dismissed by user action using the close button +- (void)interstitialDidDismiss { + LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); + [self.delegate adapterInterstitialDidClose]; +} + +/// calls this method when ad has been presented to the user +- (void)interstitialDidTrackImpression { + LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); + [self.delegate adapterInterstitialDidOpen]; + [self.delegate adapterInterstitialDidShow]; + [self.delegate adapterInterstitialDidBecomeVisible]; +} + +@end diff --git a/Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoAdapter.h b/Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoAdapter.h new file mode 100644 index 0000000..b8f66bc --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoAdapter.h @@ -0,0 +1,15 @@ +// +// ISVerveRewardedVideoAdapter.h +// ISVerveAdapter +// +// Copyright © 2024 ironSource. All rights reserved. +// + +#import +#import "ISVerveAdapter+Internal.h" + +@interface ISVerveRewardedVideoAdapter : ISBaseRewardedVideoAdapter + +- (instancetype)initWithVerveAdapter:(ISVerveAdapter *)adapter; + +@end diff --git a/Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoAdapter.m b/Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoAdapter.m new file mode 100644 index 0000000..858645d --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoAdapter.m @@ -0,0 +1,162 @@ +// +// ISVerveRewardedVideoAdapter.m +// ISVerveAdapter +// +// Copyright © 2024 ironSource. All rights reserved. +// + +#import "ISVerveRewardedVideoAdapter.h" +#import "ISVerveRewardedVideoDelegate.h" + +@interface ISVerveRewardedVideoAdapter () + +@property (nonatomic, weak) ISVerveAdapter *adapter; +@property (nonatomic, strong) HyBidRewardedAd *ad; +@property (nonatomic, strong) ISVerveRewardedVideoDelegate *verveAdDelegate; +@property (nonatomic, weak) id smashDelegate; + +@end + +@implementation ISVerveRewardedVideoAdapter + +- (instancetype)initWithVerveAdapter:(ISVerveAdapter *)adapter { + self = [super init]; + if (self) { + _adapter = adapter; + _ad = nil; + _smashDelegate = nil; + _verveAdDelegate = nil; + } + return self; +} + +#pragma mark - Rewarded Video API + +// Used for flows when the mediation needs to get a callback for init +- (void)initRewardedVideoForCallbacksWithUserId:(NSString *)userId + adapterConfig:(ISAdapterConfig *)adapterConfig + delegate:(id)delegate { + NSString *appToken = [self getStringValueFromAdapterConfig:adapterConfig + forKey:kAppToken]; + /* Configuration Validation */ + if (![self.adapter isConfigValueValid:appToken]) { + NSError *error = [self.adapter errorForMissingCredentialFieldWithName:kAppToken]; + LogAdapterApi_Internal(@"error = %@", error); + [delegate adapterRewardedVideoInitFailed:error]; + return; + } + + NSString *adUnitId = [self getStringValueFromAdapterConfig:adapterConfig + forKey:kZoneId]; + /* Configuration Validation */ + if (![self.adapter isConfigValueValid:adUnitId]) { + NSError *error = [self.adapter errorForMissingCredentialFieldWithName:kZoneId]; + LogAdapterApi_Internal(@"error = %@", error); + [delegate adapterRewardedVideoInitFailed:error]; + return; + } + + self.smashDelegate = delegate; + + LogAdapterApi_Internal(@"appToken = %@, adUnitId = %@", appToken, adUnitId); + + switch ([self.adapter getInitState]) { + case INIT_STATE_NONE: + case INIT_STATE_IN_PROGRESS: + [self.adapter initSDKWithAppToken:appToken]; + break; + case INIT_STATE_SUCCESS: + [delegate adapterRewardedVideoInitSuccess]; + break; + + case INIT_STATE_FAILED: + LogAdapterApi_Internal(@"init failed - adUnitId = %@", adUnitId); + [delegate adapterRewardedVideoInitFailed:[ISError createError:ERROR_CODE_INIT_FAILED + withMessage:@"Verve SDK init failed"]]; + break; + } +} + +- (NSString *)getZoneId:(ISAdapterConfig *)adapterConfig { + return [self getStringValueFromAdapterConfig:adapterConfig + forKey:kZoneId]; +} + +- (void)loadRewardedVideoForBiddingWithAdapterConfig:(ISAdapterConfig *)adapterConfig + adData:(NSDictionary *)adData + serverData:(NSString *)serverData + delegate:(id)delegate { + NSString *zoneId = [self getZoneId:adapterConfig]; + + LogAdapterApi_Internal(@"zoneId = %@", zoneId); + + // create rewarded ad delegate + ISVerveRewardedVideoDelegate *adDelegate = [[ISVerveRewardedVideoDelegate alloc] initWithZoneId:zoneId + andDelegate:delegate]; + + self.verveAdDelegate = adDelegate; + self.ad = [[HyBidRewardedAd alloc] initWithDelegate:adDelegate]; + + [self.ad prepareAdWithContent:serverData]; + +} + +- (void)showRewardedVideoWithViewController:(UIViewController *)viewController + adapterConfig:(ISAdapterConfig *)adapterConfig + delegate:(id)delegate { + + NSString *zoneId = [self getZoneId:adapterConfig]; + + LogAdapterDelegate_Internal(@"zoneId = %@", zoneId); + + if (![self hasRewardedVideoWithAdapterConfig:adapterConfig]) { + NSError *error = [ISError createError:ERROR_CODE_NO_ADS_TO_SHOW + withMessage:[NSString stringWithFormat: @"%@ show failed", kAdapterName]]; + LogAdapterApi_Internal(@"error = %@", error); + [delegate adapterRewardedVideoDidFailToShowWithError:error]; + return; + } + + dispatch_async(dispatch_get_main_queue(), ^{ + [self.ad showFromViewController: viewController]; + }); + +} + +- (BOOL)hasRewardedVideoWithAdapterConfig:(ISAdapterConfig *)adapterConfig { + return self.ad != nil && [self.ad isReady]; +} + +- (void)collectRewardedVideoBiddingDataWithAdapterConfig:(ISAdapterConfig *)adapterConfig + adData:(NSDictionary *)adData + delegate:(id)delegate { + + [self.adapter collectBiddingDataWithDelegate:delegate]; +} + +#pragma mark - Init Delegate + +- (void)onNetworkInitCallbackSuccess { + [self.smashDelegate adapterRewardedVideoInitSuccess]; +} + +- (void)onNetworkInitCallbackFailed:(NSString *)errorMessage { + NSError *error = [ISError createErrorWithDomain:kAdapterName + code:ERROR_CODE_INIT_FAILED + message:errorMessage]; + [self.smashDelegate adapterRewardedVideoInitFailed:error]; +} + +#pragma mark - Memory Handling + +- (void)releaseMemoryWithAdapterConfig:(ISAdapterConfig *)adapterConfig { + NSString *zoneId = [self getStringValueFromAdapterConfig:adapterConfig + forKey:kZoneId]; + LogAdapterDelegate_Internal(@"zoneId = %@", zoneId); + + self.ad = nil; + self.smashDelegate = nil; + self.verveAdDelegate = nil; +} + +@end diff --git a/Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoDelegate.h b/Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoDelegate.h new file mode 100644 index 0000000..83ab937 --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoDelegate.h @@ -0,0 +1,22 @@ +// +// ISVerveRewardedVideoDelegate.h +// ISVerveAdapter +// +// Copyright © 2024 ironSource Mobile Ltd. All rights reserved. +// + +#import +#import +#import "ISVerveRewardedVideoAdapter.h" +#import + + +@interface ISVerveRewardedVideoDelegate : NSObject + +@property (nonatomic, strong) NSString *zoneId; +@property (nonatomic, weak) id delegate; + +- (instancetype)initWithZoneId:(NSString *)zoneId + andDelegate:(id)delegate; + +@end diff --git a/Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoDelegate.m b/Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoDelegate.m new file mode 100644 index 0000000..86b3d2f --- /dev/null +++ b/Adapters/Verve/ISVerveAdapter/RewardedVideo/ISVerveRewardedVideoDelegate.m @@ -0,0 +1,66 @@ +// +// ISVerveRewardedVideoDelegate.m +// ISVerveAdapter +// +// Copyright © 2024 ironSource Mobile Ltd. All rights reserved. +// + +#import "ISVerveRewardedVideoDelegate.h" + +@implementation ISVerveRewardedVideoDelegate + +- (instancetype)initWithZoneId:(NSString *)zoneId + andDelegate:(id)delegate { + + self = [super init]; + if (self) { + _zoneId = zoneId; + _delegate = delegate; + } + return self; +} + +/// calls this method when ad successfully loaded and ready to be displayed. +- (void)rewardedDidLoad { + LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); + [self.delegate adapterRewardedVideoHasChangedAvailability:YES]; +} + +/// calls this method when ad was not loaded for some reasons +/// @param error the reason of failing loading +- (void)rewardedDidFailWithError:(NSError * _Null_unspecified)error { + LogAdapterDelegate_Internal(@"zoneId = %@ with error = %@", self.zoneId, error); + + NSError *smashError = error.code == HyBidErrorCodeNoFill ? [ISError createError:ERROR_RV_LOAD_NO_FILL + withMessage:@"Verve no fill"] : error; + [self.delegate adapterRewardedVideoHasChangedAvailability:NO]; + [self.delegate adapterRewardedVideoDidFailToLoadWithError:smashError]; +} + +/// calls this method when ad has been presented to the user +- (void)rewardedDidTrackImpression { + LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); + [self.delegate adapterRewardedVideoDidOpen]; + [self.delegate adapterRewardedVideoDidStart]; +} + +/// calls this method when user clicked on the ad +- (void)rewardedDidTrackClick { + LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); + [self.delegate adapterRewardedVideoDidClick]; +} + +/// calls this method when the user has finished watching the video and endcards if they exist +- (void)onReward { + LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); + [self.delegate adapterRewardedVideoDidEnd]; + [self.delegate adapterRewardedVideoDidReceiveReward]; +} + +/// calls this method when ad was dismissed by user action using the close button +- (void)rewardedDidDismiss { + LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); + [self.delegate adapterRewardedVideoDidClose]; +} + +@end diff --git a/Adapters/Verve/Podfile b/Adapters/Verve/Podfile new file mode 100644 index 0000000..cbd1d1e --- /dev/null +++ b/Adapters/Verve/Podfile @@ -0,0 +1,9 @@ +# Uncomment the next line to define a global platform for your project +platform :ios, '12.0' +use_frameworks! + +target 'ISVerveAdapter' do + pod 'IronSourceSDK','8.3.0.0' + pod 'HyBid', '3.0.4' + +end