Skip to content

Commit

Permalink
Vungle/7.2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Dec 1, 2023
1 parent 6f82cdf commit 330f9a1
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 71 deletions.
4 changes: 2 additions & 2 deletions Vungle/AppLovinMediationVungleAdapter.podspec
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 = 'AppLovinMediationVungleAdapter'
s.version = '7.1.0.2'
s.version = '7.2.0.0'
s.platform = :ios, '11.0'
s.summary = 'Vungle 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 All @@ -26,7 +26,7 @@ s.source =

s.vendored_frameworks = "#{s.name}-#{s.version}/#{s.name}.xcframework"

s.dependency 'VungleAds', '= 7.1.0'
s.dependency 'VungleAds', '= 7.2.0'
s.dependency 'AppLovinSDK'
s.swift_version = '5.0'

Expand Down
6 changes: 6 additions & 0 deletions Vungle/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 7.2.0.0
* Certified with Vungle SDK 7.2.0.
* Remove usage of `[VungleBanner enableRefresh]` since Vungle banner refresh is disabled by default and the API is removed in Vungle SDK 7.2.0.
* Update support for passing creative ID to MAX SDK on ad load callbacks instead of the impression callbacks.
* Update error codes.

## 7.1.0.2
* Update ad display failed error code.

Expand Down
140 changes: 71 additions & 69 deletions Vungle/VungleAdapter/ALVungleMediationAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "ALVungleMediationAdapter.h"
#import <VungleAdsSDK/VungleAdsSDK.h>

#define ADAPTER_VERSION @"7.1.0.2"
#define ADAPTER_VERSION @"7.2.0.0"

@interface ALVungleMediationAdapterInterstitialAdDelegate : NSObject <VungleInterstitialDelegate>
@property (nonatomic, weak) ALVungleMediationAdapter *parentAdapter;
Expand Down Expand Up @@ -410,9 +410,7 @@ - (void)loadAdViewAdForParameters:(id<MAAdapterResponseParameters>)parameters ad
parameters: parameters
andNotify: delegate];
self.adView.delegate = self.adViewDelegate;

self.adView.enableRefresh = NO;


self.adViewContainer = [[UIView alloc] initWithFrame: (CGRect) { CGPointZero, adFormat.size }];

[self.adView load: bidResponse];
Expand Down Expand Up @@ -558,9 +556,11 @@ + (MAAdapterError *)toMaxError:(nullable NSError *)vungleError isAdPresentError:
case 207: // Invalid Placement Type
case 222: // Invalid Placement load type
case 500: // BannerView: Invalid Size
case 30001: // Ad Publisher Mismatch
adapterError = MAAdapterError.invalidConfiguration;
break;
case 119: // Json Encode Error
case 30002: // Ad Internal Integration Error
adapterError = MAAdapterError.internalError;
break;
case 202: // Ad already Consumed
Expand All @@ -580,13 +580,16 @@ + (MAAdapterError *)toMaxError:(nullable NSError *)vungleError isAdPresentError:
adapterError = MAAdapterError.adDisplayFailedError;
break;
case 212: // Placement Sleep
case 10001: // Ad No Fill
case 10002: // AdLoad Too Frequently
adapterError = MAAdapterError.noFill;
break;
case 217: // Ad response timeOut
adapterError = MAAdapterError.timeout;
break;
case 220: // Server busy with retry after timer.
case 221: // Load ad during Server busy with retry after timer.
case 20001: // Ad Server Error
adapterError = MAAdapterError.serverError;
break;
case 304: // Ad Expired
Expand Down Expand Up @@ -629,7 +632,16 @@ - (instancetype)initWithParentAdapter:(ALVungleMediationAdapter *)parentAdapter
- (void)interstitialAdDidLoad:(VungleInterstitial *)interstitial
{
[self.parentAdapter log: @"Interstitial ad loaded: %@", interstitial.placementId];
[self.delegate didLoadInterstitialAd];

NSString *creativeIdentifier = interstitial.creativeId;
if ( [creativeIdentifier al_isValidString] )
{
[self.delegate didLoadInterstitialAdWithExtraInfo: @{@"creative_id" : creativeIdentifier}];
}
else
{
[self.delegate didLoadInterstitialAd];
}
}

