Skip to content

Commit

Permalink
Google/8.13.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
prod-applovin-deploy committed Feb 21, 2022
1 parent 2d6ce1b commit d483578
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Google/AppLovinMediationGoogleAdapter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ s.authors =
'AppLovin Corporation' => '[email protected]'
}
s.name = 'AppLovinMediationGoogleAdapter'
s.version = '8.13.0.6'
s.version = '8.13.0.7'
s.platform = :ios, '9.0'
s.summary = 'Google 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 Google/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 8.13.0.7
* 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.6
* Add support for custom [AdChoices placements](https://developers.google.com/admob/ios/api/reference/Enums/GADAdChoicesPosition.html), which publishers can set by calling `setLocalExtraParameterForKey("admob_ad_choices_placement", GADAdChoicesPosition)` on the `MANativeAdLoader` instance.

Expand Down
24 changes: 19 additions & 5 deletions Google/GoogleAdapter/ALGoogleMediationAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "ALGoogleMediationAdapter.h"
#import <GoogleMobileAds/GoogleMobileAds.h>

#define ADAPTER_VERSION @"8.13.0.6"
#define ADAPTER_VERSION @"8.13.0.7"

@interface ALGoogleMediationAdapterInterstitialDelegate : NSObject<GADFullScreenContentDelegate>
@property (nonatomic, weak) ALGoogleMediationAdapter *parentAdapter;
Expand Down Expand Up @@ -480,7 +480,7 @@ - (void)loadAdViewAdForParameters:(id<MAAdapterResponseParameters>)parameters
GADAdSize adSize = [self adSizeFromAdFormat: adFormat withServerParameters: parameters.serverParameters];
self.adView = [[GADBannerView alloc] initWithAdSize: adSize];
self.adView.frame = (CGRect){.size = adSize.size};
self.adView.adUnitID = parameters.thirdPartyAdPlacementIdentifier;
self.adView.adUnitID = placementIdentifier;
self.adView.rootViewController = [ALUtils topViewControllerFromKeyWindow];
self.adViewAdapterDelegate = [[ALGoogleMediationAdapterAdViewDelegate alloc] initWithParentAdapter: self
adFormat: adFormat
Expand Down Expand Up @@ -996,12 +996,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
{
Expand Down

0 comments on commit d483578

Please sign in to comment.