diff --git a/Vungle/AppLovinMediationVungleAdapter.podspec b/Vungle/AppLovinMediationVungleAdapter.podspec index 22f7812d60..4ad81ccc5f 100644 --- a/Vungle/AppLovinMediationVungleAdapter.podspec +++ b/Vungle/AppLovinMediationVungleAdapter.podspec @@ -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" @@ -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' diff --git a/Vungle/CHANGELOG.md b/Vungle/CHANGELOG.md index 64310f9144..d2bc1510c7 100644 --- a/Vungle/CHANGELOG.md +++ b/Vungle/CHANGELOG.md @@ -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. diff --git a/Vungle/VungleAdapter/ALVungleMediationAdapter.m b/Vungle/VungleAdapter/ALVungleMediationAdapter.m index e5fd4d34fc..1d9c2ee550 100644 --- a/Vungle/VungleAdapter/ALVungleMediationAdapter.m +++ b/Vungle/VungleAdapter/ALVungleMediationAdapter.m @@ -9,7 +9,7 @@ #import "ALVungleMediationAdapter.h" #import -#define ADAPTER_VERSION @"7.1.0.2" +#define ADAPTER_VERSION @"7.2.0.0" @interface ALVungleMediationAdapterInterstitialAdDelegate : NSObject @property (nonatomic, weak) ALVungleMediationAdapter *parentAdapter; @@ -410,9 +410,7 @@ - (void)loadAdViewAdForParameters:(id)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]; @@ -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 @@ -580,6 +580,8 @@ + (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 @@ -587,6 +589,7 @@ + (MAAdapterError *)toMaxError:(nullable NSError *)vungleError isAdPresentError: 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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] ) { @@ -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 @@ -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]; + } }); } @@ -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 @@ -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]; + } }); } @@ -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