- (void)interstitialAdDidFailToLoad:(VungleInterstitial *)interstitial withError:(NSError *)error
Expand All @@ -652,16 +664,7 @@ - (void)interstitialAdDidPresent:(VungleInterstitial *)interstitial
- (void)interstitialAdDidTrackImpression:(VungleInterstitial *)interstitial
{
[self.parentAdapter log: @"Interstitial ad impression tracked: %@", interstitial.placementId];

NSString *creativeIdentifier = interstitial.creativeId;
if ( [creativeIdentifier al_isValidString] )
{
[self.delegate didDisplayInterstitialAdWithExtraInfo: @{@"creative_id" : creativeIdentifier}];
}
else
{
[self.delegate didDisplayInterstitialAd];
}
[self.delegate didDisplayInterstitialAd];
}

- (void)interstitialAdDidFailToPresent:(VungleInterstitial *)interstitial withError:(NSError *)error
Expand Down Expand Up @@ -711,7 +714,16 @@ - (instancetype)initWithParentAdapter:(ALVungleMediationAdapter *)parentAdapter
- (void)interstitialAdDidLoad:(VungleInterstitial *)interstitial
{
[self.parentAdapter log: @"App Open ad loaded: %@", interstitial.placementId];
[self.delegate didLoadAppOpenAd];

NSString *creativeIdentifier = interstitial.creativeId;
if ( [creativeIdentifier al_isValidString] )
{
[self.delegate didLoadAppOpenAdWithExtraInfo: @{@"creative_id" : creativeIdentifier}];
}
else
{
[self.delegate didLoadAppOpenAd];
}
}

- (void)interstitialAdDidFailToLoad:(VungleInterstitial *)interstitial withError:(NSError *)error
Expand All @@ -734,16 +746,7 @@ - (void)interstitialAdDidPresent:(VungleInterstitial *)interstitial
- (void)interstitialAdDidTrackImpression:(VungleInterstitial *)interstitial
{
[self.parentAdapter log: @"App Open ad impression tracked: %@", interstitial.placementId];

NSString *creativeIdentifier = interstitial.creativeId;
if ( [creativeIdentifier al_isValidString] )
{
[self.delegate didDisplayAppOpenAdWithExtraInfo: @{@"creative_id" : creativeIdentifier}];
}
else
{
[self.delegate didDisplayAppOpenAd];
}
[self.delegate didDisplayAppOpenAd];
}

- (void)interstitialAdDidFailToPresent:(VungleInterstitial *)interstitial withError:(NSError *)error
Expand Down Expand Up @@ -793,7 +796,16 @@ - (instancetype)initWithParentAdapter:(ALVungleMediationAdapter *)parentAdapter
- (void)rewardedAdDidLoad:(VungleRewarded *)rewarded
{
[self.parentAdapter log: @"Rewarded ad loaded: %@", rewarded.placementId];
[self.delegate didLoadRewardedAd];

NSString *creativeIdentifier = rewarded.creativeId;
if ( [creativeIdentifier al_isValidString] )
{
[self.delegate didLoadRewardedAdWithExtraInfo: @{@"creative_id" : creativeIdentifier}];
}
else
{
[self.delegate didLoadRewardedAd];
}
}

- (void)rewardedAdDidFailToLoad:(VungleRewarded *)rewarded withError:(NSError *)error
Expand All @@ -817,16 +829,7 @@ - (void)rewardedAdDidPresent:(VungleRewarded *)rewarded
- (void)rewardedAdDidTrackImpression:(VungleRewarded *)rewarded
{
[self.parentAdapter log: @"Rewarded ad impression tracked: %@", rewarded.placementId];

NSString *creativeIdentifier = rewarded.creativeId;
if ( [creativeIdentifier al_isValidString] )
{
[self.delegate didDisplayRewardedAdWithExtraInfo: @{@"creative_id" : creativeIdentifier}];
}
else
{
[self.delegate didDisplayRewardedAd];
}
[self.delegate didDisplayRewardedAd];
}

