diff --git a/Examples/ThirdPartyMediationAdapterTemplate/ThirdPartyMediationAdapterTemplate.xcodeproj/project.pbxproj b/Examples/ThirdPartyMediationAdapterTemplate/ThirdPartyMediationAdapterTemplate.xcodeproj/project.pbxproj index 9e5e9aa..3c37541 100644 --- a/Examples/ThirdPartyMediationAdapterTemplate/ThirdPartyMediationAdapterTemplate.xcodeproj/project.pbxproj +++ b/Examples/ThirdPartyMediationAdapterTemplate/ThirdPartyMediationAdapterTemplate.xcodeproj/project.pbxproj @@ -284,7 +284,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 7.1.1; + CURRENT_PROJECT_VERSION = 7.2.0; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -305,7 +305,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 17.0; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 7.1.1; + MARKETING_VERSION = 7.2.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -349,7 +349,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 7.1.1; + CURRENT_PROJECT_VERSION = 7.2.0; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -364,7 +364,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 17.0; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 7.1.1; + MARKETING_VERSION = 7.2.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExample.xcodeproj/project.pbxproj b/Examples/YandexMobileAdsExample/YandexMobileAdsExample.xcodeproj/project.pbxproj index c72d174..f9aa85f 100644 --- a/Examples/YandexMobileAdsExample/YandexMobileAdsExample.xcodeproj/project.pbxproj +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExample.xcodeproj/project.pbxproj @@ -52,6 +52,10 @@ 46C354A0282560FE00832C7C /* IronSourceRewardedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46C3549D282560FE00832C7C /* IronSourceRewardedViewController.swift */; }; 46C354A1282560FE00832C7C /* IronSourceInterstitialViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46C3549E282560FE00832C7C /* IronSourceInterstitialViewController.swift */; }; 46C354A2282560FE00832C7C /* IronSourceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46C3549F282560FE00832C7C /* IronSourceManager.swift */; }; + 4A8FA13B2BFB558700A3DB07 /* NativeBulkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A8FA13A2BFB558700A3DB07 /* NativeBulkViewController.swift */; }; + 4A8FA13C2BFB559000A3DB07 /* NativeBulkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A8FA13A2BFB558700A3DB07 /* NativeBulkViewController.swift */; }; + 4A8FA13F2BFC9AF800A3DB07 /* NativeBulkTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A8FA13E2BFC9AF800A3DB07 /* NativeBulkTableViewCell.swift */; }; + 4A8FA1402BFC9AF800A3DB07 /* NativeBulkTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A8FA13E2BFC9AF800A3DB07 /* NativeBulkTableViewCell.swift */; }; 646CB7F62B0B5B6F0056DFD5 /* YandexAdsExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 646CB7F52B0B5B6F0056DFD5 /* YandexAdsExampleViewController.swift */; }; 64F70DBA2B0B64D300A31CE8 /* LinkedList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14033F982720457800A24D5E /* LinkedList.swift */; }; 64F70DBC2B0B64D300A31CE8 /* GDPRUserConsentManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1474FC182721A4E500276688 /* GDPRUserConsentManager.swift */; }; @@ -243,6 +247,8 @@ 46C3549D282560FE00832C7C /* IronSourceRewardedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IronSourceRewardedViewController.swift; sourceTree = ""; }; 46C3549E282560FE00832C7C /* IronSourceInterstitialViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IronSourceInterstitialViewController.swift; sourceTree = ""; }; 46C3549F282560FE00832C7C /* IronSourceManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IronSourceManager.swift; sourceTree = ""; }; + 4A8FA13A2BFB558700A3DB07 /* NativeBulkViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NativeBulkViewController.swift; sourceTree = ""; }; + 4A8FA13E2BFC9AF800A3DB07 /* NativeBulkTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NativeBulkTableViewCell.swift; sourceTree = ""; }; 5BF35ACE34CE63F32697C83A /* libPods-YandexMobileAdsExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-YandexMobileAdsExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 646CB7F52B0B5B6F0056DFD5 /* YandexAdsExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YandexAdsExampleViewController.swift; sourceTree = ""; }; 64F70E022B0B64D300A31CE8 /* YandexMobileAdsExampleSPM.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YandexMobileAdsExampleSPM.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -555,6 +561,7 @@ 147B0BCA27200CF3005F4062 /* Native */ = { isa = PBXGroup; children = ( + 4A8FA13D2BFC9AD300A3DB07 /* Bulk */, DEC81AE12A53C840008FE935 /* NativeViewController.swift */, DE0C2CBD2A65760900A84D00 /* NativeTemplateViewController.swift */, DE0C2CBF2A66245700A84D00 /* NativeCustomViewController.swift */, @@ -626,6 +633,15 @@ path = IronSource; sourceTree = ""; }; + 4A8FA13D2BFC9AD300A3DB07 /* Bulk */ = { + isa = PBXGroup; + children = ( + 4A8FA13A2BFB558700A3DB07 /* NativeBulkViewController.swift */, + 4A8FA13E2BFC9AF800A3DB07 /* NativeBulkTableViewCell.swift */, + ); + path = Bulk; + sourceTree = ""; + }; 5E36114E6565E861DBB72B75 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -975,6 +991,7 @@ 7AA816982B20BF32006C9D91 /* YandexNativeAccessibility.swift in Sources */, F7D8B4D32A97B41F00E7A40D /* AppOpenAdViewController.swift in Sources */, DEC81AE22A53C840008FE935 /* NativeViewController.swift in Sources */, + 4A8FA13F2BFC9AF800A3DB07 /* NativeBulkTableViewCell.swift in Sources */, 46C354A2282560FE00832C7C /* IronSourceManager.swift in Sources */, DE6D740A2A740DF30024DA8F /* InstreamSingleViewController.swift in Sources */, 14033FBA2720457800A24D5E /* PlayerView.swift in Sources */, @@ -987,6 +1004,7 @@ 14033F6827201F7900A24D5E /* MobileMediationRewardedViewController.swift in Sources */, B394AC8627A868DB00D92CD9 /* AdPlayerErrorConverter.swift in Sources */, 14033FB92720457800A24D5E /* ContentPlayerControlsDelegate.swift in Sources */, + 4A8FA13B2BFB558700A3DB07 /* NativeBulkViewController.swift in Sources */, 14033FC02720457800A24D5E /* InstreamAdBreakPositionFormatter.swift in Sources */, 14033FBF2720457800A24D5E /* InstreamParametersParser.swift in Sources */, DEC81ADC2A53B9E7008FE935 /* String+Extensions.swift in Sources */, @@ -1040,11 +1058,13 @@ 64F70DD82B0B64D300A31CE8 /* InstreamListViewController.swift in Sources */, 64F70DD92B0B64D300A31CE8 /* SettingsViewController.swift in Sources */, 64F70DDA2B0B64D300A31CE8 /* AppOpenAdViewController.swift in Sources */, + 4A8FA13C2BFB559000A3DB07 /* NativeBulkViewController.swift in Sources */, 64F70DDB2B0B64D300A31CE8 /* NativeViewController.swift in Sources */, 64F70DDD2B0B64D300A31CE8 /* InstreamSingleViewController.swift in Sources */, 64F70DDE2B0B64D300A31CE8 /* PlayerView.swift in Sources */, 64F70DDF2B0B64D300A31CE8 /* AdFoxBannerViewController.swift in Sources */, 64F70DE02B0B64D300A31CE8 /* VideoPlayerVisibilityTracker.swift in Sources */, + 4A8FA1402BFC9AF800A3DB07 /* NativeBulkTableViewCell.swift in Sources */, 64F70DE12B0B64D300A31CE8 /* YandexAdsExampleViewController.swift in Sources */, 7AA816A42B20D76E006C9D91 /* YandexNativeAccessibility.swift in Sources */, 64F70DE22B0B64D300A31CE8 /* GDPRViewController.swift in Sources */, @@ -1177,7 +1197,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 7.1.1; + CURRENT_PROJECT_VERSION = 7.2.0; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -1196,7 +1216,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 14.5; - MARKETING_VERSION = 7.1.1; + MARKETING_VERSION = 7.2.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -1240,7 +1260,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 7.1.1; + CURRENT_PROJECT_VERSION = 7.2.0; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1253,7 +1273,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 14.5; - MARKETING_VERSION = 7.1.1; + MARKETING_VERSION = 7.2.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; @@ -1351,7 +1371,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 7.1.1; + CURRENT_PROJECT_VERSION = 7.2.0; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1364,7 +1384,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 14.5; - MARKETING_VERSION = 7.1.1; + MARKETING_VERSION = 7.2.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Accessibility/CommonAccessibility.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Accessibility/CommonAccessibility.swift index 099041e..f3fc5ec 100644 --- a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Accessibility/CommonAccessibility.swift +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Accessibility/CommonAccessibility.swift @@ -3,4 +3,5 @@ enum CommonAccessibility { static let presentButton = "present_button" static let stateLabel = "state_label" static let bannerView = "banner_view" + static let bannerCellView = "banner_cell_view_" } diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Accessibility/YandexNativeAccessibility.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Accessibility/YandexNativeAccessibility.swift index c316727..769c7fc 100644 --- a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Accessibility/YandexNativeAccessibility.swift +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Accessibility/YandexNativeAccessibility.swift @@ -1,4 +1,5 @@ enum YandexNativeAccessibility { static let template = "template" static let custom = "custom" + static let bulk = "bulk" } diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationBannerViewController.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationBannerViewController.swift index 734e898..7dbc808 100644 --- a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationBannerViewController.swift +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationBannerViewController.swift @@ -17,6 +17,7 @@ private let bigoAdsAdUnitID = "demo-banner-bigoads" private let inMobiAdsAdUnitID = "demo-banner-inmobi" private let ironSourceAdUnitID = "demo-banner-ironsource" private let startAppAdUnitID = "demo-banner-startapp" +private let vungleAdUnitID = "demo-banner-vungle" private let yandexAdUnitID = "demo-banner-yandex" class MobileMediationBannerViewController: UIViewController { @@ -31,6 +32,7 @@ class MobileMediationBannerViewController: UIViewController { (adapter: "MyTarget", adUnitID: myTargetAdUnitID), (adapter: "IronSource", adUnitID: ironSourceAdUnitID), (adapter: "StartApp", adUnitID: startAppAdUnitID), + (adapter: "Vungle", adUnitID: vungleAdUnitID), (adapter: "Yandex", adUnitID: yandexAdUnitID) ] diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationInterstitialViewController.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationInterstitialViewController.swift index 9b32502..71cd8d5 100644 --- a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationInterstitialViewController.swift +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationInterstitialViewController.swift @@ -19,6 +19,7 @@ private let adColonyAdUnitID = "demo-interstitial-adcolony" private let bigoAdsAdUnitID = "demo-interstitial-bigoads" private let inMobiAdUnitID = "demo-interstitial-inmobi" private let startAppAdUnitID = "demo-interstitial-startapp" +private let vungleAdUnitID = "demo-interstitial-vungle" private let yandexAdUnitID = "demo-interstitial-yandex" class MobileMediationInterstitialViewController: UIViewController { @@ -34,6 +35,7 @@ class MobileMediationInterstitialViewController: UIViewController { (adapter: "MyTarget", adUnitID: myTargetAdUnitID), (adapter: "StartApp", adUnitID: startAppAdUnitID), (adapter: "UnityAds", adUnitID: unityAdsAdUnitID), + (adapter: "Vungle", adUnitID: vungleAdUnitID), (adapter: "Yandex", adUnitID: yandexAdUnitID) ] private let interstitialAdLoader = InterstitialAdLoader() diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationNativeViewController.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationNativeViewController.swift index 166b627..f8e923b 100644 --- a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationNativeViewController.swift +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationNativeViewController.swift @@ -8,13 +8,17 @@ import YandexMobileAds private let adMobAdUnitID = "demo-native-admob" +private let mintegralAdUnitID = "demo-native-mintegral" private let myTargetAdUnitID = "demo-native-mytarget" private let yandexAdUnitID = "demo-native-content-yandex" +private let vungleAdUnitID = "demo-native-vungle" class MobileMediationNativeViewController: UIViewController { private let adUnitIDs = [ (adapter: "AdMob", adUnitID: adMobAdUnitID), + (adapter: "Mintegral", adUnitID: mintegralAdUnitID), (adapter: "MyTarget", adUnitID: myTargetAdUnitID), + (adapter: "Vungle", adUnitID: vungleAdUnitID), (adapter: "Yandex", adUnitID: yandexAdUnitID) ] diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationRewardedViewController.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationRewardedViewController.swift index 4e72899..89c1cfb 100644 --- a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationRewardedViewController.swift +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/MobileMediation/MobileMediationRewardedViewController.swift @@ -19,6 +19,7 @@ private let adColonyAdUnitID = "demo-rewarded-adcolony" private let bigoAdsAdUnitID = "demo-rewarded-bigoads" private let inMobiAdUnitID = "demo-rewarded-inmobi" private let startAppAdUnitID = "demo-rewarded-startapp" +private let vungleAdUnitID = "demo-rewarded-vungle" private let yandexAdUnitID = "demo-rewarded-yandex" class MobileMediationRewardedViewController: UIViewController { @@ -34,6 +35,7 @@ class MobileMediationRewardedViewController: UIViewController { (adapter: "MyTarget", adUnitID: myTargetAdUnitID), (adapter: "StartApp", adUnitID: startAppAdUnitID), (adapter: "UnityAds", adUnitID: unityAdsAdUnitID), + (adapter: "Vungle", adUnitID: vungleAdUnitID), (adapter: "Yandex", adUnitID: yandexAdUnitID) ] private let rewardedAdLoader = RewardedAdLoader() diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Third-PartyMediation/AdMob/AdMobNativeViewController.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Third-PartyMediation/AdMob/AdMobNativeViewController.swift index 0fa608a..eea64a2 100644 --- a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Third-PartyMediation/AdMob/AdMobNativeViewController.swift +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Third-PartyMediation/AdMob/AdMobNativeViewController.swift @@ -64,7 +64,7 @@ class AdMobNativeViewController: UIViewController { } } -extension AdMobNativeViewController: GADNativeAdLoaderDelegate, GADNativeAdDelegate { +extension AdMobNativeViewController: GADNativeAdLoaderDelegate { func adLoader(_: GADAdLoader, didReceive nativeAd: GADNativeAd) { guard let adView = adView else { return } @@ -78,3 +78,15 @@ extension AdMobNativeViewController: GADNativeAdLoaderDelegate, GADNativeAdDeleg print("Ad loader did fail to receive ad with error: \(error.localizedDescription)") } } + +// MARK: - GADNativeAdDelegate implementation +extension AdMobNativeViewController: GADNativeAdDelegate { + + func nativeAdDidRecordClick(_ nativeAd: GADNativeAd) { + print("\(#function) called") + } + + func nativeAdDidRecordImpression(_ nativeAd: GADNativeAd) { + print("\(#function) called") + } +} diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Third-PartyMediation/IronSource/IronSourceBannerViewController.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Third-PartyMediation/IronSource/IronSourceBannerViewController.swift index 9c88bbb..17dba25 100644 --- a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Third-PartyMediation/IronSource/IronSourceBannerViewController.swift +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Third-PartyMediation/IronSource/IronSourceBannerViewController.swift @@ -28,6 +28,8 @@ final class IronSourceBannerViewController: UIViewController { let constraints = [ banner.bottomAnchor.constraint(equalTo: layoutGuide.bottomAnchor), banner.centerXAnchor.constraint(equalTo: layoutGuide.centerXAnchor), + banner.widthAnchor.constraint(equalToConstant: banner.frame.size.width), + banner.heightAnchor.constraint(equalToConstant: banner.frame.size.height) ] NSLayoutConstraint.activate(constraints) } diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Yandex/Native/Bulk/NativeBulkTableViewCell.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Yandex/Native/Bulk/NativeBulkTableViewCell.swift new file mode 100644 index 0000000..ba49655 --- /dev/null +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Yandex/Native/Bulk/NativeBulkTableViewCell.swift @@ -0,0 +1,79 @@ +/* + * Version for iOS © 2015–2023 YANDEX + * + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://yandex.com/legal/mobileads_sdk_agreement/ + */ + +import YandexMobileAds + +final class NativeBulkTableViewCell: UITableViewCell { + static var reuseIdentifier: String { String(describing: Self.self) } + + private let adView: NativeCustomAdView = .init() + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + setupViews() + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setupViews() { + adView.translatesAutoresizingMaskIntoConstraints = false + contentView.addSubview(adView) + + let margins = contentView.layoutMarginsGuide + + NSLayoutConstraint.activate([ + adView.topAnchor.constraint(equalTo: margins.topAnchor), + adView.leadingAnchor.constraint(equalTo: margins.leadingAnchor), + adView.trailingAnchor.constraint(equalTo: margins.trailingAnchor), + adView.bottomAnchor.constraint(equalTo: margins.bottomAnchor), + ]) + } + + public func bindNativeAd(_ ad: NativeAd) { + ad.delegate = self + do { + try ad.bind(with: adView) + adView.isHidden = false + adView.callToActionButton?.accessibilityIdentifier = "call" + setNeedsLayout() + layoutIfNeeded() + } catch { + print("Binding error: \(error)") + } + } +} + +// MARK: - YMANativeAdDelegate + +extension NativeBulkTableViewCell: NativeAdDelegate { + func nativeAdDidClick(_ ad: NativeAd) { + print(#function) + } + + func nativeAdWillLeaveApplication(_ ad: NativeAd) { + print(#function) + } + + func nativeAd(_ ad: NativeAd, willPresentScreen viewController: UIViewController?) { + print(#function) + } + + func nativeAd(_ ad: NativeAd, didTrackImpressionWith impressionData: ImpressionData?) { + print(#function) + } + + func nativeAd(_ ad: NativeAd, didDismissScreen viewController: UIViewController?) { + print(#function) + } + + func close(_ ad: NativeAd) { + print(#function) + } +} diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Yandex/Native/Bulk/NativeBulkViewController.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Yandex/Native/Bulk/NativeBulkViewController.swift new file mode 100644 index 0000000..ef65af8 --- /dev/null +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Yandex/Native/Bulk/NativeBulkViewController.swift @@ -0,0 +1,158 @@ +/* + * Version for iOS © 2015–2023 YANDEX + * + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://yandex.com/legal/mobileads_sdk_agreement/ + */ + +import YandexMobileAds + +final class NativeBulkViewController: UIViewController { + private var ads: [NativeAd] = [] + + private lazy var adView: UITableView = { + let tableView = UITableView() + tableView.isHidden = true + tableView.accessibilityIdentifier = CommonAccessibility.bannerView + tableView.translatesAutoresizingMaskIntoConstraints = false + tableView.register( + NativeBulkTableViewCell.self, + forCellReuseIdentifier: NativeBulkTableViewCell.reuseIdentifier + ) + tableView.dataSource = self + return tableView + }() + + private lazy var loadButton: UIButton = { + let button = UIButton( + configuration: .tinted(), + primaryAction: UIAction(title: "Load ad") { [weak self] _ in + self?.loadNativeAd() + } + ) + button.translatesAutoresizingMaskIntoConstraints = false + button.setTitle("Load ad", for: .normal) + button.accessibilityIdentifier = CommonAccessibility.loadButton + return button + }() + + private lazy var stateLabel: UILabel = { + let label = UILabel() + label.accessibilityIdentifier = CommonAccessibility.stateLabel + label.numberOfLines = 0 + label.translatesAutoresizingMaskIntoConstraints = false + return label + }() + + private lazy var adLoader: NativeBulkAdLoader = { + let adLoader = NativeBulkAdLoader() + adLoader.delegate = self + return adLoader + }() + + override func viewDidLoad() { + super.viewDidLoad() + setupUI() + addSubviews() + setupConstraints() + } + + // MARK: - Ad + + private func loadNativeAd() { + // Replace demo-native-bulk-yandex with actual Ad Unit ID + let requestConfiguration = NativeAdRequestConfiguration(adUnitID: "demo-native-bulk-yandex") + adLoader.loadAds(with: requestConfiguration, adsCount: 3) + stateLabel.text = nil + } + + // MARK: - UI + + private func setupUI() { + view.backgroundColor = .white + title = "Native Custom Ad" + } + + private func addSubviews() { + view.addSubview(adView) + view.addSubview(loadButton) + view.addSubview(stateLabel) + } + + private func setupConstraints() { + let layoutGuide = view.safeAreaLayoutGuide + NSLayoutConstraint.activate([ + loadButton.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 10), + loadButton.centerXAnchor.constraint(equalTo: view.centerXAnchor), + + adView.topAnchor.constraint(equalTo: stateLabel.bottomAnchor, constant: -10), + adView.leadingAnchor.constraint(equalTo: layoutGuide.leadingAnchor, constant: 10), + adView.trailingAnchor.constraint(equalTo: layoutGuide.trailingAnchor, constant: -10), + adView.bottomAnchor.constraint(equalTo: layoutGuide.bottomAnchor, constant: -10), + + stateLabel.topAnchor.constraint(equalTo: loadButton.bottomAnchor, constant: 10), + stateLabel.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 10), + stateLabel.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -10), + stateLabel.heightAnchor.constraint(equalToConstant: 40), + ]) + } +} + +// MARK: - YMANativeAdDelegate + +extension NativeBulkViewController: NativeAdDelegate { + func nativeAdDidClick(_ ad: NativeAd) { + print(#function) + } + + func nativeAdWillLeaveApplication(_ ad: NativeAd) { + print(#function) + } + + func nativeAd(_ ad: NativeAd, willPresentScreen viewController: UIViewController?) { + print(#function) + } + + func nativeAd(_ ad: NativeAd, didTrackImpressionWith impressionData: ImpressionData?) { + print(#function) + } + + func nativeAd(_ ad: NativeAd, didDismissScreen viewController: UIViewController?) { + print(#function) + } + + func close(_ ad: NativeAd) { + print(#function) + } +} + +extension NativeBulkViewController: UITableViewDataSource { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return ads.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + guard let cell = tableView.dequeueReusableCell(withIdentifier: NativeBulkTableViewCell.reuseIdentifier, for: indexPath) as? NativeBulkTableViewCell else { + return UITableViewCell() + } + cell.accessibilityIdentifier = CommonAccessibility.bannerCellView + "\(indexPath.row)" + cell.bindNativeAd(ads[indexPath.row]) + return cell + } +} + +// MARK: - YMANativeAdDelegate + +extension NativeBulkViewController: NativeBulkAdLoaderDelegate { + func nativeBulkAdLoader(_ nativeBulkAdLoader: YandexMobileAds.NativeBulkAdLoader, didLoad ads: [YandexMobileAds.NativeAd]) { + stateLabel.text = StateUtils.loaded() + self.ads = ads + adView.isHidden = false + adView.reloadData() + } + + func nativeBulkAdLoader(_ nativeBulkAdLoader: YandexMobileAds.NativeBulkAdLoader, didFailLoadingWithError error: Error) { + stateLabel.text = StateUtils.loadError(error) + print(#function) + } +} diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Yandex/Native/NativeViewController.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Yandex/Native/NativeViewController.swift index d7751f9..5fa508a 100644 --- a/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Yandex/Native/NativeViewController.swift +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Yandex/Native/NativeViewController.swift @@ -11,6 +11,7 @@ import UIKit enum NativeCellModel: NavigationScreenDataSource, CaseIterable { case template case custom + case bulk var destinationViewController: UIViewController { switch self { @@ -18,6 +19,8 @@ enum NativeCellModel: NavigationScreenDataSource, CaseIterable { return NativeTemplateViewController() case .custom: return NativeCustomViewController() + case .bulk: + return NativeBulkViewController() } } @@ -31,6 +34,8 @@ enum NativeCellModel: NavigationScreenDataSource, CaseIterable { YandexNativeAccessibility.template case .custom: YandexNativeAccessibility.custom + case .bulk: + YandexNativeAccessibility.bulk } } } diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExampleUITests/Pages/YandexNativeAdPage.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExampleUITests/Pages/YandexNativeAdPage.swift index cf64af5..e460037 100644 --- a/Examples/YandexMobileAdsExample/YandexMobileAdsExampleUITests/Pages/YandexNativeAdPage.swift +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExampleUITests/Pages/YandexNativeAdPage.swift @@ -3,6 +3,8 @@ import XCTest struct YandexNativeAdPage: PageObject { var loadButton: XCUIElement { element(id: CommonAccessibility.loadButton, type: .button) } var adView: XCUIElement { element(id: CommonAccessibility.bannerView, type: .other) } + var adsView: XCUIElement { element(id: CommonAccessibility.bannerView, type: .table) } + var adCellView: XCUIElement { element(id: CommonAccessibility.bannerCellView + "0", type: .cell) } var stateLabel: XCUIElement { element(id: CommonAccessibility.stateLabel, type: .staticText) } func tapLoadAd() { @@ -22,4 +24,16 @@ struct YandexNativeAdPage: PageObject { XCTAssertTrue(adView.waitForExistence(timeout: 5)) } } + + func assertAdsDisplayed() { + step("Assert ad displayed") { + XCTAssertTrue(adsView.waitForExistence(timeout: 5)) + } + } + + func tapBulkAd() { + step("Tap ad") { + adCellView.tap() + } + } } diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExampleUITests/Pages/YandexNativePage.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExampleUITests/Pages/YandexNativePage.swift index ab0e0ab..25ee943 100644 --- a/Examples/YandexMobileAdsExample/YandexMobileAdsExampleUITests/Pages/YandexNativePage.swift +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExampleUITests/Pages/YandexNativePage.swift @@ -3,6 +3,7 @@ import XCTest struct YandexNativePage: PageObject { var custom: XCUIElement { element(id: YandexNativeAccessibility.custom, type: .cell) } var template: XCUIElement { element(id: YandexNativeAccessibility.template, type: .cell) } + var bulk: XCUIElement { element(id: YandexNativeAccessibility.bulk, type: .cell) } func openCustom() { step("Open custom") { @@ -15,4 +16,10 @@ struct YandexNativePage: PageObject { template.tap() } } + + func openBulk() { + step("Open bulk") { + bulk.tap() + } + } } diff --git a/Examples/YandexMobileAdsExample/YandexMobileAdsExampleUITests/Tests/YandexNativeTest.swift b/Examples/YandexMobileAdsExample/YandexMobileAdsExampleUITests/Tests/YandexNativeTest.swift index 9f462a2..6125162 100644 --- a/Examples/YandexMobileAdsExample/YandexMobileAdsExampleUITests/Tests/YandexNativeTest.swift +++ b/Examples/YandexMobileAdsExample/YandexMobileAdsExampleUITests/Tests/YandexNativeTest.swift @@ -27,4 +27,16 @@ final class YandexNativeTest: BaseTest { nativePage.tapAd() assertSafariOpened() } + + func testNativeBulkTemplate() throws { + launchApp() + rootPage.openYandex() + yandexAdsPage.openNative() + nativeListPage.openBulk() + nativePage.tapLoadAd() + try assertAdLoaded(stateLabel: nativePage.stateLabel) + nativePage.assertAdsDisplayed() + nativePage.tapBulkAd() + assertSafariOpened() + } } diff --git a/Package.swift b/Package.swift index 33f7bc9..4c50fe8 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/appmetrica/appmetrica-sdk-ios", "5.0.0"..<"6.0.0"), - .package(url: "https://github.com/divkit/divkit-ios", exact: "30.2.0") + .package(url: "https://github.com/divkit/divkit-ios", exact: "30.7.0") ], targets: [ .target( @@ -28,12 +28,10 @@ let package = Package( .product(name: "AppMetricaCrashes", package: "appmetrica-sdk-ios"), .product(name: "DivKit", package: "divkit-ios") ], - resources: [ - .process("Resources") - ], linkerSettings: [ .linkedFramework("AVFoundation"), .linkedFramework("AdSupport"), + .linkedFramework("AppTrackingTransparency"), .linkedFramework("CoreGraphics"), .linkedFramework("CoreImage"), .linkedFramework("CoreLocation"), @@ -52,13 +50,13 @@ let package = Package( ), .binaryTarget( name: "YandexMobileAds", - url: "https://ads-mobile-sdk.s3.yandex.net/Yandex/YandexMobileAds/7.1.1/spm/f1f4933e-d5c5-4b34-a486-4b8248157c19.zip", - checksum: "3d05668065b5cfc06cee8f28b4efe031f78727e5134490bc5ea10e7a941eae31" + url: "https://ads-mobile-sdk.s3.yandex.net/Yandex/YandexMobileAds/7.2.0/spm/bb634541-f72b-4f3d-a88c-90b56077c1a1.zip", + checksum: "92d55937cf6d62bb0dfe4ab679290c25b53413701557e500806c4a9e8dc16a9e" ), .binaryTarget( name: "YandexMobileAdsInstream", - url: "https://ads-mobile-sdk.s3.yandex.net/YandexMobileAdsInstream/0.30.0/spm/96edbdc8-468d-4023-8883-a5f88ae4af63.zip", - checksum: "17c0326b15607d089c4d8415f531dfd28c4b53c9b1495c3ad3e6c12cf9437034" + url: "https://ads-mobile-sdk.s3.yandex.net/YandexMobileAdsInstream/0.31.0/spm/2302cb4e-412f-4ef8-ae0c-858f0fb6e487.zip", + checksum: "abb9d5bd110cc4654e25b970c6bfe1844801ed4037088767a153f5b63f4ae7ed" ) ] ) \ No newline at end of file diff --git a/changelog/adapter/admob-mobileads/CHANGELOG.md b/changelog/adapter/admob-mobileads/CHANGELOG.md index f6750a9..b0abacc 100644 --- a/changelog/adapter/admob-mobileads/CHANGELOG.md +++ b/changelog/adapter/admob-mobileads/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## Version 7.2.0.0 + +### Updated + +- Updated minimum supported `YandexMobileAds` version to `7.2.0` + ## Version 7.1.1.0 ### Updated diff --git a/changelog/adapter/ironsource-mobileads/CHANGELOG.md b/changelog/adapter/ironsource-mobileads/CHANGELOG.md index a5ca89c..654aba3 100644 --- a/changelog/adapter/ironsource-mobileads/CHANGELOG.md +++ b/changelog/adapter/ironsource-mobileads/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## Version 7.2.0.0 + +### Updated + +- Updated minimum supported `YandexMobileAds` version to `7.2.0` + ## Version 7.1.1.0 ### Updated diff --git a/changelog/mediation/mobileads-adcolony/CHANGELOG.md b/changelog/mediation/mobileads-adcolony/CHANGELOG.md index 9ed2ae0..9f7b88c 100644 --- a/changelog/mediation/mobileads-adcolony/CHANGELOG.md +++ b/changelog/mediation/mobileads-adcolony/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## Version 4.9.0.16 + +### Updated + +- Updated minimum supported `YandexMobileAds` version to `7.2.0` + ## Version 4.9.0.15 ### Updated diff --git a/changelog/mediation/mobileads-applovin/CHANGELOG.md b/changelog/mediation/mobileads-applovin/CHANGELOG.md index ac2558a..386b97a 100644 --- a/changelog/mediation/mobileads-applovin/CHANGELOG.md +++ b/changelog/mediation/mobileads-applovin/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## Version 12.5.0.2 + +### Updated + +- Updated minimum supported `YandexMobileAds` version to `7.2.0` + ## Version 12.5.0.1 ### Updated diff --git a/changelog/mediation/mobileads-bigoads/CHANGELOG.md b/changelog/mediation/mobileads-bigoads/CHANGELOG.md index 46f3b26..61f5b93 100644 --- a/changelog/mediation/mobileads-bigoads/CHANGELOG.md +++ b/changelog/mediation/mobileads-bigoads/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## Version 4.2.3.2 + +### Updated + +- Updated minimum supported `YandexMobileAds` version to `7.2.0` + ## Version 4.2.3.1 ### Updated diff --git a/changelog/mediation/mobileads-chartboost/CHANGELOG.md b/changelog/mediation/mobileads-chartboost/CHANGELOG.md index 4eab65b..6e1f54c 100644 --- a/changelog/mediation/mobileads-chartboost/CHANGELOG.md +++ b/changelog/mediation/mobileads-chartboost/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## Version 9.7.0.5 + +### Updated + +- Updated minimum supported `YandexMobileAds` version to `7.2.0` + ## Version 9.7.0.4 ### Updated diff --git a/changelog/mediation/mobileads-google/CHANGELOG.md b/changelog/mediation/mobileads-google/CHANGELOG.md index 0ab38a3..fb4eb02 100644 --- a/changelog/mediation/mobileads-google/CHANGELOG.md +++ b/changelog/mediation/mobileads-google/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## Version 11.3.0.2 + +### Updated + +- Updated minimum supported `YandexMobileAds` version to `7.2.0` + ## Version 11.3.0.1 ### Updated diff --git a/changelog/mediation/mobileads-inmobi/CHANGELOG.md b/changelog/mediation/mobileads-inmobi/CHANGELOG.md index 0c97ccc..69d8de1 100644 --- a/changelog/mediation/mobileads-inmobi/CHANGELOG.md +++ b/changelog/mediation/mobileads-inmobi/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## Version 10.7.4.0 + +### Updated + +- Updated minimum supported `InMobiSDK-Swift` version to `10.7.4` +- Updated minimum supported `YandexMobileAds` version to `7.2.0` + ## Version 10.5.5.11 ### Updated diff --git a/changelog/mediation/mobileads-ironsource/CHANGELOG.md b/changelog/mediation/mobileads-ironsource/CHANGELOG.md index 4738fe3..4480c7a 100644 --- a/changelog/mediation/mobileads-ironsource/CHANGELOG.md +++ b/changelog/mediation/mobileads-ironsource/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## Version 8.1.0.2 + +### Updated + +- Updated minimum supported `YandexMobileAds` version to `7.2.0` + ## Version 8.1.0.1 ### Updated diff --git a/changelog/mediation/mobileads-mintegral/CHANGELOG.md b/changelog/mediation/mobileads-mintegral/CHANGELOG.md index 0cfdecd..8cd0546 100644 --- a/changelog/mediation/mobileads-mintegral/CHANGELOG.md +++ b/changelog/mediation/mobileads-mintegral/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## Version 7.6.7.0 + +### Updated + +- Updated minimum supported `MintegralAdSDK` version to `7.6.7` +- Updated minimum supported `YandexMobileAds` version to `7.2.0` + ## Version 7.6.4.1 ### Updated diff --git a/changelog/mediation/mobileads-mytarget/CHANGELOG.md b/changelog/mediation/mobileads-mytarget/CHANGELOG.md index 8cd4275..3de52e1 100644 --- a/changelog/mediation/mobileads-mytarget/CHANGELOG.md +++ b/changelog/mediation/mobileads-mytarget/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## Version 5.21.4.0 + +### Updated + +- Updated minimum supported `YandexMobileAds` version to `7.2.0` +- Updated minimum supported `myTargetSDK` version to `5.21.4` + ## Version 5.21.2.1 ### Updated diff --git a/changelog/mediation/mobileads-startapp/CHANGELOG.md b/changelog/mediation/mobileads-startapp/CHANGELOG.md index d2f0726..af30b87 100644 --- a/changelog/mediation/mobileads-startapp/CHANGELOG.md +++ b/changelog/mediation/mobileads-startapp/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## Version 4.10.3.2 + +### Updated + +- Updated minimum supported `YandexMobileAds` version to `7.2.0` + ## Version 4.10.3.1 ### Updated diff --git a/changelog/mediation/mobileads-unityads/CHANGELOG.md b/changelog/mediation/mobileads-unityads/CHANGELOG.md index c7723e3..d74851b 100644 --- a/changelog/mediation/mobileads-unityads/CHANGELOG.md +++ b/changelog/mediation/mobileads-unityads/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## Version 4.12.1.0 + +### Updated + +- Updated minimum supported `UnityAds` version to `4.12.1` +- Updated minimum supported `YandexMobileAds` version to `7.2.0` + ## Version 4.11.3.1 ### Updated diff --git a/changelog/mediation/mobileads-vungle/CHANGELOG.md b/changelog/mediation/mobileads-vungle/CHANGELOG.md index ea8d6ca..47301bf 100644 --- a/changelog/mediation/mobileads-vungle/CHANGELOG.md +++ b/changelog/mediation/mobileads-vungle/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## Version 7.4.0.0 + +### Updated + +- Updated minimum supported `VungleAds` version to `7.4.0` +- Updated minimum supported `YandexMobileAds` version to `7.2.0` + ## Version 7.3.2.1 ### Updated diff --git a/changelog/mobileads/CHANGELOG.md b/changelog/mobileads/CHANGELOG.md index 7b44d33..cd9b317 100644 --- a/changelog/mobileads/CHANGELOG.md +++ b/changelog/mobileads/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. +## Version 7.2.0 + +### Updated + +- Updated minimum supported `AppMetricaCore` version to `5.6.0` +- Updated minimum supported `AppMetricaCrashes` version to `5.6.0` +- Updated minimum supported `DivKit` version to `30.7.0` + ## Version 7.1.1 ### Fixed