네이티브 광고를 사용하면 앱의 기존 디자인과 일관된 방식으로 앱을 수익화할 수 있습니다. AppLovin MAX SDK를 통해 광고의 개별 에셋에 액세스할 수 있습니다. 이 방식을 통해 앱의 디자인 및 느낌과 일관되도록 광고 레이아웃을 디자인할 수 있습니다. SDK가 이미지 캐싱 및 메트릭 추적을 자동으로 처리합니다. 개발자는 광고를 표시하는 방법, 시기, 위치에만 집중할 수 있습니다.
AppLovin은 템플릿 연동을 지원 중단했습니다. 템플릿을 통해 앱에 네이티브 광고를 연동하는 경우, 해당 광고는 부터 no-fill이 발생하기 시작합니다. AppLovin은 향후 SDK 릴리스에서 템플릿 연동에 대한 지원을 제거할 예정입니다.
커스텀 뷰가 있고 해당 뷰에 네이티브 광고 에셋을 수동으로 로드하려는 경우 이 API를 사용하십시오. 이 연동 방법은 크게 세 가지 단계로 구성됩니다.
수동 API를 사용하려면 Create New Ad Unit 화면에서 Manual을 선택하십시오.

커스텀 UI 컴포넌트를 MAX SDK에 바인딩하고 해당 컴포넌트에 네이티브 광고 에셋을 렌더링할 수 있습니다. 이 예제는 xib와 고유 태그 ID를 사용하여 생성된 커스텀 뷰로 이를 구현하는 방법을 보여줍니다. 프로그래밍 방식 또는 Storyboard를 사용하여 뷰를 생성하는 경우에도 이 방법을 사용할 수 있습니다.
AppLovin 정책에 따라 광고에는 반드시 개인정보 보호 정보 아이콘이 포함되어야 합니다.
이 아이콘은 중요한 개인정보 처리방침 고지로 연결됩니다.
-[MANativeAdViewBinderBuilder setOptionsContentViewTag:]를 통해 바인딩할 수 있습니다.
바인딩할 UI 컴포넌트를 포함하는 커스텀 뷰는 반드시 MANativeAdView를 상속해야 합니다.

커스텀 뷰의 서브뷰에 고유한 태그 ID를 할당하십시오.
이 ID는 다음 연동 단계에서 사용됩니다.
아래 예시 이미지는 타이틀 레이블의 ID를 1234로 설정한 모습입니다.

다음으로, MANativeAdViewBinder 인스턴스를 사용하여 고유 태그 ID로 서브뷰를 바인딩하십시오.
AppLovin은 네트워크가 특정 에셋을 반환하는 것을 보장하지 않습니다.
#import "ExampleViewController.h"
#import <AppLovinSDK/AppLovinSDK.h>
⋮
@implementation ExampleViewController
⋮
- (MANativeAdView *)createNativeAdView
{
UINib *nativeAdViewNib = [UINib nibWithNibName: @"NativeCustomAdView" bundle: NSBundle.mainBundle];
MANativeAdView *nativeAdView = [nativeAdViewNib instantiateWithOwner: nil options: nil].firstObject;
MANativeAdViewBinder *binder = [[MANativeAdViewBinder alloc] initWithBuilderBlock:^(MANativeAdViewBinderBuilder *builder) {
builder.titleLabelTag = «title-label-tag»;
builder.bodyLabelTag = «body-lable-tag»;
builder.callToActionButtonTag = «call-to-action-label-tag»;
builder.iconImageViewTag = «icon-image-view-taG»;
builder.mediaContentViewTag = «media-view-content-view-tag»;
builder.starRatingContentViewTag = «star-rating-content-view-tag»;
builder.advertiserLabelTag = «advertiser-label-tag»;
builder.optionsContentViewTag = «options-content-view-tag»;
}];
[nativeAdView bindViewsWithAdViewBinder: binder];
return nativeAdView;
}
⋮
@end
class ExampleViewController : UIViewController
{
func createNativeAdView() -> MANativeAdView
{
let nativeAdViewNib = UINib(nibName: "NativeCustomAdView", bundle: Bundle.main)
let nativeAdView = nativeAdViewNib.instantiate(withOwner: nil, options: nil).first! as! MANativeAdView?
let adViewBinder = MANativeAdViewBinder.init(builderBlock: { (builder) in
builder.titleLabelTag = «title-label-tag»;
builder.bodyLabelTag = «body-lable-tag»;
builder.callToActionButtonTag = «call-to-action-label-tag»;
builder.iconImageViewTag = «icon-image-view-tag»;
builder.mediaContentViewTag = «media-view-content-view-tag»;
builder.starRatingContentViewTag = «star-rating-content-view-tag»;
builder.advertiserLabelTag = «advertiser-label-tag»;
builder.optionsContentViewTag = «options-content-view-tag»;
})
nativeAdView?.bindViews(with: adViewBinder)
}
}
각 네트워크의 가이드를 따르고 필수 광고 에셋을 바인딩하십시오. 그렇지 않으면 해당 네트워크에서 노출을 무효화할 수 있습니다.
Google bidding 및 Google AdMob 어댑터 버전 9.11.0.6 및 Google Ad Manager 어댑터 버전 9.11.0.5부터 UI 컴포넌트를 바인딩하려면 다음 단계를 수행하십시오. 이를 통해 커스텀 네이티브 광고 뷰에서 연결되지 않은 뷰도 해당 네트워크에서 클릭할 수 있도록 보장합니다.
모든 광고 에셋을 포함하는 MANativeAdView 내부에 래퍼 뷰를 추가합니다.
해당 뷰의 Custom Class를 GADNativeAdView로 설정합니다.

