diff --git a/Chartboost/CHANGELOG.md b/Chartboost/CHANGELOG.md index f94f4f56..bab4f799 100644 --- a/Chartboost/CHANGELOG.md +++ b/Chartboost/CHANGELOG.md @@ -1,4 +1,7 @@ ## Changelog + * 8.4.0.1 + * Add support for `fullscreenAdAdapterAdWillDismiss` when a fullscreen creative is about to close. Publishers must use v5.16.1 of the MoPub SDK at the minimum. + * 8.4.0.0 * This version of the adapters has been certified with Chartboost 8.4.0 and MoPub SDK 5.15.0. diff --git a/Chartboost/ChartboostAdapterConfiguration.m b/Chartboost/ChartboostAdapterConfiguration.m index aa414eb3..ee4d00b6 100644 --- a/Chartboost/ChartboostAdapterConfiguration.m +++ b/Chartboost/ChartboostAdapterConfiguration.m @@ -1,7 +1,7 @@ #import "ChartboostAdapterConfiguration.h" #import "ChartboostRouter.h" -#define CHARTBOOST_ADAPTER_VERSION @"8.4.0.0" +#define CHARTBOOST_ADAPTER_VERSION @"8.4.0.1" #define MOPUB_NETWORK_NAME @"chartboost" // Constants diff --git a/Chartboost/ChartboostBannerCustomEvent.m b/Chartboost/ChartboostBannerCustomEvent.m index 1688b17b..c92cc5df 100755 --- a/Chartboost/ChartboostBannerCustomEvent.m +++ b/Chartboost/ChartboostBannerCustomEvent.m @@ -28,7 +28,7 @@ - (void)requestAdWithSize:(CGSize)size adapterInfo:(NSDictionary *)info adMarkup MPLogAdEvent([MPLogEvent error:[NSError adRequestCalledTwiceOnSameEvent] message:nil], location); } - __weak typeof(self) weakSelf = self; + __weak __typeof(self) weakSelf = self; [ChartboostRouter startWithParameters:info completion:^(BOOL initialized) { if (!initialized) { NSError *error = [NSError adRequestFailedDueToSDKStartWithAdOfType:@"banner"]; diff --git a/Chartboost/ChartboostInterstitialCustomEvent.m b/Chartboost/ChartboostInterstitialCustomEvent.m index 1e2115b0..332d1b7e 100755 --- a/Chartboost/ChartboostInterstitialCustomEvent.m +++ b/Chartboost/ChartboostInterstitialCustomEvent.m @@ -45,7 +45,7 @@ - (void)requestAdWithAdapterInfo:(NSDictionary *)info adMarkup:(NSString *)adMar MPLogAdEvent([MPLogEvent error:[NSError adRequestCalledTwiceOnSameEvent] message:nil], location); } - __weak typeof(self) weakSelf = self; + __weak __typeof(self) weakSelf = self; [ChartboostRouter startWithParameters:info completion:^(BOOL initialized) { if (!initialized) { NSError *error = [NSError adRequestFailedDueToSDKStartWithAdOfType:@"interstitial"]; @@ -91,7 +91,7 @@ - (void)didShowAd:(CHBShowEvent *)event error:(CHBShowError *)error if (error) { NSError *nserror = [NSError errorWithShowEvent:event error:error]; MPLogAdEvent([MPLogEvent adShowFailedForAdapter:NSStringFromClass(self.class) error:nserror], self.ad.location); - [self.delegate fullscreenAdAdapter:self didFailToLoadAdWithError:nserror]; + [self.delegate fullscreenAdAdapter:self didFailToShowAdWithError:nserror]; } else { MPLogAdEvent([MPLogEvent adShowSuccessForAdapter:NSStringFromClass(self.class)], event.ad.location); MPLogAdEvent([MPLogEvent adDidAppearForAdapter:NSStringFromClass(self.class)], event.ad.location); @@ -116,16 +116,12 @@ - (void)didClickAd:(CHBClickEvent *)event error:(CHBClickError *)error - (void)didDismissAd:(CHBDismissEvent *)event { + [self.delegate fullscreenAdAdapterAdWillDismiss:self]; MPLogAdEvent([MPLogEvent adWillDisappearForAdapter:NSStringFromClass(self.class)], event.ad.location); [self.delegate fullscreenAdAdapterAdWillDisappear:self]; MPLogAdEvent([MPLogEvent adDidDisappearForAdapter:NSStringFromClass(self.class)], event.ad.location); [self.delegate fullscreenAdAdapterAdDidDisappear:self]; - - // Signal that the fullscreen ad is closing and the state should be reset. - // `fullscreenAdAdapterAdDidDismiss:` was introduced in MoPub SDK 5.15.0. - if ([self.delegate respondsToSelector:@selector(fullscreenAdAdapterAdDidDismiss:)]) { - [self.delegate fullscreenAdAdapterAdDidDismiss:self]; - } + [self.delegate fullscreenAdAdapterAdDidDismiss:self]; } @end diff --git a/Chartboost/ChartboostRewardedVideoCustomEvent.m b/Chartboost/ChartboostRewardedVideoCustomEvent.m index 46227151..33e77b53 100755 --- a/Chartboost/ChartboostRewardedVideoCustomEvent.m +++ b/Chartboost/ChartboostRewardedVideoCustomEvent.m @@ -45,7 +45,7 @@ - (void)requestAdWithAdapterInfo:(NSDictionary *)info adMarkup:(NSString *)adMar MPLogAdEvent([MPLogEvent error:[NSError adRequestCalledTwiceOnSameEvent] message:nil], location); } - __weak typeof(self) weakSelf = self; + __weak __typeof(self) weakSelf = self; [ChartboostRouter startWithParameters:info completion:^(BOOL initialized) { if (!initialized) { NSError *error = [NSError adRequestFailedDueToSDKStartWithAdOfType:@"rewarded"]; @@ -117,16 +117,12 @@ - (void)didClickAd:(CHBClickEvent *)event error:(CHBClickError *)error - (void)didDismissAd:(CHBDismissEvent *)event { + [self.delegate fullscreenAdAdapterAdWillDismiss:self]; MPLogAdEvent([MPLogEvent adWillDisappearForAdapter:NSStringFromClass(self.class)], event.ad.location); [self.delegate fullscreenAdAdapterAdWillDisappear:self]; MPLogAdEvent([MPLogEvent adDidDisappearForAdapter:NSStringFromClass(self.class)], event.ad.location); [self.delegate fullscreenAdAdapterAdDidDisappear:self]; - - // Signal that the fullscreen ad is closing and the state should be reset. - // `fullscreenAdAdapterAdDidDismiss:` was introduced in MoPub SDK 5.15.0. - if ([self.delegate respondsToSelector:@selector(fullscreenAdAdapterAdDidDismiss:)]) { - [self.delegate fullscreenAdAdapterAdDidDismiss:self]; - } + [self.delegate fullscreenAdAdapterAdDidDismiss:self]; } - (void)didEarnReward:(CHBRewardEvent *)event