diff --git a/CriteoPublisherSdk/Sources/MRAID/CRMRAIDHandler.swift b/CriteoPublisherSdk/Sources/MRAID/CRMRAIDHandler.swift index 03d46cc7..ac5c66e8 100644 --- a/CriteoPublisherSdk/Sources/MRAID/CRMRAIDHandler.swift +++ b/CriteoPublisherSdk/Sources/MRAID/CRMRAIDHandler.swift @@ -309,9 +309,12 @@ fileprivate extension CRMRAIDHandler { } @objc func deviceOrientationDidChange() { - setCurrentPosition() - setMaxSize() - setScreen(size: UIScreen.main.bounds.size) + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.setCurrentPosition() + self.setMaxSize() + self.setScreen(size: UIScreen.main.bounds.size) + } } func unregisterDeviceOrientationListener() { diff --git a/CriteoPublisherSdk/Sources/MRAID/Resize/MRAIDResizeContainerView.swift b/CriteoPublisherSdk/Sources/MRAID/Resize/MRAIDResizeContainerView.swift index 60066a71..4d8764ea 100644 --- a/CriteoPublisherSdk/Sources/MRAID/Resize/MRAIDResizeContainerView.swift +++ b/CriteoPublisherSdk/Sources/MRAID/Resize/MRAIDResizeContainerView.swift @@ -117,7 +117,7 @@ private extension MRAIDResizeContainerView { let closeAreaView = UIView() closeAreaView.translatesAutoresizingMaskIntoConstraints = false container.addSubview(closeAreaView) - closeAreaView.backgroundColor = .red + closeAreaView.backgroundColor = .clear let safeAreaLayout = container.safeAreaLayoutGuide /// set the dimension of the close area diff --git a/CriteoPublisherSdk/Sources/Network/Serializers/CR_BidRequestSerializer.m b/CriteoPublisherSdk/Sources/Network/Serializers/CR_BidRequestSerializer.m index ee62038c..b054425b 100644 --- a/CriteoPublisherSdk/Sources/Network/Serializers/CR_BidRequestSerializer.m +++ b/CriteoPublisherSdk/Sources/Network/Serializers/CR_BidRequestSerializer.m @@ -158,13 +158,10 @@ - (NSArray *)slotsWithCdbRequest:(CR_CdbRequest *)cdbRequest config:(CR_Config * slotDict[CR_ApiQueryKeys.bidSlotsIsRewarded] = @(YES); } - NSNumber *mraidAPIVersion = [self mraidAPI:config]; - if (config.isMRAIDGlobalEnabled && - (adUnit.adUnitType == CRAdUnitTypeBanner || - adUnit.adUnitType == CRAdUnitTypeInterstitial) && - mraidAPIVersion) { + if (config.isMRAIDGlobalEnabled && (adUnit.adUnitType == CRAdUnitTypeBanner || + adUnit.adUnitType == CRAdUnitTypeInterstitial)) { NSMutableDictionary *mraidDict = [NSMutableDictionary new]; - mraidDict[CR_ApiQueryKeys.api] = [NSArray arrayWithObject:mraidAPIVersion]; + mraidDict[CR_ApiQueryKeys.api] = [self mraidAPI:config]; slotDict[CR_ApiQueryKeys.banner] = mraidDict; } @@ -173,14 +170,15 @@ - (NSArray *)slotsWithCdbRequest:(CR_CdbRequest *)cdbRequest config:(CR_Config * return slots; } -- (NSNumber *)mraidAPI:(CR_Config *)config { +- (NSArray *)mraidAPI:(CR_Config *)config { + NSMutableArray *mraidVersions = [NSMutableArray new]; if (config.isMraidEnabled) { - return @(3); + [mraidVersions addObject:@(3)]; } if (config.isMraid2Enabled) { - return @(5); + [mraidVersions addObject:@(5)]; } - return NULL; + return mraidVersions; } - (NSArray *)slotsWithCdbRequest:(CR_CdbRequest *)cdbRequest {