From 12b7f97e047cdd62de31aa96ad7e82ff8f7882b3 Mon Sep 17 00:00:00 2001 From: prod-applovin-deploy Date: Sun, 20 Feb 2022 16:22:51 -0800 Subject: [PATCH] GoogleAdManager/8.13.0.6 --- ...vinMediationGoogleAdManagerAdapter.podspec | 2 +- GoogleAdManager/CHANGELOG.md | 3 +++ .../ALGoogleAdManagerMediationAdapter.m | 24 +++++++++++++++---- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/GoogleAdManager/AppLovinMediationGoogleAdManagerAdapter.podspec b/GoogleAdManager/AppLovinMediationGoogleAdManagerAdapter.podspec index 74d1377a45..c18b214354 100644 --- a/GoogleAdManager/AppLovinMediationGoogleAdManagerAdapter.podspec +++ b/GoogleAdManager/AppLovinMediationGoogleAdManagerAdapter.podspec @@ -5,7 +5,7 @@ s.authors = 'AppLovin Corporation' => 'devsupport@applovin.com' } s.name = 'AppLovinMediationGoogleAdManagerAdapter' -s.version = '8.13.0.5' +s.version = '8.13.0.6' s.platform = :ios, '9.0' s.summary = 'Google Ad Manager 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/GoogleAdManager/CHANGELOG.md b/GoogleAdManager/CHANGELOG.md index e74c736b72..858ed91cfb 100644 --- a/GoogleAdManager/CHANGELOG.md +++ b/GoogleAdManager/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 8.13.0.6 +* Add support for sending ad size information for adview ads. This value can be retrieved in the `didLoad()` callback using the `size` property from `MAAd.h` available in MAX SDK v11.2.0. + ## 8.13.0.5 * Add support for custom [AdChoices placements](https://developers.google.com/admob/ios/api/reference/Enums/GADAdChoicesPosition.html), which publishers can set by calling `setLocalExtraParameterForKey("gam_ad_choices_placement", GADAdChoicesPosition)` on the `MANativeAdLoader` instance. diff --git a/GoogleAdManager/GoogleAdManagerAdapter/ALGoogleAdManagerMediationAdapter.m b/GoogleAdManager/GoogleAdManagerAdapter/ALGoogleAdManagerMediationAdapter.m index 4607a73944..c644c86d0c 100644 --- a/GoogleAdManager/GoogleAdManagerAdapter/ALGoogleAdManagerMediationAdapter.m +++ b/GoogleAdManager/GoogleAdManagerAdapter/ALGoogleAdManagerMediationAdapter.m @@ -9,7 +9,7 @@ #import "ALGoogleAdManagerMediationAdapter.h" #import -#define ADAPTER_VERSION @"8.13.0.5" +#define ADAPTER_VERSION @"8.13.0.6" @interface ALGoogleAdManagerInterstitialDelegate : NSObject @property (nonatomic, weak) ALGoogleAdManagerMediationAdapter *parentAdapter; @@ -411,7 +411,7 @@ - (void)loadAdViewAdForParameters:(id)parameters GADAdSize adSize = [self adSizeFromAdFormat: adFormat withServerParameters: parameters.serverParameters]; self.adView = [[GAMBannerView alloc] initWithAdSize: adSize]; self.adView.frame = CGRectMake(0, 0, adSize.size.width, adSize.size.height); - self.adView.adUnitID = parameters.thirdPartyAdPlacementIdentifier; + self.adView.adUnitID = placementIdentifier; self.adView.rootViewController = [ALUtils topViewControllerFromKeyWindow]; self.adViewAdapterDelegate = [[ALGoogleAdManagerAdViewDelegate alloc] initWithParentAdapter: self adFormat: adFormat @@ -906,12 +906,26 @@ - (void)bannerViewDidReceiveAd:(GADBannerView *)bannerView { [self.parentAdapter log: @"%@ ad loaded: %@", self.adFormat.label, bannerView.adUnitID]; - NSString *responseId = bannerView.responseInfo.responseIdentifier; - if ( ALSdk.versionCode >= 6150000 && [responseId al_isValidString] ) + if ( ALSdk.versionCode >= 6150000 ) { + NSMutableDictionary *extraInfo = [NSMutableDictionary dictionaryWithCapacity: 3]; + + NSString *responseId = bannerView.responseInfo.responseIdentifier; + if ( [responseId al_isValidString] ) + { + extraInfo[@"creative_id"] = responseId; + } + + CGSize adSize = bannerView.adSize.size; + if ( !CGSizeEqualToSize(CGSizeZero, adSize) ) + { + extraInfo[@"ad_width"] = @(adSize.width); + extraInfo[@"ad_height"] = @(adSize.height); + } + [self.delegate performSelector: @selector(didLoadAdForAdView:withExtraInfo:) withObject: bannerView - withObject: @{@"creative_id" : responseId}]; + withObject: extraInfo]; } else {