Skip to content

Commit

Permalink
AmazonAdMarketplace/4.9.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed May 13, 2024
1 parent dc50ee7 commit ae7bd11
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "ALAmazonAdMarketplaceMediationAdapter.h"
#import <DTBiOSSDK/DTBiOSSDK.h>

#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.
Expand Down Expand Up @@ -337,7 +337,8 @@ - (void)processAdResponseWithParameters:(id<MAAdapterParameters>)parameters adRe

- (void)failSignalCollectionWithError:(DTBAdErrorInfo *)adError andNotify:(id<MASignalCollectionDelegate>)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];
}

Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions AmazonAdMarketplace/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit ae7bd11

Please sign in to comment.