iOS
Hive AdKit for ADOP: iOS¶
Settings¶
Warning
Starting from AdKit version 1.5.1, the previously used AppKey has been changed to AppDomain. AppDomain is not compatible with the existing AppKey, so you need to obtain a new AppDomain for Hive AdKit initialization. For information regarding AppDomain, please contact the Tech Labs Platform Business Division Operations Team.
-
Modify the Info.plist file of the Xcode project as follows.
- Add the
GADApplicationIdentifier
key - Enter the AdMobId value (in the format ca-app-pub-XXXXX~YYYYY) as the key value
- Enter ADOP APP_DOMAIN as the value for the
BidmadAppDomain
key
- Add the
In iOS 14 and above, refer to the Preparing for iOS 14 guide to add the ADOP's SKAdNetwork list to the Info.plist file.
-
Add the following content to the CocoaPods settings of the project app.
-
Apply CocoaPod settings.
Note
To obtain information for filling out the personal information survey form when distributing the app, please refer to the Privacy Survey guide.
Application Guide¶
ADOP Test Advertisement Key¶
You must use the ad key issued by ADOP instead of AdMob.
let rewardVideoUnitId: String = "29e1ef67-98d2-47b3-9fa2-9192327dd75d"
let InterstitialAdUnitId: String = "228b95a9-6f42-46d8-a40d-60f17f751eb1"
let AdaptiveBannerAdUnitId: String = "1c3e3085-333f-45af-8427-2810c26a72fc"
let AppOpenAdUnitId: String = "0ddd6401-0f19-49ee-b1f9-63e910f92e77"
Hive AdKit Initialization¶
To initialize ADOP advertising, it is essential to issue adopAppDomain
. The issued adopAppDomain
must be used as an argument in the ADOP advertising initialization method.
Warning
From version 1.5.1 of AdKit, the previously used AppKey has been changed to AppDomain. The AppKey is not compatible with the existing AppDomain, so you need to obtain a new AppDomain for initialization. For information regarding AppDomain, please contact the operations team of the Tech Labs platform division.
Note
When performing initialization, a GDPR consent popup will automatically appear for regions in Europe and the UK (EEA & UK). In other regions, initialization will proceed immediately.
Warning
If you are using the Hive SDK, you must run AuthV4.setup
after completing the initialization of Hive AdKit. If the GDPR consent screen appears after displaying the ATT (App Tracking Transparency) consent notification, your app may be rejected during the Apple app review.
- If the game targets the Europe and UK (EEA & UK) regions, make sure the GDPR consent popup is set according to the GDPR message creation guide.
import AdKit
// 상용
AdKit.InitializeWithShowGDPRConsent(appDomain: appDomain, vc: self, bLog: false, gdprTestDeviceId: nil) { consentState in
/*
동의 = 1, 비동의 = 0, 알수없음 = -1, 필요없음 = -2
초기화 완료 콜백으로 GDPR 동의 상태 결과 값 consentState가 전달됩니다. 결과값에 따른 별도 처리가 필요하지 않습니다.
*/
print("InitializeWithShowGDPRConsent consentState : \(consentState)")
}
// GDPR EEA 테스트모드
AdKit.InitializeWithShowGDPRConsent(appDomain: appDomain, vc: self, bLog: true, gdprTestDeviceId: gdprTestDeviceId) { consentState in
/*
동의 = 1, 비동의 = 0, 알수없음 = -1, 필요없음 = -2
초기화 완료 콜백으로 GDPR 동의 상태 결과 값 consentState가 전달됩니다. 결과값에 따른 별도 처리가 필요하지 않습니다.
*/
print("InitializeWithShowGDPRConsent consentState : \(consentState)")
}
RewardVideo type advertisement¶
This is a reward-based advertisement that provides rewards for viewing for a certain period of time. Only one advertisement can be loaded at a time.
// RewardVideo Instance Create
var rewardVideo:RewardVideo? = nil
rewardVideo = RewardVideo.initialize(vc: self, adUnitId: rewardVideoUnitId, eventHandler: self)
// RewardVideo Load
rewardVideo?.LoadAd(adPlacementInfo: "Native-RewardVideo-Load")
// RewardVideo Show
rewardVideo?.Show(adPlacementInfo: "Native-RewardVideo-Show")
You can deliver including ad position data. It passes the string set at the time of Load
success and the time it will be displayed through Show
.
Interstitial type advertisement¶
This is a full-screen advertisement.
// Interstitial Instance Create
var interstitialAd:Interstitial? = nil
interstitialAd = Interstitial.initialize(vc: self, adUnitId: InterstitialAdUnitId, eventHandler: self)
// Interstitial Load
interstitialAd?.LoadAd(adPlacementInfo: "Native-Interstitial-Load")
// Interstitial Show
interstitialAd?.Show(adPlacementInfo: "Native-Interstitial-Show")
You can deliver including advertising location data. It passes the string set at the time of Load
success and the time it will be displayed through Show
.
Adaptive Banner Type Advertisement¶
It is a rolling banner that occupies part of the screen. You can adjust the banner position by entering the BannerPosition value or a specific yPos value. When adjusting the banner position by entering the yPos value, the banner position moves up by the specified yPos value from the Bottom alignment state.
// Create AdaptiveBanner Instance
var adaptiveBanner:AdaptiveBanner? = nil
// Initialize AdaptiveBanner Instance at the Top of View
adaptiveBanner = AdaptiveBanner.initialize(vc: self, adUnitId: AdaptiveBannerAdUnitId, bannerPosition: BannerPosition.Top, eventHandler: self)
// Initialize AdaptiveBanner Instance at the Bottom of View
adaptiveBanner = AdaptiveBanner.initialize(vc: self, adUnitId: AdaptiveBannerAdUnitId, bannerPosition: BannerPosition.Bottom, eventHandler: self)
// Load AdaptiveBanner
adaptiveBanner?.LoadAd(adPlacementInfo: "Native-AdaptiveBanner-Load")
// Destroy AdaptiveBanner
adaptiveBanner?.Destroy()
// yPos 값을 지정하여 사용하는 예제입니다.
// Banner Instance Create
var adaptiveBanner: AdaptiveBanner? = null
adaptiveBanner = AdaptiveBanner.initialize(vc: self, adUnitId: AdaptiveBannerAdUnitId, yPos: yPos, eventHandler: self)
// Load AdaptiveBanner
adaptiveBanner?.LoadAd(adPlacementInfo: "Native-AdaptiveBanner-Load")
// yPos값에 따라 위치 변경
adaptiveBanner?.setPosition(yPosition:yPos)
You can include advertising location data when delivering. It passes the string set at the time of Load
success and the time it will be displayed through Show
.
AppOpen Type Ads¶
This is an app open ad that displays ads when the app state changes from background to foreground.
// Create AppOpenAd Instance
var appOpen: AppOpen? = nil
appOpen = AppOpen.initialize(vc: self, adUnitId: AppOpenAdUnitId, eventHandler: self, adPlacementInfo: "Native-AppOpen-LoadInfo")
// Automatically load & show AppOpenAd when the app comes to the foreground
appOpen?.LoadAd(adPlacementInfo: "Native-AppOpen-LoadInfo")
// Destroy AppOpenAd
appOpen?.Destroy()
Test Advertisement¶
During development, it is important to set it up so that clicking on test ads does not incur costs to the advertisers. If you click on ads excessively while not in test mode, your account may be reported for invalid activity, and ad serving may be blocked. You can find information on how to use test ads on the Google Developers site.