광고 포맷
라이트 팝업 광고
라이트 팝업 형태 소개
- 위와 같은 팝업 형태로 뜨는 광고 유형입니다.
- 8초 후에 자동으로 닫히게 됩니다. 인터스티셜이나, 네이티브보다 ux를 해치지 않고 광고를 보여줄 수 있습니다.
- 라이트 팝업 광고는
1.0.8
버전부터 지원합니다.
광고 단위 설정
Copy
Ask AI
extension DaroMAdUnit {
static let lightPopup = DaroMAdUnit(
adUnitID: "...",
format: .lightPopup
)
}
라이트 팝업 광고 구현
Copy
Ask AI
import Daro
final class SampleVC: UIViewController {
var lightPopupAd: DaroLightPopupAd?
func loadLightPopupAd() {
Task {
var config = DaroAdLightPopupConfiguration()
self.lightPopupAd = try await DaroLightPopupAd.load(adUnit: .lightPopup, configuration: config)
}
}
func showInterstitialAd() {
lightPopupAd?.fullScreenDelegate = self
guard lightPopupAd?.canPresent(from: self) == true else { return }
lightPopupAd?.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)")
}
}
광고 커스터마이징 하기
DaroAdLightPopupConfiguration
를 사용해서 라이트 팝업의 색상, 버튼 텍스트 등 다양한 UI 요소를 커스터마이징할 수 있습니다.
Copy
Ask AI
let config = DaroAdLightPopupConfiguration()
config.backgroundColor = .systemBackground // 배경색
config.cardViewBackgroundColor = .systemBackground // 광고 컨텐츠 배경색
config.adMarkLabelTextColor = .label // 광고 마크 레이블 텍스트 색상
config.adMarkLabelBackgroundColor = UIColor.secondarySystemBackground.withAlphaComponent(0.32) // 광고 마크 레이블 배경색
config.closeButtonText = "닫기" // 닫기 버튼 텍스트
config.closeButtonTextColor = .label // 닫기 버튼 텍스트 색상
config.titleTextColor = .label // 타이틀 텍스트 색상
config.bodyTextColor = .label // 본문 텍스트 색상
config.ctaTextColor = .label // CTA 텍스트 색상
config.ctaBackgroundColor = UIColor.secondarySystemBackground.withAlphaComponent(0.0) // CTA 배경색
DaroLightPopupAd.load(adUnit: .lightPopup, configuration: config)
On this page
Assistant
Responses are generated using AI and may contain mistakes.