릴리스 업데이트를 받으려면 AppLovin-MAX-SDK-iOS GitHub 리포지토리를 구독하세요.
다운로드한 zip 파일에는 AppLovinSDK.xcframework 파일이 포함되어 있습니다.
애플리케이션에 SDK를 추가하려면 AppLovinSDK.xcframework 파일을 Xcode 프로젝트로 드래그하세요.
Xcode 프로젝트 타겟 설정의 Frameworks, Libraries, and Embedded Content 섹션에 AppLovinSDK.xcframework를 포함하세요.
AppLovin SDK를 컴파일하려면 -ObjC 플래그를 추가해야 합니다.
-ObjC 플래그를 활성화하려면 File > Project Settings를 선택하고 Build Settings로 이동하여 Other Linker Flags를 검색한 다음 **+**를 클릭하여 -ObjC를 추가합니다.
프로젝트에 다음 프레임워크를 링크하세요.
MAX Ad Review 서비스를 활성화하려면 AppLovinQualityServiceSetup-ios.rb를 다운로드하여 프로젝트 폴더로 이동하세요.
터미널 창을 열고 프로젝트 디렉토리로 cd한 후 다음을 실행합니다.
ruby AppLovinQualityServiceSetup-ios.rb
File > Project Settings > Info를 선택합니다.
Custom iOS Properties의 행 중 하나를 클릭하고 **+**를 클릭하여 새 행을 추가합니다.
새 행의 키를 AppLovinSdkKey로 설정하고 값을 SDK 키로 설정합니다.
SDK 키는 AppLovin 대시보드의 Account > General > Keys 섹션에서 확인할 수 있습니다.
SDK를 초기화하기 전에 앱 델리게이트의 application:applicationDidFinishLaunching: 메서드에서 SDK에 대한 초기화 구성 객체를 생성합니다.
이 구성 객체를 사용하면 SDK가 초기화될 때 사용할 속성을 구성할 수 있습니다.
이러한 초기화 속성은 앱의 수명 동안 변경될 수 있는 가변 속성을 포함하는 ALSdkSettings를 제외하고는 불변(immutable)입니다.
// Create the initialization configuration
ALSdkInitializationConfiguration *initConfig = [ALSdkInitializationConfiguration configurationWithSdkKey: @"«SDK-key»" builderBlock:^(ALSdkInitializationConfigurationBuilder *builder) {
builder.mediationProvider = ALMediationProviderMAX;
// Perform any additional configuration/setting changes
}];
// Create the initialization configuration
let initConfig = ALSdkInitializationConfiguration(sdkKey: "«SDK-key»") { builder in
builder.mediationProvider = ALMediationProviderMAX
// Perform any additional configuration/setting changes
}
SDK 키는 AppLovin 대시보드의 Account > General > Keys 섹션에서 확인할 수 있습니다.
초기화 구성 객체를 사용하여 AppLovin SDK를 초기화합니다. 시작할 때 이 작업을 수행하세요. 이렇게 하면 SDK가 mediation 네트워크 광고를 캐싱하는 데 걸리는 시간이 극대화되어 더 나은 사용자 경험을 제공할 수 있습니다.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Create the initialization configuration
ALSdkInitializationConfiguration *initConfig = [ALSdkInitializationConfiguration configurationWithSdkKey: @"«SDK-key»" builderBlock:^(ALSdkInitializationConfigurationBuilder *builder) {
builder.mediationProvider = ALMediationProviderMAX;
}];
// Initialize the SDK with the configuration
[[ALSdk shared] initializeWithConfiguration: initConfig completionHandler:^(ALSdkConfiguration *sdkConfig) {
// Start loading ads
}];
⋮
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
{
let initConfig = ALSdkInitializationConfiguration(sdkKey: "«SDK-key»") { builder in
builder.mediationProvider = ALMediationProviderMAX
}
// Initialize the SDK with the configuration
ALSdk.shared().initialize(with: initConfig) { sdkConfig in
// Start loading ads
}
⋮
다음은 연동 예시입니다:
// Create the initialization configuration
ALSdkInitializationConfiguration *initConfig = [ALSdkInitializationConfiguration configurationWithSdkKey: @"«SDK-key»" builderBlock:^(ALSdkInitializationConfigurationBuilder *builder) {
builder.mediationProvider = ALMediationProviderMAX;
builder.segmentCollection = [MASegmentCollection segmentCollectionWithBuilderBlock:^(MASegmentCollectionBuilder *builder) {
[builder addSegment: [[MASegment alloc] initWithKey: @(849) values: @[@(1), @(3)]]];
}];
}];
// Configure the SDK settings if needed before or after SDK initialization.
ALSdkSettings *settings = [ALSdk shared].settings;
settings.userIdentifier = @"«user-ID»";
[settings setExtraParameterForKey: @"uid2_token" value: @"«token-value»"];
// Note: you may also set these values in your Info.plist
settings.termsAndPrivacyPolicyFlowSettings.enabled = YES;
settings.termsAndPrivacyPolicyFlowSettings.termsOfServiceURL = [NSURL URLWithString: @"«https://your-company-name.com/terms-of-service»"];
settings.termsAndPrivacyPolicyFlowSettings.privacyPolicyURL = [NSURL URLWithString: @"«https://your-company-name.com/privacy-policy»"];
// Initialize the SDK with the configuration
[[ALSdk shared] initializeWithConfiguration: initConfig completionHandler:^(ALSdkConfiguration *sdkConfig) {
// Start loading ads
}];
// Create the initialization configuration
let initConfig = ALSdkInitializationConfiguration(sdkKey: "«SDK-key»") { builder in
builder.mediationProvider = ALMediationProviderMAX
builder.segmentCollection = MASegmentCollection { segmentCollectionBuilder in
segmentCollectionBuilder.add(MASegment(key: 849, values: [1, 3]))
}
}
// Configure the SDK settings if needed before or after SDK initialization.
let settings = ALSdk.shared().settings
settings.userIdentifier = "«user-ID»"
settings.setExtraParameterForKey("uid2_token", value: "«token-value»")
// Note: you may also set these values in your Info.plist
settings.termsAndPrivacyPolicyFlowSettings.isEnabled = true
settings.termsAndPrivacyPolicyFlowSettings.termsOfServiceURL = URL(string: "«https://your-company-name.com/terms-of-service»")
settings.termsAndPrivacyPolicyFlowSettings.privacyPolicyURL = URL(string: "«https://your-company-name.com/privacy-policy»")
// Initialize the SDK with the configuration
ALSdk.shared().initialize(with: initConfig) { sdkConfig in
// Start loading ads
}
연동 방법은 SKAdNetwork 문서를 참조하세요.
interstitial 광고를 로드하려면 ad unit으로 MAInterstitialAd 객체를 인스턴스화하고 loadAd()를 호출합니다.
광고가 준비되었을 때와 기타 광고 이벤트를 알림받을 수 있도록 MAAdDelegate를 구현하세요.
#import "ExampleViewController.h"
#import <AppLovinSDK/AppLovinSDK.h>
@interface ExampleViewController()<MAAdDelegate>
@property (nonatomic, strong) MAInterstitialAd *interstitialAd;
@property (nonatomic, assign) NSInteger retryAttempt;
@end
@implementation ExampleViewController
- (void)createInterstitialAd
{
self.interstitialAd = [[MAInterstitialAd alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»"];
self.interstitialAd.delegate = self;
// Load the first ad
[self.interstitialAd loadAd];
}
#pragma mark - MAAdDelegate Protocol
- (void)didLoadAd:(MAAd *)ad
{
// Interstitial ad is ready to be shown. '[self.interstitialAd isReady]' will now return 'YES'
// Reset retry attempt
self.retryAttempt = 0;
}
- (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withError:(MAError *)error
{
// Interstitial ad failed to load
// AppLovin recommends that you retry with exponentially higher delays up to a maximum delay (in this case 64 seconds)
self.retryAttempt++;
NSInteger delaySec = pow(2, MIN(6, self.retryAttempt));
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delaySec * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[self.interstitialAd loadAd];
});
}
- (void)didDisplayAd:(MAAd *)ad {}
- (void)didClickAd:(MAAd *)ad {}
- (void)didHideAd:(MAAd *)ad
{
// Interstitial ad is hidden. Pre-load the next ad
[self.interstitialAd loadAd];
}
- (void)didFailToDisplayAd:(MAAd *)ad withError:(MAError *)error
{
// Interstitial ad failed to display. AppLovin recommends that you load the next ad
[self.interstitialAd loadAd];
}
@end
class ExampleViewController: UIViewController, MAAdDelegate
{
var interstitialAd: MAInterstitialAd!
var retryAttempt = 0.0
func createInterstitialAd()
{
interstitialAd = MAInterstitialAd(adUnitIdentifier: "«ad-unit-ID»")
interstitialAd.delegate = self
// Load the first ad
interstitialAd.load()
}
// MARK: MAAdDelegate Protocol
func didLoad(_ ad: MAAd)
{
// Interstitial ad is ready to be shown. 'interstitialAd.isReady' will now return 'true'
// Reset retry attempt
retryAttempt = 0
}
func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError)
{
// Interstitial ad failed to load
// AppLovin recommends that you retry with exponentially higher delays up to a maximum delay (in this case 64 seconds)
retryAttempt += 1
let delaySec = pow(2.0, min(6.0, retryAttempt))
DispatchQueue.main.asyncAfter(deadline: .now() + delaySec) {
self.interstitialAd.load()
}
}
func didDisplay(_ ad: MAAd) {}
func didClick(_ ad: MAAd) {}
func didHide(_ ad: MAAd)
{
// Interstitial ad is hidden. Pre-load the next ad
interstitialAd.load()
}
func didFail(toDisplay ad: MAAd, withError error: MAError)
{
// Interstitial ad failed to display. AppLovin recommends that you load the next ad
interstitialAd.load()
}
}
interstitial 광고를 게재하려면 위에서 생성한 MAInterstitialAd 객체에서 showAd()를 호출합니다.
if ( [self.interstitialAd isReady] )
{
[self.interstitialAd showAd];
}
if interstitialAd.isReady
{
interstitialAd.show()
}
rewarded 광고를 로드하려면 rewarded ad unit으로 MARewardedAd 객체를 가져와 loadAd()를 호출합니다.
광고가 준비되었을 때와 기타 광고 이벤트를 알림받을 수 있도록 MARewardedAdDelegate를 구현하세요.
#import "ExampleViewController.h"
#import <AppLovinSDK/AppLovinSDK.h>
@interface ExampleViewController()<MARewardedAdDelegate>
@property (nonatomic, strong) MARewardedAd *rewardedAd;
@property (nonatomic, assign) NSInteger retryAttempt;
@end
@implementation ExampleViewController
- (void)createRewardedAd
{
self.rewardedAd = [MARewardedAd sharedWithAdUnitIdentifier: @"«ad-unit-ID»"];
self.rewardedAd.delegate = self;
// Load the first ad
[self.rewardedAd loadAd];
}
#pragma mark - MAAdDelegate Protocol
- (void)didLoadAd:(MAAd *)ad
{
// Rewarded ad is ready to be shown. '[self.rewardedAd isReady]' will now return 'YES'
// Reset retry attempt
self.retryAttempt = 0;
}
- (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withError:(MAError *)error
{
// Rewarded ad failed to load
// AppLovin recommends that you retry with exponentially higher delays up to a maximum delay (in this case 64 seconds)
self.retryAttempt++;
NSInteger delaySec = pow(2, MIN(6, self.retryAttempt));
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delaySec * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[self.rewardedAd loadAd];
});
}
- (void)didDisplayAd:(MAAd *)ad {}
- (void)didClickAd:(MAAd *)ad {}
- (void)didHideAd:(MAAd *)ad
{
// Rewarded ad is hidden. Pre-load the next ad
[self.rewardedAd loadAd];
}
- (void)didFailToDisplayAd:(MAAd *)ad withError:(MAError *)error
{
// Rewarded ad failed to display. AppLovin recommends that you load the next ad
[self.rewardedAd loadAd];
}
#pragma mark - MARewardedAdDelegate Protocol
- (void)didRewardUserForAd:(MAAd *)ad withReward:(MAReward *)reward
{
// Rewarded ad was displayed and user should receive the reward
}
@end
class ExampleViewController : UIViewController, MARewardedAdDelegate
{
var rewardedAd: MARewardedAd!
var retryAttempt = 0.0
func createRewardedAd()
{
rewardedAd = MARewardedAd.shared(withAdUnitIdentifier: "«ad-unit-ID»")
rewardedAd.delegate = self
// Load the first ad
rewardedAd.load()
}
// MARK: MAAdDelegate Protocol
func didLoad(_ ad: MAAd)
{
// Rewarded ad is ready to be shown. '[self.rewardedAd isReady]' will now return 'YES'
// Reset retry attempt
retryAttempt = 0
}
func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError)
{
// Rewarded ad failed to load
// AppLovin recommends that you retry with exponentially higher delays up to a maximum delay (in this case 64 seconds)
retryAttempt += 1
let delaySec = pow(2.0, min(6.0, retryAttempt))
DispatchQueue.main.asyncAfter(deadline: .now() + delaySec) {
self.rewardedAd.load()
}
}
func didDisplay(_ ad: MAAd) {}
func didClick(_ ad: MAAd) {}
func didHide(_ ad: MAAd)
{
// Rewarded ad is hidden. Pre-load the next ad
rewardedAd.load()
}
func didFail(toDisplay ad: MAAd, withError error: MAError)
{
// Rewarded ad failed to display. AppLovin recommends that you load the next ad
rewardedAd.load()
}
// MARK: MARewardedAdDelegate Protocol
func didRewardUser(for ad: MAAd, with reward: MAReward)
{
// Rewarded ad was displayed and user should receive the reward
}
}
rewarded 광고를 게재하려면 위에서 생성한 MARewardedAd 객체에서 showAd()를 호출합니다.
if ( [self.rewardedAd isReady] )
{
[self.rewardedAd showAd];
}
if rewardedAd.isReady
{
rewardedAd.show()
}
광고를 로드하려면 ad unit으로 MAAdView 객체를 생성하고 loadAd()를 호출합니다.
광고를 게재하려면 MAAdView 객체를 뷰 계층 구조의 서브뷰로 추가합니다.
광고가 준비되었을 때와 기타 광고 이벤트를 알림받을 수 있도록 MAAdViewAdDelegate를 구현하세요.
#import "ExampleViewController.h"
#import <AppLovinSDK/AppLovinSDK.h>
@interface ExampleViewController()<MAAdViewAdDelegate>
@property (nonatomic, strong) MAAdView *adView;
@end
@implementation ExampleViewController
- (void)createBannerAd
{
self.adView = [[MAAdView alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»"];
self.adView.delegate = self;
// Banner height on iPhone and iPad is 50 and 90, respectively
CGFloat height = (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) ? 90 : 50;
// Stretch to the width of the screen for banners to be fully functional
CGFloat width = CGRectGetWidth(UIScreen.mainScreen.bounds);
self.adView.frame = CGRectMake(x, y, width, height);
// Set background or background color for banner ads to be fully functional
self.adView.backgroundColor = BACKGROUND_COLOR;
[self.view addSubview: self.adView];
// Load the ad
[self.adView loadAd];
}
#pragma mark - MAAdDelegate Protocol
- (void)didLoadAd:(MAAd *)ad {}
- (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withError:(MAError *)error {}
- (void)didClickAd:(MAAd *)ad {}
- (void)didFailToDisplayAd:(MAAd *)ad withError:(MAError *)error {}
#pragma mark - MAAdViewAdDelegate Protocol
- (void)didExpandAd:(MAAd *)ad {}
- (void)didCollapseAd:(MAAd *)ad {}
#pragma mark - Deprecated Callbacks
- (void)didDisplayAd:(MAAd *)ad { /* use this for impression tracking */ }
- (void)didHideAd:(MAAd *)ad { /* DO NOT USE - THIS IS RESERVED FOR FULLSCREEN ADS ONLY AND WILL BE REMOVED IN A FUTURE SDK RELEASE */ }
@end
class ExampleViewController: UIViewController, MAAdViewAdDelegate
{
var adView: MAAdView!
func createBannerAd()
{
adView = MAAdView(adUnitIdentifier: "«ad-unit-ID»")
adView.delegate = self
// Banner height on iPhone and iPad is 50 and 90, respectively
let height: CGFloat = (UIDevice.current.userInterfaceIdiom == .pad) ? 90 : 50
// Stretch to the width of the screen for banners to be fully functional
let width: CGFloat = UIScreen.main.bounds.width
adView.frame = CGRect(x: x, y: y, width: width, height: height)
// Set background or background color for banner ads to be fully functional
adView.backgroundColor = BACKGROUND_COLOR
view.addSubview(adView)
// Load the first ad
adView.loadAd()
}
// MARK: MAAdDelegate Protocol
func didLoad(_ ad: MAAd) {}
func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError) {}
func didClick(_ ad: MAAd) {}
func didFail(toDisplay ad: MAAd, withError error: MAError) {}
// MARK: MAAdViewAdDelegate Protocol
func didExpand(_ ad: MAAd) {}
func didCollapse(_ ad: MAAd) {}
// MARK: Deprecated Callbacks
func didDisplay(_ ad: MAAd) { /* use this for impression tracking */ }
func didHide(_ ad: MAAd) { /* DO NOT USE - THIS IS RESERVED FOR FULLSCREEN ADS ONLY AND WILL BE REMOVED IN A FUTURE SDK RELEASE */ }
}
#import "ExampleViewController.h"
#import <AppLovinSDK/AppLovinSDK.h>
@interface ExampleViewController()<MAAdViewAdDelegate>
@property (nonatomic, strong) MAAdView *adView;
@end
@implementation ExampleViewController
- (void)createMRECAd
{
self.adView = [[MAAdView alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»" adlanguage: MAAdFormat.mrec];
self.adView.delegate = self;
// MREC width and height are 300 and 250 respectively, on iPhone and iPad
CGFloat width = 300;
CGFloat height = 250;
// Center the MREC
CGFloat x = self.view.center.x - 150;
self.adView.frame = CGRectMake(x, y, width, height);
// Set background or background color for MREC ads to be fully functional
self.adView.backgroundColor = BACKGROUND_COLOR;
[self.view addSubview: self.adView];
// Load the ad
[self.adView loadAd];
}
#pragma mark - MAAdDelegate Protocol
- (void)didLoadAd:(MAAd *)ad {}
- (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withError:(MAError *)error {}
- (void)didClickAd:(MAAd *)ad {}
- (void)didFailToDisplayAd:(MAAd *)ad withError:(MAError *)error {}
#pragma mark - MAAdViewAdDelegate Protocol
- (void)didExpandAd:(MAAd *)ad {}
- (void)didCollapseAd:(MAAd *)ad {}
#pragma mark - Deprecated Callbacks
- (void)didDisplayAd:(MAAd *)ad { /* use this for impression tracking */ }
- (void)didHideAd:(MAAd *)ad { /* DO NOT USE - THIS IS RESERVED FOR FULLSCREEN ADS ONLY AND WILL BE REMOVED IN A FUTURE SDK RELEASE */ }
@end
class ExampleViewController: UIViewController, MAAdViewAdDelegate
{
var adView: MAAdView!
func createMRECAd
{
adView = MAAdView(adUnitIdentifier: "«ad-unit-ID»", adlanguage: MAAdFormat.mrec)
adView.delegate = self
// MREC width and height are 300 and 250 respectively, on iPhone and iPad
let height: CGFloat = 250
let width: CGFloat = 300
adView.frame = CGRect(x: x, y: y, width: width, height: height)
// Center the MREC
adView.center.x = view.center.x
// Set background or background color for MREC ads to be fully functional
adView.backgroundColor = BACKGROUND_COLOR
view.addSubview(adView)
// Load the first ad
adView.loadAd()
}
// MARK: MAAdDelegate Protocol
func didLoad(_ ad: MAAd) {}
func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError) {}
func didClick(_ ad: MAAd) {}
func didFail(toDisplay ad: MAAd, withError error: MAError) {}
// MARK: MAAdViewAdDelegate Protocol
func didExpand(_ ad: MAAd) {}
func didCollapse(_ ad: MAAd) {}
// MARK: Deprecated Callbacks
func didDisplay(_ ad: MAAd) { /* use this for impression tracking */ }
func didHide(_ ad: MAAd) { /* DO NOT USE - THIS IS RESERVED FOR FULLSCREEN ADS ONLY AND WILL BE REMOVED IN A FUTURE SDK RELEASE */ }
}
banner 또는 MREC를 숨기려면 다음을 호출합니다.
adView.hidden = YES;
[adView stopAutoRefresh];
adView.isHidden = true
adView.stopAutoRefresh()
banner 또는 MREC를 표시하려면 다음을 호출합니다.
adView.hidden = NO;
[adView startAutoRefresh];
adView.isHidden = false
adView.startAutoRefresh()
연동할 광고 네트워크를 선택하세요. 그런 다음 아래의 특정 지침을 따르십시오.
Pangle iOS 어댑터 버전 4.9.1.0.0부터 중국 본토에서는 Pangle을 더 이상 사용할 수 없습니다. 중국 본토 트래픽을 수익화하려면 CSJ 네트워크를 구성하고 CSJ 어댑터를 추가하세요. 중국 본토를 제외한 글로벌 트래픽의 경우, 계속해서 Pangle을 사용하여 수익화할 수 있습니다.
12.2 미만의 iOS 버전에서 Swift를 지원하려면:

window 속성App Delegate 파일의 window 속성을 제거하지 마십시오.
제거할 경우 InMobi SDK가 크래시될 수 있습니다.
@property (nonatomic, strong) UIWindow *window;
var window: UIWindow?
Limited Data Use (LDU) 모드를 활성화하지 않으려면 SetDataProcessingOptions()에 빈 배열을 전달합니다:
#import <FBAudienceNetwork/FBAudienceNetwork.h>
⋮
[FBAdSettings setDataProcessingOptions: @[]];
⋮
// Initialize MAX SDK
import FBAudienceNetwork
⋮
FBAdSettings.setDataProcessingOptions([])
⋮
// Initialize MAX SDK
사용자에 대해 LDU를 활성화하고 사용자 지역을 지정하려면 다음과 같이 SetDataProcessingOptions()를 호출합니다:
#import <FBAudienceNetwork/FBAudienceNetwork.h>
⋮
[FBAdSettings setDataProcessingOptions: @[@"LDU"] country: «country» state: «state»];
⋮
// Initialize MAX SDK
import FBAudienceNetwork
⋮
FBAdSettings.setDataProcessingOptions(["LDU"], country: «country», state: «state»)
⋮
// Initialize MAX SDK
Google UMP를 CMP로 사용하는 경우, 사용자가 Meta에 동의했는지 여부를 확인할 수 있습니다. 그렇게 하려면 다음과 같은 코드를 사용하십시오:
NSNumber *hasMetaConsent = [ALPrivacySettings additionalConsentStatusForIdentifier: 89];
if ( hasMetaConsent )
{
BOOL consentGiven = hasMetaConsent.boolValue;
// Set Meta Data Processing Options accordingly.
}
else
{
// AC String is not available on disk. Please check for consent status after the user completes the CMP flow.
}
let hasMetaConsent = ALPrivacySetting.additionalConsentStatus(forIdentifier: 89)
if let consentGiven = hasMetaConsent?.boolValue
{
// Set Meta Data Processing Options accordingly.
}
else
{
// AC String is not available on disk. Please check for consent status after the user completes the CMP flow.
}
캘리포니아에서 Meta Audience Network의 "Limited Data Use" 플래그를 구현하는 방법을 알아보려면 Meta for Developers 문서를 읽어보세요.
Audience Network SDK 6.2.1에는 다음과 같은 중요한 요구 사항이 도입되었습니다.
setAdvertiserTrackingEnabled 플래그를 구현합니다.
이는 Meta에 데이터를 사용하여 개인 맞춤형 광고를 제공할 수 있는지 여부를 알려줍니다.Info.plist에 추가합니다.
연동 방법은 SKAdNetwork 문서를 참조하세요.[sdk initializeSdkWithCompletionHandler:^(ALSdkConfiguration *sdkConfiguration)
{
if ( @available(iOS 14.5, *) )
{
// Note that App transparency tracking authorization can be checked via `sdkConfiguration.appTrackingTransparencyStatus`
// 1. Set Meta ATE flag here, THEN
}
// 2. Load ads
}];
sdk.initializeSdk { (sdkConfiguration: ALSdkConfiguration) in
if #available(iOS 14.5, *)
{
// Note that App transparency tracking authorization can be checked via `sdkConfiguration.appTrackingTransparencyStatus`
// 1. Set Meta ATE flag here, THEN
}
// 2. Load ads
}
Google AdSense, AdManager 또는 AdMob을 사용하는 개발자 및 퍼블리셔는 Google이 인증한 동의 관리 플랫폼(CMP)을 사용해야 합니다. 유럽 경제 지역(EEA) 또는 영국의 사용자에게 광고를 게재할 때는 CMP가 IAB의 Transparency and Consent Framework와 연동되어야 합니다. 자세한 내용은 개인정보 보호: “TCF v2 동의”를 참조하세요.
앱의 Info.plist에 GADApplicationIdentifier 키를 추가합니다.
이 키에 Google bidding 및 Google AdMob / Google Ad Manager 앱 ID의 String 값을 지정합니다.

Amazon Publisher Services SDK는 MAX SDK 외부에서 초기화해야 합니다.
[[DTBAds sharedInstance] setAppKey: appId];
[DTBAds sharedInstance].mraidCustomVersions = @[@"1.0", @"2.0", @"3.0"];
[DTBAds sharedInstance].mraidPolicy = CUSTOM_MRAID;
보고 불일치를 방지하려면 최신 Amazon Publisher Services 어댑터 버전을 사용하십시오.
Amazon 광고를 MAX에 연동하려면 먼저 Amazon 광고를 로드해야 합니다.
MAX 광고를 로드하기 전에 DTBAdResponse 또는 DTBAdErrorInfo를 MAAdView 인스턴스에 전달합니다.
-[MAAdView setLocalExtraParameterForKey:value:]를 호출하여 이 작업을 수행할 수 있습니다.
자동 새로고침되는 banner 광고의 경우 광고를 한 번만 로드하면 됩니다.
@interface ExampleViewController ()<DTBAdCallback>
⋮
@end
@implementation ExampleViewController
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *amazonAdSlotId;
MAAdFormat *adFormat;
if ( UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad )
{
amazonAdSlotId = @"«Amazon-leader-slot-ID»";
adFormat = MAAdFormat.leader;
}
else
{
amazonAdSlotId = @"«Amazon-banner-slot-ID»";
adFormat = MAAdFormat.banner;
}
CGSize rawSize = adFormat.size;
DTBAdSize *size = [[DTBAdSize alloc] initBannerAdSizeWithWidth: rawSize.width
height: rawSize.height
andSlotUUID: amazonAdSlotId];
DTBAdNetworkInfo *adNetworkInfo = [[DTBAdNetworkInfo alloc] initWithNetworkName: DTBADNETWORK_MAX];
DTBAdLoader *adLoader = [[DTBAdLoader alloc] initWithAdNetworkInfo: adNetworkInfo];
[adLoader setAdSizes: @[size]];
[adLoader loadAd: self];
}
- (void)onSuccess:(DTBAdResponse *)adResponse
{
// 'adView' is your instance of MAAdView
[self.adView setLocalExtraParameterForKey: @"amazon_ad_response" value: adResponse];
[self.adView loadAd];
}
- (void)onFailure:(DTBAdError)error dtbAdErrorInfo:(DTBAdErrorInfo *)errorInfo
{
// 'adView' is your instance of MAAdView
[self.adView setLocalExtraParameterForKey: @"amazon_ad_error" value: errorInfo];
[self.adView loadAd];
}
@end
import AppLovinSDK
import DTBiOSSDK
class ExampleViewController: UIViewController
{
override func viewDidLoad()
{
super.viewDidLoad()
let amazonAdSlotId: String
let adFormat: MAAdFormat
if UIDevice.current.userInterfaceIdiom == .pad
{
amazonAdSlotId = "«Amazon-leader-slot-ID»"
adFormat = MAAdFormat.leader
}
else
{
amazonAdSlotId = "«Amazon-banner-slot-ID»"
adFormat = MAAdFormat.banner
}
let rawSize = adFormat.size
let size = DTBAdSize(bannerAdSizeWithWidth: Int(rawSize.width),
height: Int(rawSize.height),
andSlotUUID: amazonAdSlotId)!
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
adLoader.setAdSizes([size])
adLoader.loadAd(self)
}
}
extension ExampleViewController: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
adView.loadAd()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_error", value:dtbAdErrorInfo)
adView.loadAd()
}
}
import AppLovinSDK
import DTBiOSSDK
struct ExampleSwiftUIWrapper: UIViewRepresentable
{
func makeUIView(context: Context) -> MAAdView
{
let adView = MAAdView(adUnitIdentifier: "«ad-unit-ID»")
adView.delegate = context.coordinator
let amazonAdSlotId: String
let adFormat: MAAdFormat
if UIDevice.current.userInterfaceIdiom == .pad
{
amazonAdSlotId = "«Amazon-leader-slot-ID»"
adFormat = MAAdFormat.leader
}
else
{
amazonAdSlotId = "«Amazon-banner-slot-ID»"
adFormat = MAAdFormat.banner
}
let rawSize = adFormat.size
let size = DTBAdSize(bannerAdSizeWithWidth: Int(rawSize.width),
height: Int(rawSize.height),
andSlotUUID: amazonAdSlotId)!
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
adLoader.setAdSizes([size])
adLoader.loadAd(adView)
return adView
}
}
extension ExampleSwiftUIWrapper
{
class Coordinator: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
adView.loadAd()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_error", value: dtbAdErrorInfo)
adView.loadAd()
}
}
}
@interface ExampleViewController ()<DTBAdCallback>
⋮
@end
@implementation ExampleViewController
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *amazonAdSlotId = @"«Amazon-MREC-slot-ID»";
DTBAdNetworkInfo *adNetworkInfo = [[DTBAdNetworkInfo alloc] initWithNetworkName: DTBADNETWORK_MAX];
DTBAdLoader *adLoader = [[DTBAdLoader alloc] initWithAdNetworkInfo: adNetworkInfo];
[adLoader setAdSizes: [[DTBAdSize alloc] initBannerAdSizeWithWidth: 300
height: 250
andSlotUUID: amazonAdSlotId]];
[adLoader loadAd: self];
}
- (void)onSuccess:(DTBAdResponse *)adResponse
{
// 'adView' is your instance of MAAdView
[self.adView setLocalExtraParameterForKey: @"amazon_ad_response" value: adResponse];
[self.adView loadAd];
}
- (void)onFailure:(DTBAdError)error dtbAdErrorInfo:(DTBAdErrorInfo *)errorInfo
{
// 'adView' is your instance of MAAdView
[self.adView setLocalExtraParameterForKey: @"amazon_ad_error" value: errorInfo];
[self.adView loadAd];
}
@end
import AppLovinSDK
import DTBiOSSDK
class ExampleViewController: UIViewController
{
override func viewDidLoad()
{
super.viewDidLoad()
let amazonAdSlotId: String = "«Amazon-MREC-slot-ID»"
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
adLoader.setAdSizes([DTBAdSize(bannerAdSizeWithWidth: 300,
height: 250,
andSlotUUID: amazonAdSlotId)!])
adLoader.loadAd(self)
}
}
extension ExampleViewController: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
adView.loadAd()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_error", value:dtbAdErrorInfo)
adView.loadAd()
}
}
import AppLovinSDK
import DTBiOSSDK
struct ExampleSwiftUIWrapper: UIViewRepresentable
{
func makeUIView(context: Context) -> MAAdView
{
let adView = MAAdView(adUnitIdentifier: "«ad-unit-ID»", adFormat: MAAdFormat.mrec)
adView.delegate = context.coordinator
let amazonAdSlotId: String = "«Amazon-MREC-slot-ID»"
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
adLoader.setAdSizes([DTBAdSize(bannerAdSizeWithWidth: 300,
height: 250,
andSlotUUID: amazonAdSlotId)!])
adLoader.loadAd(adView)
return adView
}
}
extension ExampleSwiftUIWrapper
{
class Coordinator: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
adView.loadAd()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'adView' is your instance of MAAdView
adView.setLocalExtraParameterForKey("amazon_ad_error", value: dtbAdErrorInfo)
adView.loadAd()
}
}
}
Amazon interstitial 광고를 MAX에 연동하려면 먼저 Amazon 광고를 로드해야 합니다.
MAX 광고를 로드하기 전에 DTBAdResponse 또는 DTBAdErrorInfo를 MAInterstitialAd 인스턴스에 전달합니다.
-[MAInterstitialAd setLocalExtraParameterForKey:value:]를 호출하여 이 작업을 수행할 수 있습니다.
세션당 한 번만 Amazon DTBAdResponse 또는 DTBAdErrorInfo를 로드하여 MAInterstitialAd 인스턴스에 전달해야 합니다.
#import <AppLovinSDK/AppLovinSDK.h>
#import <DTBiOSSDK/DTBiOSSDK.h>
@interface ExampleViewController ()<DTBAdCallback>
⋮
@end
@implementation ExampleViewController
static MAInterstitialAd *interstitialAd;
static BOOL isFirstLoad;
+ (void)initialize
{
[super initialize];
interstitialAd = [[MAInterstitialAd alloc] initWithAdUnitIdentifier: @"«MAX-inter-ad-unit-ID»"];
isFirstLoad = YES;
}
- (void)loadAd
{
// If first load - load ad from Amazon's SDK, then load ad for MAX
if ( isFirstLoad )
{
isFirstLoad = NO;
DTBAdNetworkInfo *adNetworkInfo = [[DTBAdNetworkInfo alloc] initWithNetworkName: DTBADNETWORK_MAX];
DTBAdLoader *adLoader = [[DTBAdLoader alloc] initWithAdNetworkInfo: adNetworkInfo];
[adLoader setAdSizes: @[
[[DTBAdSize alloc] initInterstitialAdSizeWithSlotUUID: @"«Amazon-inter-slot-ID»"]
]];
[adLoader loadAd: self];
}
else
{
[interstitialAd loadAd];
}
}
- (void)onSuccess:(DTBAdResponse *)adResponse
{
// 'interstitialAd' is your instance of MAInterstitialAd
[interstitialAd setLocalExtraParameterForKey: @"amazon_ad_response" value: adResponse];
[interstitialAd loadAd];
}
- (void)onFailure:(DTBAdError)error dtbAdErrorInfo:(DTBAdErrorInfo *)errorInfo
{
// 'interstitialAd' is your instance of MAInterstitialAd
[interstitialAd setLocalExtraParameterForKey: @"amazon_ad_error" value: errorInfo];
[interstitialAd loadAd];
}
@end
import AppLovinSDK
import DTBiOSSDK
class ExampleViewController: UIViewController
{
private static var interstitialAd = MAInterstitialAd(adUnitIdentifier: "«MAX-inter-ad-unit-ID»")
private static var isFirstLoad = true
func loadAd()
{
// If first load - load ad from Amazon's SDK, then load ad for MAX
if Self.isFirstLoad
{
Self.isFirstLoad = false
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
adLoader.setAdSizes([DTBAdSize(interstitialAdSizeWithSlotUUID: "«Amazon-inter-slot-ID»")!])
adLoader.loadAd(self)
}
else
{
Self.interstitialAd.load()
}
}
}
extension ExampleViewController: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'interstitialAd' is your instance of MAInterstitialAd
Self.interstitialAd.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
Self.interstitialAd.load()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'interstitialAd' is your instance of MAInterstitialAd
Self.interstitialAd.setLocalExtraParameterForKey("amazon_ad_error", value: dtbAdErrorInfo)
Self.interstitialAd.load()
}
}
Amazon interstitial 광고를 MAX에 연동하려면 먼저 Amazon 광고를 로드해야 합니다.
MAX 광고를 로드하기 전에 DTBAdResponse 또는 DTBAdErrorInfo를 MAInterstitialAd 인스턴스에 전달합니다.
-[MAInterstitialAd setLocalExtraParameterForKey:value:]를 호출하여 이 작업을 수행할 수 있습니다.
세션당 한 번만 Amazon DTBAdResponse 또는 DTBAdErrorInfo를 로드하여 MAInterstitialAd 인스턴스에 전달해야 합니다.
#import <AppLovinSDK/AppLovinSDK.h>
#import <DTBiOSSDK/DTBiOSSDK.h>
@interface ExampleViewController ()<DTBAdCallback>
⋮
@end
@implementation ExampleViewController
static MAInterstitialAd *interstitialAd;
static BOOL isFirstLoad;
+ (void)initialize
{
[super initialize];
interstitialAd = [[MAInterstitialAd alloc] initWithAdUnitIdentifier: @"«MAX-inter-ad-unit-ID»"];
isFirstLoad = YES;
}
- (void)loadAd
{
// If first load - load ad from Amazon's SDK, then load ad for MAX
if ( isFirstLoad )
{
isFirstLoad = NO;
DTBAdNetworkInfo *adNetworkInfo = [[DTBAdNetworkInfo alloc] initWithNetworkName: DTBADNETWORK_MAX];
DTBAdLoader *adLoader = [[DTBAdLoader alloc] initWithAdNetworkInfo: adNetworkInfo];
// Switch video player width and height values(320, 480) depending on device orientation
[adLoader setAdSizes: @[
[[DTBAdSize alloc] initVideoAdSizeWithPlayerWidth: 320 height: 480 andSlotUUID:@"«Amazon-video-inter-slot-ID»"]
]];
[adLoader loadAd: self];
}
else
{
[interstitialAd loadAd];
}
}
- (void)onSuccess:(DTBAdResponse *)adResponse
{
// 'interstitialAd' is your instance of MAInterstitialAd
[interstitialAd setLocalExtraParameterForKey: @"amazon_ad_response" value: adResponse];
[interstitialAd loadAd];
}
- (void)onFailure:(DTBAdError)error dtbAdErrorInfo:(DTBAdErrorInfo *)errorInfo
{
// 'interstitialAd' is your instance of MAInterstitialAd
[interstitialAd setLocalExtraParameterForKey: @"amazon_ad_error" value: errorInfo];
[interstitialAd loadAd];
}
@end
import AppLovinSDK
import DTBiOSSDK
class ExampleViewController: UIViewController
{
private static var interstitialAd = MAInterstitialAd(adUnitIdentifier: "«MAX-inter-ad-unit-ID»")
private static var isFirstLoad = true
func loadAd()
{
// If first load - load ad from Amazon's SDK, then load ad for MAX
if Self.isFirstLoad
{
Self.isFirstLoad = false
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
// Switch video player width and height values(320, 480) depending on device orientation
adLoader.setAdSizes([DTBAdSize(videoAdSizeWithPlayerWidth: 320, height: 480, andSlotUUID: "«Amazon-video-inter-slot-ID»")!])
adLoader.loadAd(self)
}
else
{
Self.interstitialAd.load()
}
}
}
extension ExampleViewController: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'interstitialAd' is your instance of MAInterstitialAd
Self.interstitialAd.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
Self.interstitialAd.load()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'interstitialAd' is your instance of MAInterstitialAd
Self.interstitialAd.setLocalExtraParameterForKey("amazon_ad_error", value: dtbAdErrorInfo)
Self.interstitialAd.load()
}
}
Amazon rewarded 비디오를 MAX에 연동하려면 먼저 Amazon 광고를 로드해야 합니다.
MAX 광고를 로드하기 전에 DTBAdResponse 또는 DTBAdErrorInfo를 MARewardedAd 인스턴스에 전달합니다.
-[MARewardedAd setLocalExtraParameterForKey:value:]를 호출하여 이 작업을 수행할 수 있습니다.
Amazon DTBAdResponse 또는 DTBAdErrorInfo를 로드하여 MARewardedAd 인스턴스에 한 번만 전달해야 합니다.
#import <AppLovinSDK/AppLovinSDK.h>
#import <DTBiOSSDK/DTBiOSSDK.h>
@interface ExampleViewController ()<DTBAdCallback>
⋮
@end
@implementation ExampleViewController
static MARewardedAd *rewardedAd;
static BOOL isFirstLoad;
+ (void)initialize
{
[super initialize];
rewardedAd = [MARewardedAd sharedWithAdUnitIdentifier: @"«MAX-rewarded-ad-unit-ID»"];
isFirstLoad = YES;
}
- (void)loadAd
{
// If first load - load ad from Amazon's SDK, then load ad for MAX
if ( isFirstLoad )
{
isFirstLoad = NO;
DTBAdNetworkInfo *adNetworkInfo = [[DTBAdNetworkInfo alloc] initWithNetworkName: DTBADNETWORK_MAX];
DTBAdLoader *adLoader = [[DTBAdLoader alloc] initWithAdNetworkInfo: adNetworkInfo];
// Switch video player width and height values(320, 480) depending on device orientation
[adLoader setAdSizes: @[
[[DTBAdSize alloc] initVideoAdSizeWithPlayerWidth: 320 height: 480 andSlotUUID:@"«Amazon-video-rewarded-slot-ID»"]
]];
[adLoader loadAd: self];
}
else
{
[rewardedAd loadAd];
}
}
- (void)onSuccess:(DTBAdResponse *)adResponse
{
// 'rewardedAd' is your instance of MARewardedAd
[rewardedAd setLocalExtraParameterForKey: @"amazon_ad_response" value: adResponse];
[rewardedAd loadAd];
}
- (void)onFailure:(DTBAdError)error dtbAdErrorInfo:(DTBAdErrorInfo *)errorInfo
{
// 'rewardedAd' is your instance of MARewardedAd
[rewardedAd setLocalExtraParameterForKey: @"amazon_ad_error" value: errorInfo];
[rewardedAd loadAd];
}
@end
import AppLovinSDK
import DTBiOSSDK
class ExampleViewController: UIViewController
{
private static var rewardedAd = MARewardedAd.shared(withAdUnitIdentifier: "«MAX-rewarded-ad-unit-ID»")
private static var isFirstLoad = true
func loadAd()
{
// If first load - load ad from Amazon's SDK, then load ad for MAX
if Self.isFirstLoad
{
Self.isFirstLoad = false
let adLoader = DTBAdLoader(adNetworkInfo: DTBAdNetworkInfo(networkName: DTBADNETWORK_MAX))
// Switch video player width and height values(320, 480) depending on device orientation
adLoader.setAdSizes([DTBAdSize(videoAdSizeWithPlayerWidth: 320, height: 480, andSlotUUID: "«Amazon-video-rewarded-slot-ID»")!])
adLoader.loadAd(self)
}
else
{
Self.rewardedAd.load()
}
}
}
extension ExampleViewController: DTBAdCallback
{
func onSuccess(_ adResponse: DTBAdResponse!)
{
// 'rewardedAd' is your instance of MARewardedAd
Self.rewardedAd.setLocalExtraParameterForKey("amazon_ad_response", value: adResponse)
Self.rewardedAd.load()
}
func onFailure(_ error: DTBAdError, dtbAdErrorInfo: DTBAdErrorInfo!)
{
// 'rewardedAd' is your instance of MARewardedAd
Self.rewardedAd.setLocalExtraParameterForKey("amazon_ad_error", value: dtbAdErrorInfo)
Self.rewardedAd.load()
}
}
AppLovin은 Amazon SDK의 테스트 모드를 활성화할 것을 권장합니다. 이를 활성화하면 테스트 광고를 수신하게 됩니다. 다음 호출을 통해 테스트 모드를 활성화합니다:
[[DTBAds sharedInstance] setLogLevel: DTBLogLevelAll];
[[DTBAds sharedInstance] setTestMode: YES];
DTBAds.sharedInstance().setLogLevel(DTBLogLevelAll)
DTBAds.sharedInstance().testMode = true
Amazon 광고만 포함하도록 waterfall을 필터링할 수 있습니다. 그렇게 하려면 Mediation Debugger에서 Select Live Network로 이동하여 Amazon 네트워크를 선택합니다.
App Transport Security (ATS)를 비활성화하려면 앱의 Info.plist에 NSAppTransportSecurity를 추가합니다.
그런 다음 NSAllowsArbitraryLoads 키를 추가하고 Boolean 값을 YES로 설정합니다.
이 키만 존재하는지 확인하십시오.

연동 방법은 SKAdNetwork 문서를 참조하세요.