이 래퍼 뷰에 다른 뷰에서 사용하지 않는 고유한 Tag를 부여합니다.

네이티브 광고 로더에 이 태그 값을 포함하는 로컬 추가 파라미터를 설정하고, 해당 키를 google_native_ad_view_tag로 지정합니다.
예를 들어, 뷰의 태그가 1008인 경우:
-[setLocalExtraParameterForKey: "google_native_ad_view_tag" value: 1008]
setLocalExtraParameterForKey("google_native_ad_view_tag", value: 1008)
사전 렌더링된 네이티브 광고를 로드하려면 광고 단위 ID에 해당하는 MANativeAdLoader를 인스턴스화하고 해당 loadAdIntoAdView 메서드를 호출하십시오.
네이티브 광고의 로드 상태가 변경될 때 알림을 받을 수 있도록 MANativeAdDelegate를 구현하고 설정하십시오.
네이티브 광고를 로드하려면 광고 단위 ID에 해당하는 MANativeAdLoader를 인스턴스화하고 해당 loadAd 메서드를 호출하십시오.
네이티브 광고의 로드 상태가 변경될 때 알림을 받을 수 있도록 MANativeAdDelegate를 구현하고 설정하십시오.
그런 다음 didLoadNativeAd:forAd:에서 반환된 MAAd를 사용하여 광고 뷰를 렌더링합니다.
이는 MANativeAdLoader인 renderNativeAdView:withAd: 메서드를 호출하여 수행할 수 있습니다.
네이티브 광고는 4시간의 광고 만료 시간 창 내에 노출해야 합니다. 이 시간 창을 벗어나 노출된 광고와 관련된 노출은 무효화됩니다.
네이티브 광고를 더 이상 사용하지 않는 경우 해당 리소스를 제거하십시오.
destroy() 메서드를 호출하여 제거할 수 있습니다.
그렇지 않으면 앱의 성능이 저하될 수 있습니다.
이전 단계에서 UI 컴포넌트를 바인딩한 후 네이티브 광고를 로드하고 제거하는 방법의 예시는 다음과 같습니다.
#import "ExampleViewController.h"
#import <AppLovinSDK/AppLovinSDK.h>
@interface ExampleViewController()<MANativeAdDelegate, MAAdRevenueDelegate>
@property (nonatomic, strong) UIView *nativeAdContainerView;
@property (nonatomic, strong) MANativeAdLoader *nativeAdLoader;
@property (nonatomic, strong) MAAd *loadedNativeAd;
@end
@implementation ExampleViewController
⋮
- (void)createNativeAdLoader
{
self.nativeAdLoader = [[MANativeAdLoader alloc] initWithAdUnitIdentifier: @"«ad-unit-ID»"];
self.nativeAdLoader.nativeAdDelegate = self;
self.nativeAdLoader.revenueDelegate = self;
}
- (void)loadNativeAd
{
[self.nativeAdLoader loadAdIntoAdView: [self createNativeAdView]];
}
- (void)didLoadNativeAd:(MANativeAdView *)nativeAdView forAd:(MAAd *)ad
{
// Cleanup any pre-existing native ad to prevent memory leaks.
if ( self.loadedNativeAd )
{
[self.nativeAdLoader destroyAd: self.loadedNativeAd];
}
// Save ad for cleanup.
self.loadedNativeAd = ad;
// Set to false if modifying constraints after adding the ad view to your layout
self.nativeAdContainerView.translatesAutoresizingMaskIntoConstraints = NO;
// Add the native ad view to your layout
[self.nativeAdContainerView addSubview: nativeAdView];
// Set ad view to span width and height of container and center the ad
[self.nativeAdContainerView addConstraint: [NSLayoutConstraint constraintWithItem: nativeAdView attribute: NSLayoutAttributeWidth r elatedBy: NSLayoutRelationEqual toItem: self.nativeAdContainerView attribute: NSLayoutAttributeWidth multiplier: 1 constant: 0]];
[self.nativeAdContainerView addConstraint: [NSLayoutConstraint constraintWithItem: nativeAdView attribute: NSLayoutAttributeHeight relatedBy: NSLayoutRelationEqual toItem: self.nativeAdContainerView attribute: NSLayoutAttributeHeight multiplier: 1 constant: 0]];
[self.nativeAdContainerView addConstraint: [NSLayoutConstraint constraintWithItem: nativeAdView attribute: NSLayoutAttributeCenterX relatedBy: NSLayoutRelationEqual toItem: self.nativeAdContainerView attribute: NSLayoutAttributeCenterX multiplier: 1 constant: 0]];
[self.nativeAdContainerView addConstraint: [NSLayoutConstraint constraintWithItem: nativeAdView attribute: NSLayoutAttributeCenterY relatedBy: NSLayoutRelationEqual toItem: self.nativeAdContainerView attribute: NSLayoutAttributeCenterY multiplier: 1 constant: 0]];
}
- (void)didFailToLoadNativeAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withError:(MAError *)error
{
// Native ad load failed
// AppLovin recommends that you retry with exponentially higher delays up to a maximum delay
}
- (void)didClickNativeAd:(MAAd *)ad { }
- (void)didPayRevenueForAd:(MAAd *)ad { }
@end
class ExampleViewController : UIViewController
{
private var nativeAdContainerView: UIView!
private var nativeAdLoader: MANativeAdLoader?
private var loadedNativeAd: MAAd?
⋮
func createNativeAdLoader()
{
nativeAdLoader = MANativeAdLoader(adUnitIdentifier: "«ad-unit-ID»")
nativeAdLoader?.nativeAdDelegate = self;
nativeAdLoader?.revenueDelegate = self;
}
func loadNativeAd()
{
nativeAdLoader?.loadAd(into: createNativeAdView());
}
}
extension ExampleViewController: MANativeAdDelegate
{
func didLoadNativeAdView(_ nativeAdView: MANativeAdView?, for ad: MAAd)
{
if let nativeAd = loadedNativeAd
{
nativeAdLoader?.destroy(nativeAd)
}
loadedNativeAd = ad;
// Set to false if modifying constraints after adding the ad view to your layout
nativeAdContainerView.translatesAutoresizingMaskIntoConstraints = false
// Add the native ad view to your layout
guard let nativeAdView = nativeAdView else { return }
nativeContainerView.addSubview(nativeAdView)
// Set ad view to span width and height of container and center the ad
nativeAdContainerView.addConstraint(NSLayoutConstraint(item: nativeAdView, attribute: .width, relatedBy: .equal, toItem: nativeAdContainerView, attribute: .width, multiplier: 1, constant: 0))
nativeAdContainerView.addConstraint(NSLayoutConstraint(item: nativeAdView, attribute: .height, relatedBy: .equal, toItem: nativeAdContainerView, attribute: .height, multiplier: 1, constant: 0))
nativeAdContainerView.addConstraint(NSLayoutConstraint(item: nativeAdView, attribute: .centerX, relatedBy: .equal, toItem: nativeAdContainerView, attribute: .centerX, multiplier: 1, constant: 0))
nativeAdContainerView.addConstraint(NSLayoutConstraint(item: nativeAdView, attribute: .centerY, relatedBy: .equal, toItem: nativeAdContainerView, attribute: .centerY, multiplier: 1, constant: 0))
}
func didFailToLoadNativeAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError)
{
// Native ad load failed
// AppLovin recommends that you retry with exponentially higher delays up to a maximum delay
}
func didClickNativeAd(_ ad: MAAd) { }
}
extension ExampleViewController: MAAdRevenueDelegate
{
func didPayRevenue(for ad: MAAd) { }
}
AppLovin Exchange 디맨드의 경우 Title, Description, CTA에 허용되는 최대 글자 수는 다음과 같습니다.
| 에셋 | 최대 글자 수 |
|---|---|
| Title | 50자 |
| Description | 150자. 149자 뒤에 150번째 글자로 말줄임표(…)를 추가할 수 있습니다. |
| CTA | 15자 |
SDK 연동 네트워크의 경우, 해당 네트워크에서 최대 글자 수를 설정합니다.
다음 코드 스니펫은 네이티브 광고의 미디어 콘텐츠 가로세로 비율을 가져오는 방법을 보여줍니다.
- (void)didLoadNativeAd:(MANativeAdView *)nativeAdView forAd:(MAAd *)ad
{
CGFloat aspectRatio = ad.nativeAd.mediaContentAspectRatio;
}
func didLoadNativeAd(_ nativeAdView: MANativeAdView?, for ad: MAAd)
{
if let nativeAd = ad.nativeAd
{
var aspectRatio = nativeAd.mediaContentAspectRatio
}
}
일부 네트워크는 미디어 콘텐츠 가로세로 비율을 제공하지 않으며, 이 경우 값은 0입니다.
AppLovin MAX SDK를 사용하면 광고된 앱의 별점에 액세스하고 이를 렌더링할 수 있습니다. 제공되는 경우 값은 [0.0, 5.0] 범위의 부동 소수점 수입니다.
MAX SDK는 별점 컨테이너로 지정한 컨테이너 뷰에 별을 자동으로 렌더링합니다. 네트워크에서 별점을 제공하지 않거나 별점이 < 3인 경우, SDK는 별점 컨테이너 뷰를 채우지 않습니다. 개발자는 이에 맞게 레이아웃을 조정해야 합니다.
현재 광고의 별점을 가져오려면 다음을 수행하십시오.
- (void)didLoadNativeAd:(MANativeAdView *)nativeAdView forAd:(MAAd *)ad
{
if ( ad.nativeAd.starRating < 3 )
{
// Star rating not available, or < 3 - hide star rating container view
return;
}
// Star rating available and >= 3 - show star rating container view
}
func didLoadNativeAd(_ nativeAdView: MANativeAdView?, for ad: MAAd)
{
if let nativeAd = ad.nativeAd
{
guard let starRating = nativeAd.starRating, starRating >= 3 else {
// Star rating not available, or < 3 - hide star rating container view
return
}
// Star rating available and >= 3 - show star rating container view
}
}
Ad Placer는 UITableView 또는 UICollectionView를 사용하여 기존 콘텐츠 스트림에 네이티브 광고를 자동으로 삽입합니다.
이 API를 연동하려면 다음의 주요 단계를 수행하십시오.
AppLovin 정책에 따라 광고에는 반드시 개인정보 보호 정보 아이콘이 포함되어야 합니다.
이 아이콘은 중요한 개인정보 처리방침 고지로 연결됩니다.
-[MANativeAdViewBinderBuilder setOptionsContentViewTag:]를 통해 바인딩할 수 있습니다.
바인딩할 UI 컴포넌트를 포함하는 커스텀 뷰는 반드시 MANativeAdView를 상속해야 합니다.
Ad placer는 수동 네이티브 광고 레이아웃을 지원합니다. 광고 단위를 구성하는 방법은 위의 "Manual" 섹션을 참조하십시오. Ad placer가 레이아웃을 지원하도록 구성하는 방법은 아래의 광고 렌더링 설정 구성을 참조하십시오.
각 네트워크의 가이드를 따르고 필수 광고 에셋을 바인딩하십시오. 그렇지 않으면 해당 네트워크에서 노출을 무효화할 수 있습니다.
광고 단위 식별자를 사용하여 MAAdPlacerSettings 객체를 생성합니다.
이 객체는 Ad placer를 구성하고 피드 내 광고의 포지셔닝 정보를 제공합니다.
MAAdPlacerSettings *settings = [MAAdPlacerSettings settingsWithAdUnitIdentifier: @"«ad-unit-ID»"];
let settings = MAAdPlacerSettings(adUnitIdentifier: "«ad-unit-ID»")
Ad placer는 피드에 광고를 배치합니다. 이는 최소한 다음 중 하나를 기반으로 수행됩니다.
MAAdPlacerSettings를 수정하여 광고 포지션을 구성하십시오.
[settings addFixedPositions: [NSIndexPath indexPathForRow: 1 inSection: 0]];
settings.addFixedPosition(IndexPath(row: 1, section: 0))
[settings resetFixedPositions];
settings.resetFixedPositions()
settings.repeatingInterval = 5;
settings.repeatingInterval = 5
MAAdPlacerSettings에서 설정을 조정하여 Ad placer를 구성할 수 있습니다.
maximumAdCountmaximumPreloadedAdCountAd placer를 구성할 때 다음 두 가지 옵션 중 하나를 선택하십시오.
UITableView를 기반으로 하는 경우 MATableViewAdPlacer를 사용합니다.
UICollectionView를 기반으로 하는 경우 MACollectionViewAdPlacer를 사용합니다.
헬퍼 클래스는 기존 어댑터를 래핑하여 피드에 광고를 자동으로 렌더링하고 삽입합니다.코드에서 UITableView/UICollectionView 프로퍼티 및 메서드 사용을 AppLovin의 카테고리 상응 항목으로 대체해야 합니다.
이들은 UITableView+MATableViewAdPlacer.h 또는 UICollectionView+MACollectionViewAdPlacer.h에 존재합니다.
이 메서드들은 삽입된 광고를 고려하여 인덱스 패스를 조정합니다.
또한 콘텐츠 변경 사항을 Ad placer에 알립니다.
MAAdPlacer를 직접 사용하거나 상속하는 것을 선호할 수 있습니다.MATableViewAdPlacer로 Ad placer를 구성하려면 다음 지침을 따르십시오.
MATableViewAdPlacer를 초기화합니다. self.adPlacer = [MATableViewAdPlacer placerWithTableView: self.tableView settings: settings];
adPlacer = MATableViewAdPlacer(tableView: tableView, settings: settings)
UITableView 프로퍼티 및 메서드를 AppLovin 카테고리 상응 항목(al_ 접두사 포함)으로 대체합니다.
dataSourcedelegatedeleteRowsAtIndexPaths:withRowAnimation:deleteSections:withRowAnimation:dequeueReusableCellWithIdentifier:forIndexPath:deselectRowAtIndexPath:animated:endUpdatesindexPathForCell:indexPathForRowAtPoint:indexPathForSelectedRowindexPathsForRowsInRect:indexPathsForSelectedRowsindexPathsForVisibleRowsinsertRowsAtIndexPaths:withRowAnimation:insertSections:withRowAnimation:moveRowsAtIndexPaths:withRowAnimation:moveSections:withRowAnimation:performBatchUpdates:completion:rectForRowAtIndexPath:reloadDatareloadRowsAtIndexPaths:withRowAnimation:reloadSections:withRowAnimation:scrollToRowAtIndexPath:atScrollPosition:animated:selectRowAtIndexPath:animated:scrollPosition:visibleCellsloadAds를 호출하여 광고 로드를 시작합니다.다음 코드는 MATableViewAdPlacer를 사용하여 테이블 뷰에 광고를 로드하는 방법을 보여줍니다.
- (void)viewDidLoad
{
[super viewDidLoad];
// Configure table view
self.tableView.al_delegate = self;
self.tableView.al_dataSource = self;
// Configure ad placer and load ads
MAAdPlacerSettings *settings = [MAAdPlacerSettings settingsWithAdUnitIdentifier: @"«ad-unit-ID»"];
self.adPlacer = [MATableViewAdPlacer placerWithTableView: self.tableView settings: settings];
self.adPlacer.delegate = self;
[self.adPlacer loadAds];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.data.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView al_dequeueReusableCellWithIdentifier: @"YourCell" forIndexPath: indexPath];
cell.textLabel.text = self.data[indexPath.row];
return cell;
}
override func viewDidLoad()
{
super.viewDidLoad()
// Configure table view
tableView.al_delegate = self
tableView.al_dataSource = self
// Configure ad placer and load ads
let settings = MAAdPlacerSettings(adUnitIdentifier: "«ad-unit-ID»")
adPlacer = MATableViewAdPlacer(tableView: tableView, settings: settings)
adPlacer.delegate = self
adPlacer.loadAds()
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
return data.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
{
let cell = tableView.al_dequeueReusableCell(withIdentifier: "YourCell", for: indexPath)
cell.textLabel!.text = data[indexPath.row]
return cell
}
MACollectionViewAdPlacer로 Ad placer를 구성하려면 다음 지침을 따르십시오.
MACollectionViewAdPlacer를 초기화합니다. self.adPlacer = [MACollectionViewAdPlacer placerWithCollectionView: self.collectionView settings: settings];
adPlacer = MACollectionViewAdPlacer(collectionView: collectionView, settings: settings)
UITableView 프로퍼티 및 메서드를 AppLovin 카테고리 상응 항목(al_ 접두사 포함)으로 대체합니다.
cellForItemAtIndexPath:dataSourcedelegatedeleteItemsAtIndexPaths:deleteSections:dequeueReusableCellWithIdentifier:forIndexPath:deselectItemAtIndexPath:animated:indexPathForCell:indexPathForItemAtPoint:indexPathsForSelectedItemsindexPathsForVisibleItemsinsertItemsAtIndexPaths:insertSections:layoutAttributesForItemAtIndexPath:moveItemsAtIndexPaths:moveSections:performBatchUpdates:completion:reloadDatareloadItemsAtIndexPaths:reloadSections:scrollToItemAtIndexPath:atScrollPosition:animated:selectedItemAtIndexPath:animated:scrollPosition:visibleCellsloadAds를 호출하여 광고 로드를 시작합니다.다음 코드는 MACollectionViewAdPlacer를 사용하여 테이블 뷰에 광고를 로드하는 방법을 보여줍니다.
- (void)viewDidLoad
{
[super viewDidLoad];
// Configure collection view
self.collectionView.al_delegate = self;
self.collectionView.al_dataSource = self;
// Configure ad placer and load ads
MAAdPlacerSettings *settings = [MAAdPlacerSettings settingsWithAdUnitIdentifier: @"«ad-unit-ID»"];
self.adPlacer = [MACollectionViewAdPlacer placerWithCollectionView: self.collectionView settings: settings];
self.adPlacer.delegate = self;
[self.adPlacer loadAds];
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return self.data.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
MyCollectionViewCell *cell = (MyCollectionViewCell *)[collectionView al_dequeueReusableCellWithIdentifier: @"YourCell" forIndexPath: indexPath];
cell.textLabel.text = self.data[indexPath.row];
return cell;
}
override func viewDidLoad()
{
super.viewDidLoad()
// Configure collection view
collectionView.al_delegate = self
collectionView.al_dataSource = self
// Configure ad placer and load ads
let settings = MAAdPlacerSettings(adUnitIdentifier: "«ad-unit-ID»")
adPlacer = MACollectionViewAdPlacer(collectionView: collectionView, settings: settings)
adPlacer.delegate = self
adPlacer.loadAds()
}
override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
{
return data.count
}
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell
{
let cell = collectionView.al_dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) as! MyCollectionViewCell
cell.textLabel.text = data[indexPath.row]
return cell
}
광고를 로드하기 전에 Ad placer에서 nativeAdViewNib 및 nativeAdViewBinder 프로퍼티를 설정하십시오.
AppLovin은 adSize 프로퍼티도 설정할 것을 권장합니다.
이를 통해 렌더링을 최적화할 수 있습니다.
모든 Ad placer에는 이벤트를 알릴 수 있는 선택적 델리게이트 콜백이 포함되어 있습니다.
didLoadAdAtIndexPath:didRemoveAdsAtIndexPaths:didClickAd:didPayRevenueForAd: