Ad Info를 포함한 레벨플레이 리스너 연동

아이언소스 SDK 7.2.3부터, 광고 콜백에서 네트워크, 세그먼트, 그리고 A/B테스트 등의 더 많은 데이터를 받을 수 있습니다.

새로운 광고 유닛 리스너 구현

AdInfo 콜백을 지원하는 새로운 콜백 리스너인 레벨플레이 리스너를 구현하세요.

AdInfo 객체는 성공적으로 로드 된 가장 최근의 광고 정보 객체이며, 로드 실패 시에는 광고가 로드되지 않기 때문에 콜백에 포함되지 않습니다.

데이터 중복을 피하기 위해, 기존에 사용하시던 리스너들을 등록해제 하시기를 권장 드립니다.

보상형 동영상 광고

+ (void)setLevelPlayRewardedVideoDelegate:(nullable id<LevelPlayRewardedVideoDelegate>)delegate;

#pragma mark - LevelPlayRewardedVideoDelegate
/**
 Called after a rewarded video has changed its availability to true.
 @param adInfo The info of the ad.
 Replaces the delegate rewardedVideoHasChangedAvailability:(true)available 
 */
- (void)hasAdAvailableWithAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has changed its availability to false.
 Replaces the delegate rewardedVideoHasChangedAvailability:(false)available 
 */
- (void)hasNoAvailableAd{
}

/**
 Called after a rewarded video has been viewed completely and the user is eligible for a reward.
 @param placementInfo An object that contains the placement's reward name and amount.
 @param adInfo The info of the ad.
 */
- (void)didReceiveRewardForPlacement:(ISPlacementInfo *)placementInfo withAdInfo:(ISAdInfo *)adInfo {
}

/**
 Called after a rewarded video has attempted to show but failed.
 @param error The reason for the error
 @param adInfo The info of the ad.
 */
- (void)didFailToShowWithError:(NSError *)error andAdInfo:(ISAdInfo *)adInfo {
}

/**
 Called after a rewarded video has been opened.
 @param adInfo The info of the ad.
 */
- (void)didOpenWithAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has been dismissed.
 @param adInfo The info of the ad.
 */
- (void)didCloseWithAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has been clicked. 
 This callback is not supported by all networks, and we recommend using it 
 only if it's supported by all networks you included in your build
 @param adInfo The info of the ad.
 */
- (void)didClick:(ISPlacementInfo *)placementInfo withAdInfo:(ISAdInfo *)adInfo{
}
IronSource.setLevelPlayRewardedVideoDelegate(delegate: LevelPlayRewardedVideoDelegate?)

// MARK: - LevelPlayRewardedVideoDelegate

/**
 Called after a rewarded video has changed its availability to true.
 @param adInfo The info of the ad.
 Replaces the delegate rewardedVideoHasChangedAvailability(available: bool=true)
 */
func hasAvailableAd(with adInfo: ISAdInfo!) {
}

/**
 Called after a rewarded video has changed its availability to false.
 Replaces the delegate rewardedVideoHasChangedAvailability:(available: bool=false)
 */
func hasNoAvailableAd() {
}

/**
 Called after a rewarded video has been viewed completely and the user is eligible for a reward.
 @param placementInfo An object that contains the placement's reward name and amount.
 @param adInfo The info of the ad.
 */
func didReceiveReward(forPlacement placementInfo: ISPlacementInfo!, with adInfo: ISAdInfo!) {
}

/**
 Called after a rewarded video has attempted to show but failed.
 @param error The reason for the error
 @param adInfo The info of the ad.
 */    
func didFailToShowWithError(_ error: Error!, andAdInfo adInfo: ISAdInfo!) {
}

/**
 Called after a rewarded video has been opened.
 @param adInfo The info of the ad.
 */    
func didOpen(with adInfo: ISAdInfo!) {
}
        
/**
 Called after a rewarded video has been dismissed.
 @param adInfo The info of the ad.
 */ 
func didClose(with adInfo: ISAdInfo!) {
}

/**
 Called after a rewarded video has been clicked. 
 This callback is not supported by all networks, and we recommend using it 
 only if it's supported by all networks you included in your build
 @param adInfo The info of the ad.
 */    
