From 49533cae8bdf41b15a82c38c8c513bcc206bd01b Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 26 Jun 2022 23:19:46 -0700 Subject: [PATCH] VerizonAds/2.0.0.4 --- VerizonAds/AppLovinMediationVerizonAdsAdapter.podspec | 2 +- VerizonAds/CHANGELOG.md | 3 +++ .../VerizonAdsAdapter/ALVerizonAdsMediationAdapter.m | 10 +++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/VerizonAds/AppLovinMediationVerizonAdsAdapter.podspec b/VerizonAds/AppLovinMediationVerizonAdsAdapter.podspec index bd5cbb8d5d..660107215b 100644 --- a/VerizonAds/AppLovinMediationVerizonAdsAdapter.podspec +++ b/VerizonAds/AppLovinMediationVerizonAdsAdapter.podspec @@ -5,7 +5,7 @@ s.authors = 'AppLovin Corporation' => 'devsupport@applovin.com' } s.name = 'AppLovinMediationVerizonAdsAdapter' -s.version = '2.0.0.3' +s.version = '2.0.0.4' s.platform = :ios, '11.0' s.summary = 'Verizon Ads 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/VerizonAds/CHANGELOG.md b/VerizonAds/CHANGELOG.md index 9a7900556f..5d0e19f1f2 100644 --- a/VerizonAds/CHANGELOG.md +++ b/VerizonAds/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2.0.0.4 +* Add support for returning the main image asset in `MANativeAd` for native ads. + ## 2.0.0.3 * Add support for IAB's TCFv2 GDPR consent string. Note that you must be on the AppLovin MAX SDK v11.4.2+ and use a TCFv2-compliant framework which stores the consent string in User Defaults via the `IABTCF_TCString` key to use this feature. Yahoo will still be filtered out of the waterfall in GDPR regions if the string is not available or one of the criteria is not met. diff --git a/VerizonAds/VerizonAdsAdapter/ALVerizonAdsMediationAdapter.m b/VerizonAds/VerizonAdsAdapter/ALVerizonAdsMediationAdapter.m index 3290b9c293..b482c9f91c 100644 --- a/VerizonAds/VerizonAdsAdapter/ALVerizonAdsMediationAdapter.m +++ b/VerizonAds/VerizonAdsAdapter/ALVerizonAdsMediationAdapter.m @@ -10,7 +10,7 @@ #import // Major version number is '2' since certifying against the rebranded Yahoo SDK -#define ADAPTER_VERSION @"2.0.0.3" +#define ADAPTER_VERSION @"2.0.0.4" /** * Dedicated delegate object for Verizon Ads interstitial ads. @@ -762,6 +762,7 @@ - (void)nativeAdDidLoad:(YASNativeAd *)nativeAd UIView *mediaView; CGFloat mediaContentAspectRatio = 0.0f; + MANativeAdImage *mainImage = nil; id videoComponent = (id)[nativeAd component: @"video"]; id mainImageComponent = (id)[nativeAd component: @"mainImage"]; @@ -780,6 +781,9 @@ - (void)nativeAdDidLoad:(YASNativeAd *)nativeAd mediaView = [[UIImageView alloc] init]; mediaView.contentMode = UIViewContentModeScaleAspectFit; [mainImageComponent prepareView: (UIImageView *) mediaView]; + + UIImage *image = ((UIImageView *) mediaView).image; + mainImage = [[MANativeAdImage alloc] initWithImage: image]; } NSString *templateName = [self.serverParameters al_stringForKey: @"template" defaultValue: @""]; @@ -803,6 +807,10 @@ - (void)nativeAdDidLoad:(YASNativeAd *)nativeAd builder.advertiser = advertiser; builder.callToAction = callToAction; builder.icon = iconImage; + if ( ALSdk.versionCode >= 11040299 ) + { + [builder performSelector: @selector(setMainImage:) withObject: mainImage]; + } builder.mediaView = mediaView; #pragma clang diagnostic push