- (void)rewardedAdDidFailToPresent:(VungleRewarded *)rewarded withError:(NSError *)error
Expand Down Expand Up @@ -896,7 +899,16 @@ - (instancetype)initWithParentAdapter:(ALVungleMediationAdapter *)parentAdapter
- (void)bannerAdDidLoad:(VungleBanner *)banner
{
[self.parentAdapter log: @"AdView loaded: %@", banner.placementId];
[self.delegate didLoadAdForAdView: self.parentAdapter.adViewContainer];

NSString *creativeIdentifier = banner.creativeId;
if ( [creativeIdentifier al_isValidString] )
{
[self.delegate didLoadAdForAdView: self.parentAdapter.adViewContainer withExtraInfo: @{@"creative_id" : creativeIdentifier}];
}
else
{
[self.delegate didLoadAdForAdView: self.parentAdapter.adViewContainer];
}

if ( [banner canPlayAd] )
{
Expand Down Expand Up @@ -929,16 +941,7 @@ - (void)bannerAdDidPresent:(VungleBanner *)banner
- (void)bannerAdDidTrackImpression:(VungleBanner *)banner
{
[self.parentAdapter log: @"AdView ad impression tracked %@", banner.placementId];

NSString *creativeIdentifier = banner.creativeId;
if ( [creativeIdentifier al_isValidString] )
{
[self.delegate didDisplayAdViewAdWithExtraInfo: @{@"creative_id" : creativeIdentifier}];
}
else
{
[self.delegate didDisplayAdViewAd];
}
[self.delegate didDisplayAdViewAd];
}

- (void)bannerAdDidClick:(VungleBanner *)banner
Expand Down Expand Up @@ -1053,7 +1056,15 @@ - (void)nativeAdDidLoad:(VungleNative *)nativeAd

[maxVungleNativeAd prepareForInteractionClickableViews: [self.parentAdapter clickableViewsForNativeAdView: maxNativeAdView] withContainer: maxNativeAdView];

[self.delegate didLoadAdForAdView: maxNativeAdView];
NSString *creativeIdentifier = nativeAd.creativeId;
if ( [creativeIdentifier al_isValidString] )
{
[self.delegate didLoadAdForAdView: maxNativeAdView withExtraInfo: @{@"creative_id" : creativeIdentifier}];
}
else
{
[self.delegate didLoadAdForAdView: maxNativeAdView];
}
});
}

Expand All @@ -1067,16 +1078,7 @@ - (void)nativeAd:(VungleNative *)nativeAd didFailWithError:(NSError *)error
- (void)nativeAdDidTrackImpression:(VungleNative *)nativeAd
{
[self.parentAdapter log: @"Native %@ ad shown: %@", self.adFormat, self.placementIdentifier];

NSString *creativeIdentifier = nativeAd.creativeId;
if ( [creativeIdentifier al_isValidString] )
{
[self.delegate didDisplayAdViewAdWithExtraInfo: @{@"creative_id" : creativeIdentifier}];
}
else
{
[self.delegate didDisplayAdViewAd];
}
[self.delegate didDisplayAdViewAd];
}

- (void)nativeAdDidClick:(VungleNative *)nativeAd
Expand Down Expand Up @@ -1146,7 +1148,15 @@ - (void)nativeAdDidLoad:(VungleNative *)nativeAd
#pragma clang diagnostic pop
}];

[self.delegate didLoadAdForNativeAd: maxNativeAd withExtraInfo: nil];
NSString *creativeIdentifier = nativeAd.creativeId;
if ( [creativeIdentifier al_isValidString] )
{
[self.delegate didLoadAdForNativeAd: maxNativeAd withExtraInfo: @{@"creative_id" : creativeIdentifier}];
}
else
{
[self.delegate didLoadAdForNativeAd: maxNativeAd withExtraInfo: nil];
}
});
}

Expand All @@ -1160,15 +1170,7 @@ - (void)nativeAd:(VungleNative *)nativeAd didFailWithError:(NSError *)error
- (void)nativeAdDidTrackImpression:(VungleNative *)nativeAd
{
[self.parentAdapter log: @"Native ad shown: %@", self.placementIdentifier];
NSString *creativeIdentifier = nativeAd.creativeId;
if ( [creativeIdentifier al_isValidString] )
{
[self.delegate didDisplayNativeAdWithExtraInfo: @{@"creative_id" : creativeIdentifier}];
}
else
{
[self.delegate didDisplayNativeAdWithExtraInfo: nil];
}
[self.delegate didDisplayNativeAdWithExtraInfo: nil];
}

- (void)nativeAdDidClick:(VungleNative *)nativeAd
Expand Down

0 comments on commit 330f9a1

Please sign in to comment.