diff --git a/EventHandlers/EventHandlers.xcodeproj/project.pbxproj b/EventHandlers/EventHandlers.xcodeproj/project.pbxproj index e1d378ca2..6eb9d7457 100644 --- a/EventHandlers/EventHandlers.xcodeproj/project.pbxproj +++ b/EventHandlers/EventHandlers.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -1200,7 +1200,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 2.1.6; + CURRENT_PROJECT_VERSION = 2.2.0; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1214,7 +1214,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.6; + MARKETING_VERSION = 2.2.0; MODULEMAP_FILE = ""; PRODUCT_BUNDLE_IDENTIFIER = org.prebid.mobile.PrebidMobileGAMEventHandlers; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -1235,7 +1235,7 @@ CLANG_ENABLE_MODULES = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 2.1.6; + CURRENT_PROJECT_VERSION = 2.2.0; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1249,7 +1249,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.6; + MARKETING_VERSION = 2.2.0; MODULEMAP_FILE = ""; PRODUCT_BUNDLE_IDENTIFIER = org.prebid.mobile.PrebidMobileGAMEventHandlers; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -1269,7 +1269,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2.1.6; + CURRENT_PROJECT_VERSION = 2.2.0; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1284,7 +1284,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.6; + MARKETING_VERSION = 2.2.0; PRODUCT_BUNDLE_IDENTIFIER = org.prebid.mobile.PrebidMobileMAXAdapters; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1304,7 +1304,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2.1.6; + CURRENT_PROJECT_VERSION = 2.2.0; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1319,7 +1319,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.6; + MARKETING_VERSION = 2.2.0; PRODUCT_BUNDLE_IDENTIFIER = org.prebid.mobile.PrebidMobileMAXAdapters; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -1381,7 +1381,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2.1.6; + CURRENT_PROJECT_VERSION = 2.2.0; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1395,7 +1395,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.6; + MARKETING_VERSION = 2.2.0; PRODUCT_BUNDLE_IDENTIFIER = org.prebid.mobile.PrebidMobileAdMobAdapters; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = None; @@ -1416,7 +1416,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2.1.6; + CURRENT_PROJECT_VERSION = 2.2.0; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1430,7 +1430,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.6; + MARKETING_VERSION = 2.2.0; PRODUCT_BUNDLE_IDENTIFIER = org.prebid.mobile.PrebidMobileAdMobAdapters; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = None; diff --git a/PrebidMobile.podspec b/PrebidMobile.podspec index 777fc2676..0fcdfc431 100644 --- a/PrebidMobile.podspec +++ b/PrebidMobile.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PrebidMobile" - s.version = "2.1.6" + s.version = "2.2.0" s.summary = "PrebidMobile is a lightweight framework that integrates directly with Prebid Server." s.description = <<-DESC diff --git a/PrebidMobile.xcodeproj/project.pbxproj b/PrebidMobile.xcodeproj/project.pbxproj index 317e3eeab..f492191e8 100644 --- a/PrebidMobile.xcodeproj/project.pbxproj +++ b/PrebidMobile.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -4455,7 +4455,7 @@ CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; - CURRENT_PROJECT_VERSION = 2.1.6; + CURRENT_PROJECT_VERSION = 2.2.0; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; @@ -4474,7 +4474,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.6; + MARKETING_VERSION = 2.2.0; MODULEMAP_FILE = PrebidMobile/BuildFiles/PrebidMobile.modulemap; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -4491,7 +4491,7 @@ CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; - CURRENT_PROJECT_VERSION = 2.1.6; + CURRENT_PROJECT_VERSION = 2.2.0; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; @@ -4510,7 +4510,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.6; + MARKETING_VERSION = 2.2.0; MODULEMAP_FILE = PrebidMobile/BuildFiles/PrebidMobile.modulemap; SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; diff --git a/PrebidMobile/AdUnits/AdUnit.swift b/PrebidMobile/AdUnits/AdUnit.swift index b40f2aa9c..9e6cce229 100644 --- a/PrebidMobile/AdUnits/AdUnit.swift +++ b/PrebidMobile/AdUnits/AdUnit.swift @@ -24,7 +24,7 @@ public class AdUnit: NSObject, DispatcherDelegate { var adSizes: [CGSize] { get { [adUnitConfig.adSize] + (adUnitConfig.additionalSizes ?? []) } } - + private static let PB_MIN_RefreshTime = 30000.0 private(set) var dispatcher: Dispatcher? @@ -387,6 +387,16 @@ public class AdUnit: NSObject, DispatcherDelegate { return adUnitConfig.gpid } + // MARK: Global ORTBObject + + public func setOrtbConfig(_ ortbObject: [String: Any]?) { + adUnitConfig.ortbConfig = ortbObject + } + + public func getOrtbConfig() -> [String: Any]? { + return adUnitConfig.ortbConfig + } + // MARK: - others /** diff --git a/PrebidMobile/AdUnits/MultiformatAdUnit/PrebidRequest.swift b/PrebidMobile/AdUnits/MultiformatAdUnit/PrebidRequest.swift index ce43ed397..c55b661dc 100644 --- a/PrebidMobile/AdUnits/MultiformatAdUnit/PrebidRequest.swift +++ b/PrebidMobile/AdUnits/MultiformatAdUnit/PrebidRequest.swift @@ -29,6 +29,8 @@ public class PrebidRequest: NSObject { private(set) var gpid: String? + private(set) var ortbConfig: [String: Any]? + // MARK: - Private properties private var extData = [String: Set]() diff --git a/PrebidMobile/AdUnits/Native/NativeAd.swift b/PrebidMobile/AdUnits/Native/NativeAd.swift index 242098d98..39e59b27d 100644 --- a/PrebidMobile/AdUnits/Native/NativeAd.swift +++ b/PrebidMobile/AdUnits/Native/NativeAd.swift @@ -176,10 +176,14 @@ public class NativeAd: NSObject, CacheExpiryDelegate { Log.error("The native Ad is expired, cannot use it for tracking") return false } - viewForTracking = view - setupViewabilityTracker() - attachGestureRecognizersToNativeView(nativeView: view, withClickableViews: clickableViews) - return true + if (viewForTracking != nil || impressionHasBeenTracked) { + return false + } else { + viewForTracking = view + setupViewabilityTracker() + attachGestureRecognizersToNativeView(nativeView: view, withClickableViews: clickableViews) + return true + } } private func unregisterViewFromTracking() { @@ -219,6 +223,9 @@ public class NativeAd: NSObject, CacheExpiryDelegate { return } strongSelf.checkViewability() + if (strongSelf.viewForTracking == nil) { + timer.invalidate() + } } } diff --git a/PrebidMobile/Constants.swift b/PrebidMobile/Constants.swift index dd952d83d..81334a91c 100644 --- a/PrebidMobile/Constants.swift +++ b/PrebidMobile/Constants.swift @@ -18,7 +18,7 @@ import UIKit public let PrebidLocalCacheIdKey = "hb_cache_id_local" @objc public class Constants: NSObject { - @objc public static let PREBID_VERSION = "2.1.6" + @objc public static let PREBID_VERSION = "2.2.0" } extension String { diff --git a/PrebidMobile/PrebidMobileRendering/AdTypes/AdView/AdConfiguration.swift b/PrebidMobile/PrebidMobileRendering/AdTypes/AdView/AdConfiguration.swift index a335cb37d..7ff3c52f9 100644 --- a/PrebidMobile/PrebidMobileRendering/AdTypes/AdView/AdConfiguration.swift +++ b/PrebidMobile/PrebidMobileRendering/AdTypes/AdView/AdConfiguration.swift @@ -122,7 +122,10 @@ public class AdConfiguration: AutoRefreshCountConfig { public var clickHandlerOverride: ((PBMVoidBlock) -> Void)? + public var ortbConfig: [String: Any]? + // MARK: Private properties private var _autoRefreshDelay: TimeInterval? = PBMAutoRefresh.AUTO_REFRESH_DELAY_DEFAULT + } diff --git a/PrebidMobile/PrebidMobileRendering/Networking/Parameters/PBMParameterBuilderService.m b/PrebidMobile/PrebidMobileRendering/Networking/Parameters/PBMParameterBuilderService.m index 2a8ec47b1..d0b5b55d9 100644 --- a/PrebidMobile/PrebidMobileRendering/Networking/Parameters/PBMParameterBuilderService.m +++ b/PrebidMobile/PrebidMobileRendering/Networking/Parameters/PBMParameterBuilderService.m @@ -45,6 +45,7 @@ @implementation PBMParameterBuilderService } + (nonnull NSDictionary *)buildParamsDictWithAdConfiguration:(nonnull PBMAdConfiguration *)adConfiguration extraParameterBuilders:(nullable NSArray > *)extraParameterBuilders { + //build return [self buildParamsDictWithAdConfiguration:adConfiguration bundle:NSBundle.mainBundle pbmLocationManager:PBMLocationManager.shared @@ -71,6 +72,7 @@ @implementation PBMParameterBuilderService extraParameterBuilders:(nullable NSArray > *)extraParameterBuilders{ PBMORTBBidRequest *bidRequest = [PBMParameterBuilderService createORTBBidRequestWithTargeting:targeting]; + bidRequest.ortbObject = adConfiguration.ortbConfig; NSMutableArray > * const parameterBuilders = [[NSMutableArray alloc] init]; [parameterBuilders addObjectsFromArray:@[ [[PBMBasicParameterBuilder alloc] initWithAdConfiguration:adConfiguration @@ -109,7 +111,7 @@ + (nonnull PBMORTBBidRequest *)createORTBBidRequestWithTargeting:(nonnull Target bidRequest.user.buyeruid = targeting.buyerUID; bidRequest.user.customdata = targeting.userCustomData; bidRequest.user.userid = targeting.userID; - + if (targeting.userExt) { bidRequest.user.ext = [targeting.userExt mutableCopy]; } diff --git a/PrebidMobile/PrebidMobileRendering/ORTB/PBMORTBBidRequest.h b/PrebidMobile/PrebidMobileRendering/ORTB/PBMORTBBidRequest.h index 7657bfd28..5ffe3c662 100644 --- a/PrebidMobile/PrebidMobileRendering/ORTB/PBMORTBBidRequest.h +++ b/PrebidMobile/PrebidMobileRendering/ORTB/PBMORTBBidRequest.h @@ -135,6 +135,10 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong) PBMORTBBidRequestExtPrebid *extPrebid; +@property (nonatomic, strong, nullable) NSDictionary *arbitraryJsonConfig; + +@property (nonatomic, strong, nullable) NSDictionary *ortbObject; + - (instancetype)init; @end diff --git a/PrebidMobile/PrebidMobileRendering/ORTB/PBMORTBBidRequest.m b/PrebidMobile/PrebidMobileRendering/ORTB/PBMORTBBidRequest.m index d8299b584..ac0220cec 100644 --- a/PrebidMobile/PrebidMobileRendering/ORTB/PBMORTBBidRequest.m +++ b/PrebidMobile/PrebidMobileRendering/ORTB/PBMORTBBidRequest.m @@ -68,6 +68,58 @@ - (nonnull PBMJsonDictionary *)toJsonDictionary { ext[@"prebid"] = [[self.extPrebid toJsonDictionary] nullIfEmpty]; ret[@"ext"] = [[ext pbmCopyWithoutEmptyVals] nullIfEmpty]; + //remove "protected" fields from ortbObject then do a merge but merge ret into the ortbObject (addEntriesFromDictionary) + NSMutableDictionary *o = [self.arbitraryJsonConfig mutableCopy]; + if (o[@"regs"]) { + o[@"regs"] = nil; + } + if (o[@"device"]) { + o[@"device"] = nil; + } + if (o[@"geo"]) { + o[@"geo"] = nil; + } + //merge with config from API/JSON + ret = [self mergeDictionaries: ret joiningArgument2: o joiningArgument3: false]; + + NSMutableDictionary *o2 = [self.ortbObject mutableCopy]; + + if (o2[@"regs"]) { + o2[@"regs"] = nil; + } + if (o2[@"device"]) { + o2[@"device"] = nil; + } + if (o2[@"geo"]) { + o[@"geo"] = nil; + } + //merge with ortbConfig from SDK + ret = [self mergeDictionaries: ret joiningArgument2: o2 joiningArgument3: true]; + + ret = [ret pbmCopyWithoutEmptyVals]; + + return ret; +} + +- (nonnull PBMMutableJsonDictionary *)mergeDictionaries:(NSMutableDictionary*)dictionary1 joiningArgument2:(NSMutableDictionary*)dictionary2 + joiningArgument3:(Boolean)firstHasPriority{ + PBMMutableJsonDictionary *ret = dictionary1; + + for (id key in dictionary2) + if ([ret objectForKey: key]){ + if ([[ret objectForKey: key] isKindOfClass: [NSDictionary class]]) { + //if is dictionary, need to call this method recursively for ret object for key and dictionary2 for key + [ret setObject:[self mergeDictionaries:[ret objectForKey: key] joiningArgument2: [dictionary2 objectForKey: key] joiningArgument3:firstHasPriority] forKey: key]; + } else { + if (!firstHasPriority) { + [ret setObject:[dictionary2 objectForKey: key] forKey:key]; + } + } + //not sure what to do if array of objects + } else { + [ret setObject:[dictionary2 objectForKey:key] forKey: key]; + } + ret = [ret pbmCopyWithoutEmptyVals]; return ret; @@ -98,6 +150,8 @@ - (instancetype)initWithJsonDictionary:(nonnull PBMJsonDictionary *)jsonDictiona _extPrebid = [[PBMORTBBidRequestExtPrebid alloc] initWithJsonDictionary:jsonDictionary[@"ext"][@"prebid"] ?: @{}]; + _arbitraryJsonConfig = jsonDictionary; + return self; } diff --git a/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/GAM/BannerView.swift b/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/GAM/BannerView.swift index 44d2fe020..9a7f1a728 100644 --- a/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/GAM/BannerView.swift +++ b/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/GAM/BannerView.swift @@ -64,6 +64,11 @@ public class BannerView: UIView, set { adUnitConfig.adPosition = newValue } } + @objc public var ortbConfig: [String: Any]? { + get { adUnitConfig.ortbConfig } + set { adUnitConfig.ortbConfig = newValue } + } + @objc public weak var delegate: BannerViewDelegate? // MARK: Readonly storage diff --git a/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/GAM/BaseInterstitialAdUnit.swift b/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/GAM/BaseInterstitialAdUnit.swift index 512ba7815..5cf72df16 100644 --- a/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/GAM/BaseInterstitialAdUnit.swift +++ b/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/GAM/BaseInterstitialAdUnit.swift @@ -46,6 +46,11 @@ public class BaseInterstitialAdUnit : get { adUnitConfig.adFormats } set { adUnitConfig.adFormats = newValue } } + + @objc public var ortbConfig: [String: Any]? { + get { adUnitConfig.ortbConfig } + set { adUnitConfig.ortbConfig = newValue } + } @objc public var isReady: Bool { objc_sync_enter(blocksLockToken) diff --git a/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/MediationAPI/MediationBannerAdUnit.swift b/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/MediationAPI/MediationBannerAdUnit.swift index e3f708acf..87e3b2639 100644 --- a/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/MediationAPI/MediationBannerAdUnit.swift +++ b/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/MediationAPI/MediationBannerAdUnit.swift @@ -70,6 +70,11 @@ public class MediationBannerAdUnit : NSObject { set { adUnitConfig.additionalSizes = newValue } } + public var ortbConfig: [String: Any]? { + get { adUnitConfig.ortbConfig } + set { adUnitConfig.ortbConfig = newValue } + } + // MARK: - Ext Data (imp[].ext.data) @available(*, deprecated, message: "This method is deprecated. Please, use addExtData method instead.") diff --git a/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/MediationAPI/MediationBaseInterstitialAdUnit.swift b/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/MediationAPI/MediationBaseInterstitialAdUnit.swift index 1c148666b..8e5e311cc 100644 --- a/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/MediationAPI/MediationBaseInterstitialAdUnit.swift +++ b/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/MediationAPI/MediationBaseInterstitialAdUnit.swift @@ -45,6 +45,11 @@ public class MediationBaseInterstitialAdUnit : NSObject { set { adUnitConfig.adConfiguration.videoControlsConfig.closeButtonPosition = newValue } } + public var ortbConfig: [String: Any]? { + get { adUnitConfig.ortbConfig } + set { adUnitConfig.ortbConfig = newValue } + } + let adUnitConfig: AdUnitConfig public var configId: String { diff --git a/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/MediationAPI/MediationNativeAdUnit.swift b/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/MediationAPI/MediationNativeAdUnit.swift index 2cfaaf405..ea28d27b3 100644 --- a/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/MediationAPI/MediationNativeAdUnit.swift +++ b/PrebidMobile/PrebidMobileRendering/Prebid/Integrations/MediationAPI/MediationNativeAdUnit.swift @@ -79,6 +79,15 @@ public class MediationNativeAdUnit : NSObject { nativeAdUnit.ext = ext } + public func getOrtbConfig() -> [String: Any]? { + return nativeAdUnit.getOrtbConfig() + } + + public func setOrtbConfig(_ ortbConfig: [String: Any]?) { + nativeAdUnit.setOrtbConfig(ortbConfig) + } + + // MARK: - App Content (app.content.data) public func setAppContent(_ appContent: PBMORTBAppContent) { diff --git a/PrebidMobile/PrebidMobileRendering/Prebid/PBMCore/AdUnitConfig.swift b/PrebidMobile/PrebidMobileRendering/Prebid/PBMCore/AdUnitConfig.swift index dae70398e..1eb1b18cc 100644 --- a/PrebidMobile/PrebidMobileRendering/Prebid/PBMCore/AdUnitConfig.swift +++ b/PrebidMobile/PrebidMobileRendering/Prebid/PBMCore/AdUnitConfig.swift @@ -79,7 +79,12 @@ public class AdUnitConfig: NSObject, NSCopying { } public var gpid: String? - + + public var ortbConfig: [String: Any]? { + get {adConfiguration.ortbConfig} + set {adConfiguration.ortbConfig = newValue} + } + // MARK: - Public Methods public convenience init(configId: String) { diff --git a/PrebidMobile/UIViewExtension.swift b/PrebidMobile/UIViewExtension.swift index bb0cb0915..8536498d2 100644 --- a/PrebidMobile/UIViewExtension.swift +++ b/PrebidMobile/UIViewExtension.swift @@ -39,7 +39,7 @@ extension UIView { } let screenRect = UIScreen.main.bounds - let normalizedSelfRect = convert(screenRect, to: nil) + let normalizedSelfRect = convert(self.bounds, to: nil) let intersection = screenRect.intersection(normalizedSelfRect) if intersection.equalTo(.null) { return false diff --git a/PrebidMobileAdMobAdapters.podspec b/PrebidMobileAdMobAdapters.podspec index 4d6cc86f3..4b6eb9218 100644 --- a/PrebidMobileAdMobAdapters.podspec +++ b/PrebidMobileAdMobAdapters.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PrebidMobileAdMobAdapters" - s.version = "2.1.6" + s.version = "2.2.0" s.summary = "The bridge between PrebidMobile SDK and GMA SDK." s.description = "AdMob Adatpers manages rendering of Prebid ads in the case of integration with AdMob as a Primary Ad Server." @@ -40,7 +40,7 @@ Pod::Spec.new do |s| s.static_framework = true - s.dependency 'PrebidMobile', '2.1.6' + s.dependency 'PrebidMobile', '2.2.0' s.dependency 'Google-Mobile-Ads-SDK' end diff --git a/PrebidMobileGAMEventHandlers.podspec b/PrebidMobileGAMEventHandlers.podspec index d0a8dcfb3..da9707fa2 100644 --- a/PrebidMobileGAMEventHandlers.podspec +++ b/PrebidMobileGAMEventHandlers.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PrebidMobileGAMEventHandlers" - s.version = "2.1.6" + s.version = "2.2.0" s.summary = "The bridge between PrebidMobile SDK and GMA SDK." s.description = "GAM Event Handlers manages rendering of Prebid or GAM ads respectively to the winning bid." @@ -39,7 +39,7 @@ Pod::Spec.new do |s| s.source_files = 'EventHandlers/PrebidMobileGAMEventHandlers/**/*.{h,m,swift}' s.static_framework = true - s.dependency 'PrebidMobile', '2.1.6' + s.dependency 'PrebidMobile', '2.2.0' s.dependency 'Google-Mobile-Ads-SDK' end diff --git a/PrebidMobileMAXAdapters.podspec b/PrebidMobileMAXAdapters.podspec index 328615be4..e2e49b117 100644 --- a/PrebidMobileMAXAdapters.podspec +++ b/PrebidMobileMAXAdapters.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PrebidMobileMAXAdapters" - s.version = "2.1.6" + s.version = "2.2.0" s.summary = "The bridge between PrebidMobile SDK and Applovin MAX SDK." s.description = "MAX Adapters manages rendering of Prebid or MAX ads respectively to the winning bid." @@ -39,7 +39,7 @@ Pod::Spec.new do |s| s.source_files = 'EventHandlers/PrebidMobileMAXAdapters/**/*.{h,m,swift}' s.static_framework = true - s.dependency 'PrebidMobile', '2.1.6' + s.dependency 'PrebidMobile', '2.2.0' s.dependency 'AppLovinSDK' end diff --git a/PrebidMobileTests/RenderingTests/Tests/PBMORTBAbstractTest.swift b/PrebidMobileTests/RenderingTests/Tests/PBMORTBAbstractTest.swift index 126b33a5c..015bb035a 100644 --- a/PrebidMobileTests/RenderingTests/Tests/PBMORTBAbstractTest.swift +++ b/PrebidMobileTests/RenderingTests/Tests/PBMORTBAbstractTest.swift @@ -174,6 +174,11 @@ class PBMORTBAbstractTest : XCTestCase { pbmORTBBidRequest.test = 2 codeAndDecode(abstract: pbmORTBBidRequest, expectedString: "{\"id\":\"\(uuid)\",\"imp\":[{\"clickbrowser\":0,\"ext\":{\"dlp\":1},\"instl\":0,\"secure\":0}],\"test\":2,\"tmax\":2000}") + + pbmORTBBidRequest.ortbObject = ["arbitraryparamkey1": "arbitraryparamvalue1", "tmax": 3000, "id": "1231234", "imp": ["hi": "hello"]] + + codeAndDecode(abstract: pbmORTBBidRequest, expectedString: "{\"arbitraryparamkey1\":\"arbitraryparamvalue1\",\"id\":\"\(uuid)\",\"imp\":[{\"clickbrowser\":0,\"ext\":{\"dlp\":1},\"instl\":0,\"secure\":0}],\"test\":2,\"tmax\":2000}") + } func testBidRequestExtPrebidToJsonString() { diff --git a/PrebidMobileTests/RenderingTests/Tests/ParameterBuilderTests/PrebidParameterBuilderTest.swift b/PrebidMobileTests/RenderingTests/Tests/ParameterBuilderTests/PrebidParameterBuilderTest.swift index 454abbbe1..a1131f860 100644 --- a/PrebidMobileTests/RenderingTests/Tests/ParameterBuilderTests/PrebidParameterBuilderTest.swift +++ b/PrebidMobileTests/RenderingTests/Tests/ParameterBuilderTests/PrebidParameterBuilderTest.swift @@ -784,6 +784,18 @@ class PrebidParameterBuilderTest: XCTestCase { XCTAssertEqual(imp.extGPID, gpid) } } + + func testArbitraryORTBParams() { + let gpid = "/12345/home_screen#identifier" + let ortb = ["arbitraryparam1": "param1", "arbitraryparam2": 2, "arbitraryparam3": false] as [String : Any] + let adUnit = AdUnit(configId: "test", size: CGSize.zero, adFormats: [.banner]) + adUnit.setGPID(gpid) + adUnit.setOrtbConfig(ortb) + + let bidRequest = buildBidRequest(with: adUnit.adUnitConfig) + + //XCTAssertEqual(bidRequest.ortbObject?["arbitraryparam1"] as! String, "param1") + } // MARK: - Helpers diff --git a/README.md b/README.md index ff71afd9b..aff8b4a40 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Run the test script to run unit tests and integration tests. `2.1.6` version is available to build PrebidMobile with Carthage. For that, please, put the following content to your `Cartfile`: ``` -github "prebid/prebid-mobile-ios" == 2.1.6-carthage +github "prebid/prebid-mobile-ios" == 2.2.0-carthage ``` Run this command in order to build PrebidMobile with Carthage: