From ae7bd111b0a06feaf03b6e985d1ff069ce5842a5 Mon Sep 17 00:00:00 2001 From: jenkins Date: Mon, 13 May 2024 13:17:02 -0700 Subject: [PATCH] AmazonAdMarketplace/4.9.3.1 --- .../ALAmazonAdMarketplaceMediationAdapter.m | 31 ++++++++++++++++--- ...ediationAmazonAdMarketplaceAdapter.podspec | 2 +- AmazonAdMarketplace/CHANGELOG.md | 3 ++ 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/AmazonAdMarketplace/AmazonAdMarketplaceAdapter/ALAmazonAdMarketplaceMediationAdapter.m b/AmazonAdMarketplace/AmazonAdMarketplaceAdapter/ALAmazonAdMarketplaceMediationAdapter.m index f0c31f697e..a6ca3db34b 100644 --- a/AmazonAdMarketplace/AmazonAdMarketplaceAdapter/ALAmazonAdMarketplaceMediationAdapter.m +++ b/AmazonAdMarketplace/AmazonAdMarketplaceAdapter/ALAmazonAdMarketplaceMediationAdapter.m @@ -9,7 +9,7 @@ #import "ALAmazonAdMarketplaceMediationAdapter.h" #import -#define ADAPTER_VERSION @"4.9.3.0" +#define ADAPTER_VERSION @"4.9.3.1" /** * Container object for holding mediation hints dict generated from Amazon's SDK and the timestamp it was geenrated at. @@ -337,7 +337,8 @@ - (void)processAdResponseWithParameters:(id)parameters adRe - (void)failSignalCollectionWithError:(DTBAdErrorInfo *)adError andNotify:(id)delegate { - NSString *errorMessage = [NSString stringWithFormat: @"Signal collection failed: %d", adError.dtbAdError]; + // Note: `adError.dtbAdError` is currently always 0, but if Amazon fixes it, this will start logging correct error information. + NSString *errorMessage = [NSString stringWithFormat: @"Signal collection failed: %@", [ALAmazonAdMarketplaceMediationAdapter stringFromDTBAdError: adError.dtbAdError]]; [self failSignalCollectionWithErrorMessage: errorMessage andNotify: delegate]; } @@ -551,6 +552,25 @@ + (MAAdapterError *)toMaxError:(DTBAdErrorCode)amazonErrorCode #pragma clang diagnostic pop } ++ (NSString *)stringFromDTBAdError:(DTBAdError)error +{ + switch ( error ) + { + case NETWORK_ERROR: + return @"NETWORK_ERROR"; + case NETWORK_TIMEOUT: + return @"NETWORK_TIMEOUT"; + case NO_FILL: + return @"NO_FILL"; + case INTERNAL_ERROR: + return @"INTERNAL_ERROR"; + case REQUEST_ERROR: + return @"REQUEST_ERROR"; + } + + return @"UNKNOWN_ERROR"; +} + - (void)setCreativeIdentifier:(NSString *)creativeId forAdFormat:(MAAdFormat *)adFormat { @synchronized ( ALAmazonCreativeIdentifiersLock ) @@ -694,9 +714,12 @@ - (void)onFailure:(DTBAdError)error dtbAdErrorInfo:(DTBAdErrorInfo *)dtbAdErrorI [ALUsedAmazonAdLoaderHashes addObject: @(dtbAdErrorInfo.dtbAdLoader.hash)]; - [self.parentAdapter d: @"Signal failed to collect for ad loader: %@", dtbAdErrorInfo.dtbAdLoader]; + // Note: `dtbAdErrorInfo.dtbAdError` also contains a `DTBAdError` object but it's always 0. Use `DTBAdError` directly from Amazon's callback to get a valid error code. + NSString *dtbAdErrorString = [ALAmazonAdMarketplaceMediationAdapter stringFromDTBAdError: error]; + + [self.parentAdapter d: @"Signal failed to collect for ad loader: %@ with error: %@", dtbAdErrorInfo.dtbAdLoader, dtbAdErrorString]; - [self.parentAdapter failSignalCollectionWithError: dtbAdErrorInfo andNotify: self.delegate]; + [self.parentAdapter failSignalCollectionWithErrorMessage: dtbAdErrorString andNotify: self.delegate]; } @end diff --git a/AmazonAdMarketplace/AppLovinMediationAmazonAdMarketplaceAdapter.podspec b/AmazonAdMarketplace/AppLovinMediationAmazonAdMarketplaceAdapter.podspec index d3005548d7..7f1293d25c 100644 --- a/AmazonAdMarketplace/AppLovinMediationAmazonAdMarketplaceAdapter.podspec +++ b/AmazonAdMarketplace/AppLovinMediationAmazonAdMarketplaceAdapter.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |s| s.authors = 'AppLovin Corporation' s.name = 'AppLovinMediationAmazonAdMarketplaceAdapter' -s.version = '4.9.3.0' +s.version = '4.9.3.1' s.platform = :ios, '12.0' s.summary = 'Amazon Publisher Services 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/AmazonAdMarketplace/CHANGELOG.md b/AmazonAdMarketplace/CHANGELOG.md index 298b20bed9..02ad0e9c8e 100644 --- a/AmazonAdMarketplace/CHANGELOG.md +++ b/AmazonAdMarketplace/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 4.9.3.1 +* Add error type information to signal collection error logs. + ## 4.9.3.0 * Certified with AmazonAdMarketplace SDK 4.9.3. * Updated minimum Xcode requirement to 15.0.