Skip to content

Commit

Permalink
Updated to support Adaptive case (#19)
Browse files Browse the repository at this point in the history
Updated to support Adaptive case and Custom case properly
  • Loading branch information
ashinagawa authored and ManojBudumuru-vungle committed Aug 21, 2024
1 parent 17be181 commit 73d049e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Vungle/VungleAdapter/ALVungleMediationAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,14 @@ - (void)loadVungleNativeAdForParameters:(id<MAAdapterResponseParameters>)paramet
- (VungleAdSize *)adSizeFromAdFormat:(MAAdFormat *)adFormat
parameters:(id<MAAdapterParameters>)parameters
{
BOOL isAdaptiveBanner = [parameters.localExtraParameters al_boolForKey: @"adaptive_banner"];
NSNumber *customWidth = [parameters.localExtraParameters al_numberForKey: @"adaptive_banner_width"];
NSNumber *customHight = [parameters.localExtraParameters al_numberForKey: @"adaptive_banner_height"];

if (!isAdaptiveBanner && customWidth && customHight) {
return [VungleAdSize VungleAdSizeFromCGSize:(CGSizeMake(customWidth.floatValue, customHight.floatValue))];
if ([parameters.localExtraParameters al_boolForKey: @"adaptive_banner"]) {
NSNumber *customWidth = [parameters.localExtraParameters al_numberForKey: @"adaptive_banner_width"];
// Need to check `customHeight` to determine if the request is for Custom or Adaptive.
NSNumber *customHeight = [parameters.localExtraParameters al_numberForKey: @"adaptive_banner_height"];
if (!customHeight) {
customHeight = 0;
}
return [VungleAdSize VungleAdSizeFromCGSize:(CGSizeMake(customWidth.floatValue, customHeight.floatValue))];
}
else if ( adFormat == MAAdFormat.banner )
{
Expand Down

0 comments on commit 73d049e

Please sign in to comment.