func didClick(_ placementInfo: ISPlacementInfo!, with adInfo: ISAdInfo!) {
}
Note: 대리자(delegate)를 ISRewardedVideoDelegate에서 LevelPlayRewardedVideoDelegate로 업데이트할 때, rewardedVideoHasChangedAvailability 콜백 대신 hasAdAvailableWithAdInfo 및 hasNoAvailableAd 콜백을 사용해 주세요.

보상형 동영상 광고 수동 로드

+ (void)setLevelPlayRewardedVideoManualDelegate:(nullable id<LevelPlayRewardedVideoManualDelegate>)delegate;

#pragma mark - LevelPlayRewardedVideoManualDelegate
/**
 Called after an rewarded video has been loaded in manual mode
 @param adInfo The info of the ad.
 */
- (void)didLoadWithAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has attempted to load but failed in manual mode
 @param error The reason for the error
 */
- (void)didFailToLoadWithError:(NSError *)error{
}

/**
 Called after a rewarded video has been viewed completely and the user is eligible for a reward.
 @param placementInfo An object that contains the placement's reward name and amount.
 @param adInfo The info of the ad.
 */
- (void)didReceiveRewardForPlacement:(ISPlacementInfo *)placementInfo withAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has attempted to show but failed.
 @param error The reason for the error
 @param adInfo The info of the ad.
 */
- (void)didFailToShowWithError:(NSError *)error andAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has been opened.
 @param adInfo The info of the ad.
 */
- (void)didOpenWithAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has been dismissed.
 @param adInfo The info of the ad.
 */
- (void)didCloseWithAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has been clicked. 
 This callback is not supported by all networks, and we recommend using it 
 only if it's supported by all networks you included in your build
 @param adInfo The info of the ad.
 */
- (void)didClick:(ISPlacementInfo *)placementInfo withAdInfo:(ISAdInfo *)adInfo{
}
IronSource.setLevelPlayRewardedVideoManualDelegate(delegate: LevelPlayRewardedVideoManualDelegate?)
// MARK: LevelPlayRewardedVideoManualDelegate

/**
 Called after an rewarded video has been loaded in manual mode
 @param adInfo The info of the ad.
 */
func didLoad(with adInfo: ISAdInfo!) {
}

/**
 Called after a rewarded video has attempted to load but failed in manual mode
 @param error The reason for the error
 */
func didFailToLoadWithError(_ error: Error!) {
}

/**
 Called after a rewarded video has been viewed completely and the user is eligible for a reward.
 @param placementInfo An object that contains the placement's reward name and amount.
 @param adInfo The info of the ad.
 */
func didReceiveReward(forPlacement placementInfo: ISPlacementInfo!, with adInfo: ISAdInfo!) {
}

/**
 Called after a rewarded video has attempted to show but failed.
 @param error The reason for the error
 @param adInfo The info of the ad.
 */
func didFailToShowWithError(_ error: Error!, andAdInfo adInfo: ISAdInfo!) {
}

/**
 Called after a rewarded video has been opened.
 @param adInfo The info of the ad.
 */
func didOpen(with adInfo: ISAdInfo!) {
}

/**
 Called after a rewarded video has been dismissed.
 @param adInfo The info of the ad.
 */
func didClose(with adInfo: ISAdInfo!) {
}

/**
 Called after a rewarded video has been clicked. 
 This callback is not supported by all networks, and we recommend using it 
 only if it's supported by all networks you included in your build
 @param adInfo The info of the ad.
 */
func didClick(_ placementInfo: ISPlacementInfo!, with adInfo: ISAdInfo!) {
}

인터스티셜 광고 (전면광고)

+ (void)setLevelPlayInterstitialDelegate:(nullable id<LevelPlayInterstitialDelegate>)delegate;

#pragma mark - LevelPlayInterstitialDelegate
/**
 Called after an interstitial has been loaded
 @param adInfo The info of the ad.
 */
- (void)didLoadWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called after an interstitial has attempted to load but failed.
 @param error The reason for the error
 */
- (void)didFailToLoadWithError:(NSError *)error{
}
/**
 Called after an interstitial has been opened. 
 This is the indication for impression. 
 @param adInfo The info of the ad.
 */
