From 1272478b716c0e7ffe0dfa813d6cb6874fb56875 Mon Sep 17 00:00:00 2001 From: AppLovin-Mobile-Engineering Date: Mon, 19 Aug 2024 12:21:22 -0700 Subject: [PATCH] Chartboost/9.7.0.1 --- ...AppLovinMediationChartboostAdapter.podspec | 2 +- Chartboost/CHANGELOG.md | 8 +++ .../ALChartboostMediationAdapter.h | 2 +- .../ALChartboostMediationAdapter.m | 70 ++++++++++++++----- 4 files changed, 64 insertions(+), 18 deletions(-) diff --git a/Chartboost/AppLovinMediationChartboostAdapter.podspec b/Chartboost/AppLovinMediationChartboostAdapter.podspec index a42720876b5..d70b59fcd0e 100644 --- a/Chartboost/AppLovinMediationChartboostAdapter.podspec +++ b/Chartboost/AppLovinMediationChartboostAdapter.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |s| s.authors = 'AppLovin Corporation' s.name = 'AppLovinMediationChartboostAdapter' -s.version = '9.7.0.0' +s.version = '9.7.0.1' s.platform = :ios, '11.0' s.summary = 'Chartboost adapter used for mediation with the AppLovin MAX SDK' s.homepage = "https://github.com/CocoaPods/Specs/search?o=desc&q=#{s.name}&s=indexed" diff --git a/Chartboost/CHANGELOG.md b/Chartboost/CHANGELOG.md index 8333d03ef00..a7dbfbfdb97 100644 --- a/Chartboost/CHANGELOG.md +++ b/Chartboost/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 9.7.0.1 +* Add bidding support for banners, leaders, MRECs, interstitial and rewarded ads. +* Add COPPA support. +* Updated minimum Xcode requirement to 15.0. +* Remove deprecated callbacks `didStartRewardedAdVideo` and `didCompleteRewardedAdVideo`. +* Update error code mapping. +* Remove deprecated API usages. + ## 9.7.0.0 * Certified with Chartboost SDK 9.7.0. diff --git a/Chartboost/ChartboostAdapter/ALChartboostMediationAdapter.h b/Chartboost/ChartboostAdapter/ALChartboostMediationAdapter.h index 4e36659fa0f..d9deb8a3475 100644 --- a/Chartboost/ChartboostAdapter/ALChartboostMediationAdapter.h +++ b/Chartboost/ChartboostAdapter/ALChartboostMediationAdapter.h @@ -8,6 +8,6 @@ #import -@interface ALChartboostMediationAdapter : ALMediationAdapter +@interface ALChartboostMediationAdapter : ALMediationAdapter @end diff --git a/Chartboost/ChartboostAdapter/ALChartboostMediationAdapter.m b/Chartboost/ChartboostAdapter/ALChartboostMediationAdapter.m index 1614618009a..40658eacac9 100644 --- a/Chartboost/ChartboostAdapter/ALChartboostMediationAdapter.m +++ b/Chartboost/ChartboostAdapter/ALChartboostMediationAdapter.m @@ -9,7 +9,7 @@ #import "ALChartboostMediationAdapter.h" #import -#define ADAPTER_VERSION @"9.7.0.0" +#define ADAPTER_VERSION @"9.7.0.1" @interface ALChartboostInterstitialDelegate : NSObject @property (nonatomic, weak) ALChartboostMediationAdapter *parentAdapter; @@ -134,21 +134,39 @@ - (void)destroy self.adViewDelegate = nil; } +#pragma mark - MASignalProvider Methods + +- (void)collectSignalWithParameters:(id)parameters andNotify:(id)delegate +{ + [self log: @"Collecting signal..."]; + + NSString *signal = [Chartboost bidderToken]; + [delegate didCollectSignal: signal]; +} + #pragma mark - MAInterstitialAdapter Methods - (void)loadInterstitialAdForParameters:(id)parameters andNotify:(id)delegate { // Determine placement NSString *location = [self locationFromParameters: parameters]; - - [self log: @"Loading interstitial ad for location \"%@\"...", location]; + NSString *bidResponse = parameters.bidResponse; + BOOL isBidding = [bidResponse al_isValidString]; + [self log: @"Loading %@interstitial ad for location \"%@\"...", isBidding ? @"bidding " : @"", location]; [self updateUserConsentForParameters: parameters]; self.interstitialDelegate = [[ALChartboostInterstitialDelegate alloc] initWithParentAdapter: self andNotify: delegate]; self.interstitialAd = [[CHBInterstitial alloc] initWithLocation: location mediation: self.mediationInfo delegate: self.interstitialDelegate]; - [self.interstitialAd cache]; + if ( isBidding ) + { + [self.interstitialAd cacheBidResponse: bidResponse]; + } + else + { + [self.interstitialAd cache]; + } } - (void)showInterstitialAdForParameters:(id)parameters andNotify:(id)delegate @@ -188,14 +206,23 @@ - (void)showInterstitialAdForParameters:(id)paramet - (void)loadRewardedAdForParameters:(id)parameters andNotify:(id)delegate { NSString *location = [self locationFromParameters: parameters]; - [self log: @"Loading rewarded ad for location \"%@\"...", location]; + NSString *bidResponse = parameters.bidResponse; + BOOL isBidding = [bidResponse al_isValidString]; + [self log: @"Loading %@rewarded ad for location \"%@\"...", isBidding ? @"bidding " : @"", location]; [self updateUserConsentForParameters: parameters]; self.rewardedDelegate = [[ALChartboostRewardedDelegate alloc] initWithParentAdapter: self andNotify: delegate]; self.rewardedAd = [[CHBRewarded alloc] initWithLocation: location mediation: self.mediationInfo delegate: self.rewardedDelegate]; - [self.rewardedAd cache]; + if ( isBidding ) + { + [self.rewardedAd cacheBidResponse: bidResponse]; + } + else + { + [self.rewardedAd cache]; + } } - (void)showRewardedAdForParameters:(id)parameters andNotify:(id)delegate @@ -240,7 +267,9 @@ - (void)loadAdViewAdForParameters:(id)parameters andNotify:(id)delegate { NSString *location = [self locationFromParameters: parameters]; - [self log: @"Loading %@ ad for location \"%@\"...", adFormat.label, location]; + NSString *bidResponse = parameters.bidResponse; + BOOL isBidding = [bidResponse al_isValidString]; + [self log: @"Loading %@%@ ad for location \"%@\"...", isBidding ? @"bidding " : @"", adFormat.label, location]; [self updateUserConsentForParameters: parameters]; @@ -250,7 +279,14 @@ - (void)loadAdViewAdForParameters:(id)parameters mediation: self.mediationInfo delegate: self.adViewDelegate]; - [self.adView cache]; + if ( isBidding ) + { + [self.adView cacheBidResponse: bidResponse]; + } + else + { + [self.adView cache]; + } } #pragma mark - GDPR @@ -270,6 +306,12 @@ - (void)updateUserConsentForParameters:(id)parameters CHBCCPAConsent ccpaConsent = isDoNotSell.boolValue ? CHBCCPAConsentOptOutSale : CHBCCPAConsentOptInSale; [Chartboost addDataUseConsent: [CHBCCPADataUseConsent ccpaConsent: ccpaConsent]]; } + + NSNumber *isAgeRestrictedUser = [parameters isAgeRestrictedUser]; + if ( isAgeRestrictedUser != nil ) + { + [Chartboost addDataUseConsent: [CHBCOPPADataUseConsent isChildDirected: isAgeRestrictedUser.boolValue]]; + } } #pragma mark - Helper Methods @@ -333,6 +375,7 @@ - (MAAdapterError *)toMaxErrorFromCHBShowError:(CHBShowError *)chartBoostShowErr { case CHBShowErrorCodeInternalError: case CHBShowErrorCodePresentationFailure: + case CHBShowErrorCodeAssetsFailure: adapterError = MAAdapterError.internalError; break; case CHBShowErrorCodeSessionNotStarted: @@ -347,6 +390,9 @@ - (MAAdapterError *)toMaxErrorFromCHBShowError:(CHBShowError *)chartBoostShowErr case CHBShowErrorCodeNoViewController: adapterError = MAAdapterError.missingViewController; break; + case CHBShowErrorCodeNoAdInstance: + adapterError = MAAdapterError.invalidConfiguration; + break; } #pragma clang diagnostic push @@ -548,8 +594,6 @@ - (void)didShowAd:(CHBShowEvent *)event error:(CHBShowError *)error else { [self.parentAdapter log: @"Rewarded shown: %@", event.ad.location]; - - [self.delegate didStartRewardedAdVideo]; } } @@ -585,7 +629,6 @@ - (void)didClickAd:(CHBClickEvent *)event error:(CHBClickError *)error - (void)didEarnReward:(CHBRewardEvent *)event { [self.parentAdapter log: @"Rewarded complete \"%@\" with reward: %d", event.ad.location, event.reward]; - [self.delegate didCompleteRewardedAdVideo]; self.grantedReward = YES; } @@ -709,9 +752,4 @@ - (void)didClickAd:(CHBClickEvent *)event error:(CHBClickError *)error } } -- (void)didFinishHandlingClick:(CHBClickEvent *)event error:(CHBClickError *)error -{ - [self.parentAdapter log: @"%@ ad did finish handling click: %@", self.adFormat.label, event.ad.location]; -} - @end