Skip to content

Commit

Permalink
Yandex/7.0.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed May 4, 2024
1 parent 0a2412e commit efb360b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 15 deletions.
16 changes: 8 additions & 8 deletions Yandex/AppLovinMediationYandexAdapter.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 = 'AppLovinMediationYandexAdapter'
s.version = '6.1.0.3'
s.version = '7.0.0.0'
s.platform = :ios, '13.0'
s.summary = 'Yandex 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,14 +26,14 @@ s.source =

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

s.dependency 'YandexMobileAds', '= 6.1.0'
# Newer versions of DivKit do not work with YandexMobileAds. Try to remove this when updating Yandex.
s.dependency 'DivKit', '= 28.4.0'
# Newer versions of VGSL don't work with YandexMobileAds. Try to remove this when updating Yandex.
s.dependency 'VGSLCommonCore', '= 2.3.0'
s.dependency 'VGSLNetworking', '= 2.3.0'
s.dependency 'YandexMobileAds', '= 7.0.0'
s.dependency 'AppLovinSDK'
s.swift_version = '5.7'
s.swift_version = '5.9'

s.pod_target_xcconfig =
{
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'x86_64'
}

s.description = <<-DESC
Expand Down
7 changes: 7 additions & 0 deletions Yandex/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 7.0.0.0
* Certified with Yandex SDK 7.0.0.
* Update to use new APIs for signal collection and SDK version retrieval.
* Update to use new impression callback, `didTrackImpressionWith:`, for rewarded ads.
* Remove deprecated callbacks `didStartRewardedAdVideo` and `didCompleteRewardedAdVideo`.
* Updated minimum Xcode requirement to 15.0.

## 6.1.0.3
* Specified compatible version of Yandex dependency for republished SDK 6.1.0: VGSLCommonCore and VGSLNetworking (2.3.0).

Expand Down
2 changes: 2 additions & 0 deletions Yandex/YandexAdapter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = X8JXXK4FF5;
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = x86_64;
FRAMEWORK_SEARCH_PATHS = (
"$PROJECT_DIR/../../iOS-Workspace/Pods/**",
"$(inherited)",
Expand Down Expand Up @@ -329,6 +330,7 @@
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = X8JXXK4FF5;
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = x86_64;
FRAMEWORK_SEARCH_PATHS = (
"$PROJECT_DIR/../../iOS-Workspace/Pods/**",
"$(inherited)",
Expand Down
32 changes: 25 additions & 7 deletions Yandex/YandexAdapter/ALYandexMediationAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "ALYandexMediationAdapter.h"
#import <YandexMobileAds/YandexMobileAds.h>

#define ADAPTER_VERSION @"6.1.0.3"
#define ADAPTER_VERSION @"7.0.0.0"

/**
* Dedicated delegate object for Yandex interstitial ads.
Expand Down Expand Up @@ -86,7 +86,7 @@ + (void)initialize

- (NSString *)SDKVersion
{
return [YMAMobileAds SDKVersion];
return [YMAMobileAds sdkVersion];
}

- (NSString *)adapterVersion
Expand Down Expand Up @@ -136,7 +136,9 @@ - (void)collectSignalWithParameters:(id<MASignalCollectionParameters>)parameters
{
[self log: @"Collecting signal..."];

[ALYandexBidderTokenLoader loadBidderTokenWithCompletionHandler:^(NSString *bidderToken) {
YMABidderTokenRequestConfiguration *configuration = [[YMABidderTokenRequestConfiguration alloc] initWithAdType: [self toYandexAdType: parameters.adFormat]];

[ALYandexBidderTokenLoader loadBidderTokenWithRequestConfiguration: configuration completionHandler:^(NSString *bidderToken) {
[self log: @"Collected signal"];
[delegate didCollectSignal: bidderToken];
}];
Expand Down Expand Up @@ -309,6 +311,25 @@ - (YMABannerAdSize *)adSizeFromAdFormat:(MAAdFormat *)adFormat
return [YMABannerAdSize fixedSizeWithWidth: adFormat.size.width height: adFormat.size.height];
}

- (YMAAdType)toYandexAdType:(MAAdFormat *)adFormat
{
if ( adFormat == MAAdFormat.interstitial )
{
return YMAAdTypeInterstitial;
}
else if ( adFormat == MAAdFormat.rewarded )
{
return YMAAdTypeRewarded;
}
else if ( [adFormat isAdViewAd] )
{
return YMAAdTypeBanner;
}

[NSException raise: NSInvalidArgumentException format: @"Unsupported ad format: %@", adFormat];
return -1;
}

+ (MAAdapterError *)toMaxError:(NSError *)yandexError
{
YMAAdErrorCode yandexErrorCode = yandexError.code;
Expand Down Expand Up @@ -473,17 +494,15 @@ - (void)rewardedAdDidShow:(YMARewardedAd *)rewardedAd
if ( [self.parameters isTesting] )
{
[self.delegate didDisplayRewardedAd];
[self.delegate didStartRewardedAdVideo];
}
}

// Note: This method is generally called with a 3 second delay after the ad has been displayed.
// This method is not called for test mode ads.
- (void)rewardedAd:(YMARewardedAd *)rewardedAd didTrackImpressionWithData:(nullable id<YMAImpressionData>)impressionData
- (void)rewardedAd:(YMARewardedAd *)rewardedAd didTrackImpressionWith:(id<YMAImpressionData>)impressionData
{
[self.parentAdapter log: @"Rewarded ad impression tracked"];
[self.delegate didDisplayRewardedAd];
[self.delegate didStartRewardedAdVideo];
}

- (void)rewardedAd:(YMARewardedAd *)rewardedAd didFailToShowWithError:(NSError *)error
Expand Down Expand Up @@ -515,7 +534,6 @@ - (void)rewardedAd:(YMARewardedAd *)rewardedAd didReward:(id<YMAReward>)reward
- (void)rewardedAdDidDismiss:(YMARewardedAd *)rewardedAd
{
[self.parentAdapter log: @"Rewarded ad hidden"];
[self.delegate didCompleteRewardedAdVideo];

if ( [self hasGrantedReward] || [self.parentAdapter shouldAlwaysRewardUser] )
{
Expand Down

0 comments on commit efb360b

Please sign in to comment.