- (void)didOpenWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called after an interstitial has been dismissed.
 @param adInfo The info of the ad.
 */
- (void)didCloseWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called after an interstitial has attempted to show but failed.
 @param error The reason for the error
 @param adInfo The info of the ad.
 */
- (void)didFailToShowWithError:(NSError *)error andAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called after an interstitial has been clicked.
 @param adInfo The info of the ad.
 */
- (void)didClickWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called after an interstitial has been displayed on the screen.
 This callback is not supported by all networks, and we recommend using it 
 only if it's supported by all networks you included in your build. 
 @param adInfo The info of the ad.
 */
- (void)didShowWithAdInfo:(ISAdInfo *)adInfo{
}
IronSource.setLevelPlayInterstitialDelegate(delegate: LevelPlayInterstitialDelegate?)

// MARK: LevelPlayInterstitialDelegate

/**
 Called after an interstitial has been loaded
 @param adInfo The info of the ad.
 */
func didLoad(with adInfo: ISAdInfo!) {
}

/**
 Called after an interstitial has attempted to load but failed.
 @param error The reason for the error
 */        
func didFailToLoadWithError(_ error: Error!) {
}

/**
 Called after an interstitial has been opened. 
 This is the indication for impression. 
 @param adInfo The info of the ad.
 */        
func didOpen(with adInfo: ISAdInfo!) {
}

/**
 Called after an interstitial has been dismissed.
 @param adInfo The info of the ad.
 */       
func didClose(with adInfo: ISAdInfo!) {
}

/**
 Called after an interstitial has attempted to show but failed.
 @param error The reason for the error
 @param adInfo The info of the ad.
 */        
func didFailToShowWithError(_ error: Error!, andAdInfo adInfo: ISAdInfo!) {
}

/**
 Called after an interstitial has been clicked.
 @param adInfo The info of the ad.
 */
func didClick(with adInfo: ISAdInfo!) {
}

/**
 Called after an interstitial has been displayed on the screen.
 This callback is not supported by all networks, and we recommend using it 
 only if it's supported by all networks you included in your build. 
 @param adInfo The info of the ad.
 */
func didShow(with adInfo: ISAdInfo!) {
}

배너 광고

+ (void)setLevelPlayBannerDelegate:(nullable id<LevelPlayBannerDelegate>)delegate;

#pragma mark - LevelPlayBannerDelegate
/**
 Called after each banner ad has been successfully loaded, either a manual load or banner refresh
 @param adInfo The info of the ad.
 */
- (void)didLoad:(ISBannerView *)bannerView withAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a banner has attempted to load an ad but failed. 
 This delegate will be sent both for manual load and refreshed banner failures. 
 @param error The reason for the error
 */
- (void)didFailToLoadWithError:(NSError *)error{
}
/**
 Called after a banner has been clicked.
 @param adInfo The info of the ad.
 */
- (void)didClickWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called when a user was taken out of the application context.
 @param adInfo The info of the ad.
 */
- (void)didLeaveApplicationWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called when a banner presented a full screen content.
 @param adInfo The info of the ad.
 */
- (void)didPresentScreenWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called after a full screen content has been dismissed.
 @param adInfo The info of the ad.
 */
- (void)didDismissScreenWithAdInfo:(ISAdInfo *)adInfo{
}
IronSource.setLevelPlayBannerDelegate(delegate: LevelPlayBannerDelegate?)

//MARK: LevelPlayBannerDelegate
/**
 Called after each banner ad has been successfully loaded, either a manual load or banner refresh
 @param bannerView View object that contains banner 
 @param adInfo The info of the ad.
 */
func didLoad(_ bannerView: ISBannerView!, with adInfo: ISAdInfo!) {
}

/**
 Called after a banner has attempted to load an ad but failed. 
 This delegate will be sent both for manual load and refreshed banner failures. 
 @param error The reason for the error
 */
func didFailToLoadWithError(_ error: Error!) {
}

/**
 Called after a banner has been clicked.
 @param adInfo The info of the ad.
 */
func didClick(with adInfo: ISAdInfo!) {
}

/**
 Called when a user was taken out of the application context.
 @param adInfo The info of the ad.
 */
