광고 포맷
인터스티셜 광고
광고 포맷
인터스티셜 광고
DARO를 통해 인터스티셜 광고를 구현하는 방법을 알아봅니다.
인터스티셜 형태 소개
- 화면 전체를 덮는 형태로 노출되는 광고입니다.
- 이미지/동영상 모두 포함되나 동영상 소재가 더 많이 노출되며 일반적으로 5초 후부터 스킵이 가능합니다.
광고 단위 설정
대시보드에서 발급받은 ad unit ID
를 사용하여 광고 단위를 설정하세요.
extension DaroAdInterstitialUnit {
static let betaUnit = DaroAdInterstitialUnit(id: "ca-app-pub-...")
}
인터스티셜 광고 구현
import Daro
final class SampleVC: UIViewController {
var interstitialAd: DaroInterstitialAd?
func loadInterstitialAd() {
Task {
self.interstitialAd = try await DaroInterstitialAd.load(adUnit: .interstitial)
}
}
func showInterstitialAd() {
interstitialAd?.fullScreenDelegate = self
guard interstitialAd?.canPresent(from: self) == true else { return }
interstitialAd?.present(fromRootViewController: self)
}
}
extension SampleVC: DaroFullScreenAdDelegate {
func didFailToPresent(with error: Error) {
print("\(#function) error: \(error.localizedDescription)")
}
func willPresentFullScreenContent() {
print("\(#function)")
}
func willDismissFullScreenContent() {
print("\(#function)")
}
func didDismissFullScreenContent() {
print("\(#function)")
}
func didRecordImpression() {
print("\(#function)")
}
func didRecordClick() {
print("\(#function)")
}
}
On this page