Yandex Mobile Ads SDK 버전 8은 개발자 경험을 개선하기 위해 API에 여러 변경 사항을 도입합니다.
Примечание
프로젝트가 Objective-C인 경우 MainActor와 관련해 항목 14를 확인하세요. MainActor로 격리된 클래스를 올바르게 다루려면 메인 스레드에서 작업하세요.
주요 변경 사항
1. AdRequest 변경
- 모든 광고 형식에
AdRequest를 사용하세요.
AdRequestConfiguration, NativeAdRequestConfiguration 클래스와 모든 Mutable 요청 클래스가 제거되었습니다.
adUnitID 속성은 이제 AdRequest 초기화 시 필수 매개변수로 전달됩니다.
|
클래스
|
상태
|
|
AdRequestConfiguration
|
제거됨. AdRequest를 사용하세요
|
|
NativeAdRequestConfiguration
|
제거됨. AdRequest와 NativeAdOptions를 사용하세요
|
|
MutableAdRequest
|
제거됨
|
|
MutableAdRequestConfiguration
|
제거됨
|
|
MutableNativeAdRequestConfiguration
|
제거됨
|
예제
|
SDK 7
|
let configuration = AdRequestConfiguration(adUnitID: "R-M-XXXXX-YY")
loader.loadAd(with: configuration)
|
|
SDK 8
|
let request = AdRequest(adUnitID: "R-M-XXXXX-YY") loader.loadAd(with: request) { … }
|
|
SDK 7
|
YMAAdRequestConfiguration *configuration =
[[YMAAdRequestConfiguration alloc] initWithAdUnitID:@"R-M-XXXXX-YY"];
[loader loadAdWithConfiguration:configuration];
|
|
SDK 8
|
YMAAdRequest *request =
[[YMAAdRequest alloc] initWithAdUnitID:@"R-M-XXXXX-YY"];
[loader loadAdWithRequest:request
completionHandler:^(YMAInterstitialAd * _Nullable ad,
NSError * _Nullable error) {
if (ad) {
} else {
}
}];
|
2. Targeting 변경
age, gender, location, contextQuery, contextTags 필드가 AdRequest에서 제거되었습니다.
- 타겟팅 매개변수는 새 클래스
AdTargeting으로 관리합니다.
클래스 AdTargetInfo의 이름이 AdTargeting으로 변경되었고, AdRequestTokenConfiguration과 BidderTokenRequestConfiguration의 필드 targetInfo는 targeting으로 변경되었습니다.
|
클래스
|
상태
|
|
AdTargetInfo
|
AdTargeting(으)로 이름 변경
|
|
클래스
|
속성
|
상태
|
|
AdRequest
|
age
|
제거됨. AdTargeting.age를 사용하세요
|
|
gender
|
제거됨. AdTargeting.gender를 사용하세요
|
|
location
|
제거됨. AdTargeting.location을 사용하세요
|
|
contextQuery
|
제거됨. AdTargeting.contextQuery를 사용하세요
|
|
contextTags
|
제거됨. AdTargeting.contextTags를 사용하세요
|
|
targeting
|
추가됨
|
|
AdTargeting
|
targetInfo
|
targeting(으)로 이름 변경
|
예제
|
SDK 7
|
let request = AdRequest(
adUnitID: "R-M-XXXXX-YY",
age: 25,
gender: kYMAGenderMale,
location: location
)
|
|
SDK 8
|
let targeting = AdTargeting(
age: 25,
gender: .male,
location: location
)
let request = AdRequest(adUnitID: "R-M-XXXXX-YY", targeting: targeting)
|
|
SDK 7
|
YMAAdRequest *request = [[YMAAdRequest alloc] initWithAdUnitID:@"R-M-XXXXX-YY"
age:@(25)
gender:kYMAGenderMale
location:location];
|
|
SDK 8
|
YMAAdTargeting *targeting = [[YMAAdTargeting alloc] initWithAge:@(25)
gender:YMAGender.male
location:location
contextQuery:nil
contextTags:nil];
YMAAdRequest *request = [[YMAAdRequest alloc] initWithAdUnitID:@"R-M-XXXXX-YY"
targeting:targeting];
|
3. 광고 로더 변경
- 로딩 델리게이트가 제거되었으며, 로딩 결과는
completion 핸들러로 전달됩니다.
adUnitID 매개변수는 이제 AdRequest를 통해 전달됩니다.
|
클래스
|
로더
|
상태
|
|
AppOpenAdLoader
|
loadAd(with:) + 델리게이트
|
loadAd(with:completion:)(으)로 대체됨
|
|
InterstitialAdLoader
|
loadAd(with:) + 델리게이트
|
loadAd(with:completion:)(으)로 대체됨
|
|
RewardedAdLoader
|
loadAd(with:) + 델리게이트
|
loadAd(with:completion:)(으)로 대체됨
|
|
NativeAdLoader
|
loadAd(with:) + 델리게이트
|
loadAd(with:options:completion:)(으)로 대체됨
|
|
NativeBulkAdLoader
|
loadAds(with:adsCount:) + 델리게이트
|
loadAds(with:adsCount:options:completion:)(으)로 대체됨
|
|
SliderAdLoader
|
loadAd(with:) + 델리게이트
|
loadAd(with:options:completion:)(으)로 대체됨
|
|
클래스
|
상태
|
|
AppOpenAdLoaderDelegate
|
제거됨
|
|
InterstitialAdLoaderDelegate
|
|
RewardedAdLoaderDelegate
|
|
NativeAdLoaderDelegate
|
|
NativeBulkAdLoaderDelegate
|
|
SliderAdLoaderDelegate
|
예제
|
SDK 7
|
let configuration = AdRequestConfiguration(adUnitID: "R-M-XXXXX-YY")
interstitialAdLoader.delegate = self
interstitialAdLoader.loadAd(with: configuration)
let nativeConfiguration = NativeAdRequestConfiguration(adUnitID: "R-M-XXXXX-YY")
nativeAdLoader.delegate = self
nativeAdLoader.loadAd(with: nativeConfiguration)
|
|
SDK 8
|
let request = AdRequest(adUnitID: "R-M-XXXXX-YY")
interstitialAdLoader.loadAd(with: request) { result in
switch result {
case .success(let ad):
case .failure(let error):
}
}
let options = NativeAdOptions()
nativeAdLoader.loadAd(with: request, options: options) { result in
switch result {
case .success(let ad):
case .failure(let error):
}
}
|
|
SDK 7
|
YMAAdRequestConfiguration *configuration =
[[YMAAdRequestConfiguration alloc] initWithAdUnitID:@"R-M-XXXXX-YY"];
interstitialAdLoader.delegate = self;
[interstitialAdLoader loadAdWithConfiguration:configuration];
YMANativeAdRequestConfiguration *nativeConfig =
[[YMANativeAdRequestConfiguration alloc] initWithAdUnitID:@"R-M-XXXXX-YY"];
nativeAdLoader.delegate = self;
[nativeAdLoader loadAdWithConfiguration:nativeConfig];
|
|
SDK 8
|
YMAAdRequest *request =
[[YMAAdRequest alloc] initWithAdUnitID:@"R-M-XXXXX-YY"];
[interstitialAdLoader loadAdWithRequest:request
completionHandler:^(YMAInterstitialAd * _Nullable ad,
NSError * _Nullable error) {
if (ad) {
} else {
}
}];
YMANativeAdOptions *options = [[YMANativeAdOptions alloc] init];
[nativeAdLoader loadAdWithRequest:request
options:options
completionHandler:^(id<YMANativeAd> _Nullable ad,
NSError * _Nullable error) {
if (ad) {
} else {
}
}];
|
3.1 Structured Concurrency 지원
모든 광고 로더에 Swift Structured Concurrency(async/await) 지원이 추가되었습니다.
|
로더
|
메서드
|
상태
|
|
AppOpenAdLoader
|
loadAd(with:)
|
추가됨
|
|
InterstitialAdLoader
|
loadAd(with:)
|
|
RewardedAdLoader
|
loadAd(with:)
|
|
NativeAdLoader
|
loadAd(with:options:)
|
|
NativeBulkAdLoader
|
loadAds(with:adsCount:options:)
|
|
SliderAdLoader
|
loadAd(with:options:)
|
예제
let request = AdRequest(adUnitID: "R-M-XXXXX-YY")
let interstitialAd = try await interstitialAdLoader.loadAd(with: request)
let rewardedAd = try await rewardedAdLoader.loadAd(with: request)
let appOpenAd = try await appOpenAdLoader.loadAd(with: request)
let options = NativeAdOptions()
let nativeAd = try await nativeAdLoader.loadAd(with: request, options: options)
let sliderAd = try await sliderAdLoader.loadAd(with: request, options: options)
let nativeAds = try await nativeBulkAdLoader.loadAds(with: request, adsCount: 3, options: options)
Structured Concurrency는 Swift에서만 사용할 수 있습니다.
4. Banner API 변경
- 클래스
AdView의 이름이 BannerAdView로, 프로토콜 AdViewDelegate의 이름이 BannerAdViewDelegate로 변경되었습니다.
BannerAdView에서 adUnitID 속성이 제거되었으며, 이제 매 로드 전에 AdRequest 생성자로 adUnitID를 전달합니다.
BannerAdSize 팩토리 메서드 이름이 변경되었습니다.
|
클래스
|
상태
|
|
AdView
|
BannerAdView(으)로 이름 변경
|
|
AdViewDelegate
|
BannerAdViewDelegate(으)로 이름 변경
|
|
클래스
|
속성
|
상태
|
|
BannerAdView
|
adViewDidLoad
|
bannerAdViewDidLoad(으)로 이름 변경
|
|
adViewDidFailLoading
|
bannerAdViewDidFailLoading(으)로 이름 변경
|
|
adViewDidClick
|
bannerAdViewDidClick(으)로 이름 변경
|
|
adView(_:didTrackImpression:)
|
bannerAdView(_:didTrackImpression:)(으)로 이름 변경
|
|
AdView(adUnitID:adSize:)
|
BannerAdView(adSize:)(으)로 대체됨
|
|
AdView.adUnitID
|
BannerAdView.adInfo?.adUnitID(으)로 대체됨
|
|
AdView.loadAd()
|
제거됨
|
|
AdView.loadAd(with: AdRequest?)
|
BannerAdView.loadAd(with: AdRequest)(으)로 대체됨
|
|
BannerAdSize
|
fixedSize(withWidth:height:)
|
fixed(width:height:)(으)로 이름 변경
|
|
inlineSize(withWidth:maxHeight:)
|
inline(width:maxHeight:)(으)로 이름 변경
|
|
stickySize(withContainerWidth:)
|
sticky(containerWidth:)(으)로 이름 변경
|
예제
|
SDK 7
|
let adSize = BannerAdSize.stickySize(withContainerWidth: screenWidth)
let adView = AdView(adUnitID: "R-M-XXXXX-YY", adSize: adSize)
adView.delegate = self
adView.loadAd()
|
|
SDK 8
|
let adSize = BannerAdSize.sticky(containerWidth: screenWidth)
let bannerAdView = BannerAdView(adSize: adSize)
bannerAdView.delegate = self
let request = AdRequest(adUnitID: "R-M-XXXXX-YY")
bannerAdView.loadAd(with: request)
|
|
SDK 7
|
YMABannerAdSize *adSize = [YMABannerAdSize stickySizeWithContainerWidth:screenWidth];
YMAAdView *adView = [[YMAAdView alloc] initWithAdUnitID:@"R-M-XXXXX-YY"
adSize:adSize];
adView.delegate = self;
[adView loadAd];
|
|
SDK 8
|
YMABannerAdSize *adSize = [YMABannerAdSize stickyWithContainerWidth:screenWidth];
YMABannerAdView *bannerAdView = [[YMABannerAdView alloc] initWithAdSize:adSize];
bannerAdView.delegate = self;
YMAAdRequest *request = [[YMAAdRequest alloc] initWithAdUnitID:@"R-M-XXXXX-YY"];
[bannerAdView loadAdWithRequest:request];
|
5. AdInfo 변경
- 광고 객체의
info, adAttributes, creativeID, campaignID 속성이 제거되었습니다.
adInfo를 사용하세요. adInfo의 일부 속성 이름도 변경되었습니다.
|
클래스
|
속성
|
상태
|
|
AdInfo
|
adUnitId
|
adUnitID(으)로 이름 변경
|
|
data
|
extraData(으)로 이름 변경
|
|
adSize
|
제거됨
|
|
partnerText
|
추가됨
|
|
BannerAdView,
NativeAd,
SliderAd,
AppOpenAd,
InterstitialAd,
RewardedAd
|
info
|
adInfo.extraData(으)로 대체됨
|
|
adAttributes
|
adInfo.creatives(으)로 대체됨
|
|
creativeID
|
adInfo.creatives[i].creativeID(으)로 대체됨
|
|
campaignID
|
adInfo.creatives[i].campaignID(으)로 대체됨
|
|
Creative
|
placeID
|
추가됨
|
|
offerID
|
추가됨
|
예제
|
SDK 7
|
let attributes = nativeAd.adAttributes
let info = nativeAd.info
let creativeID = interstitialAd.creativeID
let campaignID = interstitialAd.campaignID
let adUnitId = interstitialAd.adInfo.adUnitId
let size = bannerAdView.adInfo.adSize
|
|
SDK 8
|
let creatives = nativeAd.adInfo.creatives
let extraData = nativeAd.adInfo.extraData
if let creative = interstitialAd.adInfo.creatives.first {
let creativeID = creative.creativeID
let campaignID = creative.campaignID
let placeID = creative.placeID
let offerID = creative.offerID
}
let adUnitID = interstitialAd.adInfo.adUnitID
let partnerText = interstitialAd.adInfo.partnerText
|
|
SDK 7
|
NSArray *attributes = nativeAd.adAttributes;
NSDictionary *info = nativeAd.info;
NSString *creativeID = interstitialAd.creativeID;
NSString *campaignID = interstitialAd.campaignID;
NSString *adUnitId = interstitialAd.adInfo.adUnitId;
YMAAdSize *size = bannerAdView.adInfo.adSize;
|
|
SDK 8
|
NSArray<YMACreative *> *creatives = nativeAd.adInfo.creatives;
NSDictionary *extraData = nativeAd.adInfo.extraData;
YMACreative *creative = interstitialAd.adInfo.creatives.firstObject;
if (creative != nil) {
NSString *creativeID = creative.creativeID;
NSString *campaignID = creative.campaignID;
NSString *placeID = creative.placeID;
NSString *offerID = creative.offerID;
}
NSString *adUnitID = interstitialAd.adInfo.adUnitID;
NSString *partnerText = interstitialAd.adInfo.partnerText;
|
6. SDK 기본 클래스 변경
- 클래스
MobileAds의 이름이 YandexAds로 변경되었습니다.
- 개인정보 보호 관련 메서드와 속성은 이름이 갱신된 새 클래스로 옮겨졌습니다.
|
클래스
|
상태
|
|
MobileAds
|
YandexAds(으)로 이름 변경
|
|
MobileAds.sdkVersion
|
YandexAds.sdkVersion.stringValue(으)로 대체됨
|
|
MobileAds.setLocationTrackingEnabled(_:)
|
YandexAds.setLocationTracking(_:)(으)로 이름 변경
|
|
MobileAds.setAgeRestrictedUser(_:)
|
YandexAds.setAgeRestricted(_:)(으)로 이름 변경
|
|
MobileAds.setUserConsent(_:)
|
YandexAds.setUserConsent(_:)(으)로 이동
|
|
YMANativeAdView
|
NativeAdView(으)로 이름 변경
|
|
YMANativeMediaView
|
NativeMediaView(으)로 이름 변경
|
예제
|
SDK 7
|
import YandexMobileAds
MobileAds.setLocationTrackingEnabled(true)
MobileAds.setAgeRestrictedUser(false)
MobileAds.setUserConsent(true)
let version = MobileAds.sdkVersion
|
|
SDK 8
|
import YandexMobileAds
YandexAds.setLocationTracking(true)
YandexAds.setAgeRestricted(false)
YandexAds.setUserConsent(true)
let version = YandexAds.sdkVersion.stringValue
|
|
SDK 7
|
[YMAMobileAds setLocationTrackingEnabled:YES];
[YMAMobileAds setAgeRestrictedUser:NO];
[YMAMobileAds setUserConsent:YES];
NSString *version = YMAMobileAds.sdkVersion;
|
|
SDK 8
|
[YMAYandexAds setLocationTracking:YES];
[YMAYandexAds setAgeRestricted:NO];
[YMAYandexAds setUserConsent:YES];
NSString *version = YMAYandexAds.sdkVersion.stringValue;
|
7. 광고 객체 델리게이트 변경
AppOpenAdDelegate, InterstitialAdDelegate, RewardedAdDelegate, NativeAdDelegate, SliderAdDelegate의 메서드는 더 이상 선택 사항이 아니며, 모든 메서드를 구현해야 합니다.
표시 관련 메서드
|
클래스
|
메서드
|
상태
|
|
RewardedAdDelegate
|
rewardedAdDelegate(
_:didFailToShowWithError:)
|
다음으로 이름 변경
rewardedAdDelegate(
_:didFailToShow:)
|
|
InterstitialAdDelegate
|
interstitialAdDelegate(
_:didFailToShowWithError:)
|
다음으로 이름 변경
interstitialAdDelegate(
_:didFailToShow:)
|
|
AppOpenAdDelegate
|
appOpenAdDelegate(
_:didFailToShowWithError:)
|
다음으로 이름 변경
appOpenAdDelegate(
_:didFailToShow:)
|
노출 추적 메서드
|
클래스
|
메서드
|
상태
|
|
NativeAdDelegate
|
nativeAd(
_:didTrackImpressionWith:)
|
다음으로 이름 변경
nativeAd(
_:didTrackImpression:)
|
|
RewardedAdDelegate
|
rewardedAdDelegate(
_:didTrackImpressionWith:)
|
다음으로 이름 변경
rewardedAdDelegate(
_:didTrackImpression:)
|
|
InterstitialAdDelegate
|
interstitialAdDelegate(
_:didTrackImpressionWith:)
|
다음으로 이름 변경
interstitialAdDelegate(
_:didTrackImpression:)
|
|
AppOpenAdDelegate
|
appOpenAdDelegate(
_:didTrackImpressionWith:)
|
다음으로 이름 변경
appOpenAdDelegate(
_:didTrackImpression:)
|
|
SliderAdDelegate
|
sliderAdDelegate(
_:didTrackImpressionWith:)
|
다음으로 이름 변경
sliderAdDelegate(
_:didTrackImpression:)
|
제거된 델리게이트 메서드
|
델리게이트
|
메서드
|
상태
|
|
AdViewDelegate
|
close(_:)
|
제거됨
|
|
viewControllerForPresentingModalView()
|
|
adViewWillLeaveApplication
|
|
adView(_:willPresentScreen:)
|
|
adView(_:didDismissScreen:)
|
|
NativeAdDelegate
|
close(_:)
|
|
viewControllerForPresentingModalView()
|
|
nativeAdWillLeaveApplication
|
|
nativeAd(_:willPresentScreen:)
|
|
nativeAd(_:didDismissScreen:)
|
|
SliderAdDelegate
|
sliderAdDidClose(_:)
|
|
sliderAdWillLeaveApplication
|
|
sliderAd(_:willPresentScreen:)
|
|
sliderAd(_:didDismissScreen:)
|
8. 네이티브 광고: Warning 변경
NativeAdAssets의 warning 필드 타입이 String?에서 NativeAdWarning?로 변경되었습니다.
NativeAdWarning에 minimumRequiredArea 필드가 추가되어, warning 에셋의 광고 영역 중 최소로 요구되는 비율 정보를 담습니다.
|
클래스
|
필드
|
상태
|
|
NativeAdAssets
|
warning: String?
|
타입이 warning: NativeAdWarning?(으)로 변경됨
|
|
NativeAdWarning
|
value: String
|
추가됨
|
|
minimumRequiredArea: Double
|
추가됨
|
예제
|
SDK 7
|
let warningText: String? = nativeAd.adAssets.warning
label.text = warningText
|
|
SDK 8
|
let warning: NativeAdWarning? = nativeAd.adAssets.warning
label.text = warning?.value
|
|
SDK 7
|
NSString *warningText = nativeAd.adAssets.warning;
label.text = warningText;
|
|
SDK 8
|
YMANativeAdWarning *warning = nativeAd.adAssets.warning;
label.text = warning.value;
|
NativeAdMedia에 hasVideo 속성이 추가되었습니다.
|
클래스
|
속성
|
상태
|
|
NativeAdMedia
|
hasVideo: Bool
|
추가됨
|
예제
if let media = nativeAd.adAssets.media, media.hasVideo {
}
if (nativeAd.adAssets.media != nil && nativeAd.adAssets.media.hasVideo) {
}
10. NativeAd 및 SliderAd: loadImages 변경
loadImages() 메서드 이름이 loadImages(completionHandler:)로 변경되었습니다.
completionHandler 매개변수가 프로토콜 옵저버 NativeAdImageLoadingObserver를 대체합니다.
- 비동기 버전
loadImages()가 추가되었습니다.
|
클래스
|
상태
|
|
NativeAdImageLoadingObserver
|
제거됨
|
|
클래스
|
메서드
|
상태
|
|
NativeAd
|
loadImages() + NativeAdImageLoadingObserver
|
loadImages(completionHandler:) / loadImages() (async)(으)로 대체됨
|
|
SliderAd
|
loadImages() + NativeAdImageLoadingObserver
|
loadImages(completionHandler:) / loadImages() (async)(으)로 대체됨
|
적용 대상: NativeAd, SliderAd.
예제
|
SDK 7
|
nativeAd.addImageLoadingObserver(self)
nativeAd.loadImages()
sliderAd.addImageLoadingObserver(self)
sliderAd.loadImages()
|
|
SDK 8
|
nativeAd.loadImages { [weak self] in
}
await nativeAd.loadImages()
sliderAd.loadImages { [weak self] in
}
await sliderAd.loadImages()
|
|
SDK 7
|
[nativeAd addImageLoadingObserver:self];
[nativeAd loadImages];
[sliderAd addImageLoadingObserver:self];
[sliderAd loadImages];
|
|
SDK 8
|
[nativeAd loadImagesWithCompletionHandler:^{
}];
[sliderAd loadImagesWithCompletionHandler:^{
}];
|
11. VideoController 제거
videoController 속성과 관련 클래스 VideoController, VideoDelegate가 제거되었습니다.
|
속성
|
상태
|
|
AdView.videoController
|
제거됨
|
|
BannerAdView.videoController
|
|
VideoController
|
|
VideoDelegate
|
12. 네이티브 템플릿 제거
네이티브 템플릿이 완전히 제거되었으며, 관련 클래스는 더 이상 사용할 수 없습니다.
|
템플릿
|
상태
|
|
NativeTemplateAppearance
|
제거됨
|
|
MutableNativeTemplateAppearance
|
|
NativeTemplateHorizontalOffset
|
|
NativeBannerView
|
|
ButtonAppearance
|
|
MutableButtonAppearance
|
|
ImageAppearance
|
|
MutableImageAppearance
|
|
LabelAppearance
|
|
MutableLabelAppearance
|
|
RatingAppearance
|
|
MutableRatingAppearance
|
|
SizeConstraint
|
|
MutableSizeConstraint
|
|
SizeConstraintType
|
|
YMAHorizontalOffset
|
13. 제거된 상수 및 오류 타입
|
상수 및 오류 타입
|
상태
|
|
kYMAAdsErrorDomain
|
제거됨
|
|
kYMANativeAdErrorDomain
|
제거됨
|
|
kYMAGenderFemale, kYMAGenderMale
|
Gender 클래스로 대체됨
|
|
YMAVersion의 상수
|
YandexAds.sdkVersion.stringValue(으)로 대체됨
|
|
MobileAds.sdkVersion
|
YandexAds.sdkVersion.stringValue(으)로 대체됨
|
|
AdErrorCode
|
제거됨
|
|
NativeErrorCode
|
제거됨
|
|
Version.prereleaseIdentifiers
|
제거됨
|
|
Version.buildMetadataIdentifiers
|
제거됨
|
|
isYandexMobileAdsError (Error/NSError)
|
제거됨
|
|
isYandexMobileNativeAdsError (Error/NSError)
|
제거됨
|
14. Swift 6, MainActor 및 Sendable
- SDK는 Swift 6로 빌드됩니다.
- 일부 클래스와 프로토콜은 이제
MainActor로 격리되며, 한 프로토콜은 Sendable을 요구합니다.
MainActor로 격리된 클래스
|
클래스
|
|
AppOpenAd
|
|
InterstitialAd
|
|
RewardedAd
|
|
AudioSessionManager
|
|
NativeVideoPlaybackControls
|
MainActor로 격리된 프로토콜
|
프로토콜
|
|
AppOpenAdDelegate
|
|
InterstitialAdDelegate
|
|
RewardedAdDelegate
|
|
NativeAd
|
|
NativeAdDelegate
|
|
SliderAd
|
|
SliderAdDelegate
|
|
BannerAdViewDelegate
|
프로토콜 NativeAdImageLoadingObserver는 제거되었으며, 이미지 로딩은 completion handler 또는 async/await로 처리합니다.
15. 기타 변경
|
클래스
|
객체
|
상태
|
|
Rating
|
setRating(_:) / rating()
|
Rating.rating 속성으로 대체됨
|
|
NativeAd
|
bind(toSliderView:)
|
SliderAd.bind(with:)(으)로 이동
|
|
NativeVideoPlaybackProgressControl
|
reset
|
제거됨
|
|
MobileAds
|
audioSessionManager()
|
YandexAds.audioSessionManager 속성으로 대체됨
|
예제
|
SDK 7
|
rating.setRating(4.5)
let value = rating.rating()
let audioManager = MobileAds.audioSessionManager()
|
|
SDK 8
|
rating.rating = 4.5
let audioManager = YandexAds.audioSessionManager
|
|
SDK 7
|
[rating setRating:4.5];
CGFloat value = [rating rating];
YMAAudioSessionManager *audioManager = [YMAMobileAds audioSessionManager];
|
|
SDK 8
|
rating.rating = 4.5;
YMAAudioSessionManager *audioManager = YMAYandexAds.audioSessionManager;
|
미디에이션 네트워크 API 변경
1. 미디에이션 어댑터용 AdapterIdentity 변경
- 미디에이션 어댑터 식별을 위한
AdapterIdentity 메커니즘이 추가되었습니다.
mediationNetworkName 매개변수는 더 이상 사용되지 않습니다.
- 어댑터 식별은 SDK 초기화 전에 전역으로
YandexAds.setAdapterIdentity(_:)로 설정합니다.
|
클래스
|
매개변수
|
상태
|
|
BidderTokenLoader
|
BidderTokenLoader(mediationNetworkName:)
|
BidderTokenLoader()(으)로 대체됨
|
|
YandexAds
|
MobileAds.initialize()
|
YandexAds.setAdapterIdentity(_:) + YandexAds.initializeSDK()(으)로 대체됨
|
|
AdapterIdentity
|
AdapterIdentity(
adapterNetworkName:adapterVersion:adapterNetworkVersion:)
|
추가됨
|
예제
|
SDK 7
|
let tokenLoader = BidderTokenLoader(mediationNetworkName: "AdMob")
let config = BidderTokenRequestConfiguration(adType: .interstitial)
tokenLoader.loadBidderToken(requestConfiguration: config) { ... }
MobileAds.initialize()
|
|
SDK 8
|
let tokenLoader = BidderTokenLoader()
let request = BidderTokenRequest.interstitial()
tokenLoader.loadBidderToken(request: request) { ... }
let adapterIdentity = AdapterIdentity(
adapterNetworkName: "AdMob",
adapterVersion: "1.0.0",
adapterNetworkVersion: "23.5.0"
)
YandexAds.setAdapterIdentity(adapterIdentity)
YandexAds.initializeSDK()
|
|
SDK 7
|
YMABidderTokenLoader *tokenLoader =
[[YMABidderTokenLoader alloc] initWithMediationNetworkName:@"AdMob"];
YMABidderTokenRequestConfiguration *config =
[[YMABidderTokenRequestConfiguration alloc] initWithAdType:YMAAdTypeInterstitial];
[tokenLoader loadBidderTokenWithRequestConfiguration:config
completionHandler:^(NSString *token) { ... }];
[YMAMobileAds initialize];
|
|
SDK 8
|
YMABidderTokenLoader *tokenLoader = [[YMABidderTokenLoader alloc] init];
YMABidderTokenRequest *request = [YMABidderTokenRequest interstitial];
[tokenLoader loadBidderTokenWithRequest:request
completionHandler:^(NSString *token) { ... }];
YMAAdapterIdentity *identity =
[[YMAAdapterIdentity alloc] initWithAdapterNetworkName:@"AdMob"
adapterVersion:@"1.0.0"
adapterNetworkVersion:@"23.5.0"];
[YMAYandexAds setAdapterIdentity:identity];
[YMAYandexAds initializeSDK];
|
2. BidderTokenRequest 변경
- 클래스
BidderTokenRequestConfiguration의 이름이 BidderTokenRequest로 변경되었습니다.
- 이니셜라이저와 공개 속성(
targetInfo, bannerAdSize, parameters)은 팩토리 메서드의 매개변수로 옮겨졌습니다.
|
클래스
|
상태
|
|
BidderTokenRequestConfiguration
|
BidderTokenRequest(으)로 이름 변경
|
|
클래스
|
속성
|
상태
|
|
BidderTokenRequestConfiguration
|
init(adType: .banner) + .bannerAdSize
|
BidderTokenRequest.banner(
size:targeting:parameters:)
(으)로 대체됨
|
|
BidderTokenRequestConfiguration
|
init(adType: .interstitial) + .targetInfo
|
BidderTokenRequest.interstitial(
targeting:parameters:)
(으)로 대체됨
|
|
BidderTokenRequestConfiguration
|
init(adType: .rewarded) + .targetInfo
|
BidderTokenRequest.rewarded(
targeting:parameters:)
(으)로 대체됨
|
|
BidderTokenRequestConfiguration
|
init(adType: .native) + .targetInfo
|
BidderTokenRequest.native(
targeting:parameters:)
(으)로 대체됨
|
|
BidderTokenRequestConfiguration
|
init(adType: .appOpenAd) + .targetInfo
|
BidderTokenRequest.appOpenAd(
targeting:parameters:)
(으)로 대체됨
|
|
BidderTokenLoader
|
loadBidderToken(
requestConfiguration:completionHandler:)
|
loadBidderToken(
request:completionHandler:)
(으)로 이름 변경
|
적용 대상: BidderTokenLoader를 사용하는 미디에이션 어댑터.
예제
|
SDK 7
|
let config = BidderTokenRequestConfiguration(adType: .banner)
config.bannerAdSize = adSize
config.targetInfo = adTargetInfo
tokenLoader.loadBidderToken(requestConfiguration: config) { ... }
|
|
SDK 8
|
let targeting = AdTargeting()
let request = BidderTokenRequest.banner(
size: adSize,
targeting: targeting,
parameters: ["key": "value"]
)
tokenLoader.loadBidderToken(request: request) { ... }
let interstitialRequest = BidderTokenRequest.interstitial()
let rewardedRequest = BidderTokenRequest.rewarded()
let nativeRequest = BidderTokenRequest.native()
let appOpenRequest = BidderTokenRequest.appOpenAd()
|
|
SDK 7
|
YMABidderTokenRequestConfiguration *config =
[[YMABidderTokenRequestConfiguration alloc] initWithAdType:YMAAdTypeBanner];
config.bannerAdSize = adSize;
config.targetInfo = adTargetInfo;
[tokenLoader loadBidderTokenWithRequestConfiguration:config
completionHandler:^(NSString *token) { ... }];
|
|
SDK 8
|
YMAAdTargeting *targeting = [[YMAAdTargeting alloc] initWithAge:nil
gender:nil
location:nil
contextQuery:nil
contextTags:nil];
YMABidderTokenRequest *request = [YMABidderTokenRequest bannerWithSize:adSize
targeting:targeting
parameters:@{@"key": @"value"}];
[tokenLoader loadBidderTokenWithRequest:request
completionHandler:^(NSString *token) { ... }];
YMABidderTokenRequest *interstitialRequest = [YMABidderTokenRequest interstitial];
YMABidderTokenRequest *rewardedRequest = [YMABidderTokenRequest rewarded];
YMABidderTokenRequest *nativeRequest = [YMABidderTokenRequest native];
YMABidderTokenRequest *appOpenRequest = [YMABidderTokenRequest appOpenAd];
|
SwiftUI 연동
SwiftUI 연동이 지원됩니다. iOS 문서 메뉴 하단의 SwiftUI 섹션을 참고하세요.
AI 도구를 이용한 마이그레이션
SDK 7.x에서 8.x로 마이그레이션할 때는 미리 준비된 마이그레이션 스킬이 있는 AI 어시스턴트를 사용할 수 있습니다.
사용 방법
-
스킬 설치
마이그레이션 스킬은 GitHub Yandex Ads SDK iOS에서 받을 수 있습니다.
-
Claude Desktop용
스킬 폴더를 에이전트의 skills 디렉터리 등에 복사합니다.
cp -r Skills/migrate-yandex-ads-sdk-from-7-to-8 .claude/skills/
-
Cursor IDE용
스킬 폴더를 프로젝트에 복사한 뒤 SKILL.md를 @로 지정합니다. 예:
@migrate-yandex-ads-sdk-from-7-to-8/SKILL.md
-
다른 방법
SKILL.md와 관련 파일 내용을 AI 어시스턴트 대화에 붙여넣을 수 있습니다(메시지 길이 제한을 초과할 수 있음).
-
프롬프트 사용
스킬을 넣은 뒤 AI 어시스턴트 대화에서 아래 프롬프트를 사용하세요.
Yandex Mobile Ads SDK 7.x에서 8.x로 프로젝트를 마이그레이션해 줘
AI가 생성한 변경은 항상 꼼꼼히 검토하세요.
스킬은 AI가 작업을 올바르게 수행하도록 돕지만, 에이전트가 적용한 모든 변경은 직접 확인하고 검증해야 합니다. AI 어시스턴트는 오류를 낼 수 있으므로 코드의 수동 검토가 필요합니다.
SKAdNetwork
SKAdNetwork 식별자 목록이 갱신되었고, 목록 자동 업데이트 도구가 추가되었습니다. 적용 및 사용 방법은 SKAdNetwork 문서를 참고하세요.
요구 사항
- Xcode: 26.0 이상
- AppMetricaCore: 6.0.0 이상
- AppMetricaLibraryAdapter: 6.0.0 이상
- AppMetricaAdSupport: 6.0.0 이상
- AppMetricaIDSync: 6.0.0 이상