func didLeaveApplication(with adInfo: ISAdInfo!) {
}

/**
 Called when a banner presented a full screen content.
 @param adInfo The info of the ad.
 */
func didPresentScreen(with adInfo: ISAdInfo!) {
}

/**
 Called after a full screen content has been dismissed.
 @param adInfo The info of the ad.
 */
func didDismissScreen(with adInfo: ISAdInfo!) {
}
Note: didLoad 와 didFailToLoadWithError 대리자(Delegate)들은 수동 로드 시 및 배너 갱신 시 모두 호출됩니다.

AdInfo 데이터 연동

AdInfo가 포함된 레벨플레이 리스너 구현이 끝나면, 앱의 데이터 일부로 이 데이터를 사용하실 수 있습니다.

AdInfo 데이터가 없는 경우에는 adInfo의 문자열 파라미터가 빈 문자열로 반환되며, 숫자 파라미터의 경우 0 으로 반환됩니다.

(void)didLoadWithAdInfo:(ISAdInfo *)adInfo {
   NSString *auction_id = adInfo.auction_id;
   NSString *ad_unit = adInfo.ad_unit;
   NSString *ad_network = adInfo.ad_network;
   NSString *instance_name = adInfo.instance_name;
   NSString *instance_id = adInfo.instance_id;
   NSString *country = adInfo.country;
   NSNumber *revenue = adInfo.revenue;
   NSString *precision = adInfo.precision;
   NSString *ab = adInfo.ab;
   NSString *segment_name = adInfo.segment_name;
   NSString *encrypted_cpm = adInfo.encrypted_cpm;
}
func didLoadWithInfo(with adInfo: ISAdInfo!) {
   let auction_id: String = adInfo.action_id
   let ad_unit: String = adInfo.ad_unit
   let ad_network: String = adInfo.ad_network
   let instance_name: String = adInfo.instance_name
   let instance_id: String = adInfo.instance_id
   let country: String = adInfo.country
   let revenue: NSNumber = adInfo.revenue
   let precision: String = adInfo.precision
   let ab: String = adInfo.ab
   let segment_name: String = adInfo.segment_name
   let encrypted_cpm: String = adInfo.encrypted_cpm
}

Ad Info 필드

아래는 새 AdInfo 객체에 포함되어 반환되는 관련 데이터 필드 (설명 및 데이터 타입 포함) 목록입니다:

파라미터 명칭 설명 데이터 타입
auctionId 각 광고 경매 별 고유 식별자 String
adUnit 표시된 광고 유닛 (보상형 동영상/인터스티셜(전면광고)/배너) String
adNetwork 광고 제공한 광고 네트워크 명칭 String
instanceName 플랫폼 상에서 정의된 광고 네트워크 인스턴스의 명칭. 입찰형 인스턴스의 광고 소스의 경우, 인스턴스 명칭은 ‘Bidding’이 됩니다. String
instanceId 광고 네트워크 별 광고 Slot 식별자로, 광고 네트워크의 instance ID, placement ID, zone ID 등이 여기에 해당됩니다. String
country ISO 3166-1 형식 국가 코드 String
revenue 광고 노출로 생성된 수익 (USD). 수익값은 정확도(precison 필드 설명 참고)에 따라서 예상 수치 또는 실제 수치가 될 수 있습니다. Double
precision revenue(수익) 필드 값의 출처:
BID – 수익값이 실시강 경매에서 제공됨 (단, Meta Audience Network의 입찰 인스턴스의 경우 미지원)
RATE – 퍼블리셔가 레벨플레이 플랫폼 상에서 직접 할당한 값
CPM – 과거 인스턴스의 퍼포먼스 이력을 기준으로 레벨플레이 플랫폼에서 산출한 예상치
String
ab 레벨플레이 플랫폼 상에서 A/B 테스트가 활성화 되었는지 여부를 표시 String
segmentName 세분화 방법에 따라 정의된 사용자와 관련된 세그먼트 String
encryptedCPM Meta Audience Network 광고에만 해당하며, Meta Audience Network에서 클로즈 베타 기간동안 승인받은 퍼블리셔들에게만 전송됩니다. String