스플래시 광고
최초 실행되는 액티비티에 NestAds의 NestAdsSplashAdView 를 세팅하여 스플래시 광고를 표시하는 가이드입니다.
기본 요건
시작 가이드에 따라 필요한 과정을 완료합니다.
테스트 광고 게재위치
Placement Code(게재위치 코드)는 어드민의 인벤토리 > 게재위치 메뉴에서 게재위치를 등록 시 시스템을 통해 자동으로 생성됩니다.
테스트 게재위치 목록
placementCode
설명
SAMPLE_SPLASH
360x256 이미지 + 애드뱃지
광고 표시하기
activity_splash.xml를 설정해줍니다.
NestAdsSplashAdView 의 자세한 내용은 여기를 참고해주세요.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--가운데에 로고 이미지 설정-->
<ImageView
android:id="@+id/nestads_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/nestads_logo"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<!--하단에 NestAdsSplashAdView 설정-->
<com.nestads.sdk.ads.splash.NestAdsSplashAdView
android:id="@+id/nestads_splash_ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>SplashActivity를 구현합니다.
크게 1) SDK 초기화 , 2) NestAdsSplashAdView 설정, 3) 광고 리스너 설정, 4) 광고 요청 의 단계로 진행됩니다.
AndroidManifest.xml에서SplashActivity를 최초 화면으로 넣어줍니다.
광고 리스너
NestAdsSplashAdView 에서 지원하는 광고 리스너는 다음을 참고하세요.
1) 광고 요청에 성공한 경우 아래의 순서로 불립니다.
2) 광고 요청에 실패한 경우 아래의 순서로 불립니다.
Last updated