Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

해당 문서는 BuzzAd Nuclues Ext.point SDK의 광고 지면 타입 중 하나인, Interstitial Type 을 연동하는 문서입니다. Interstitial Type 은 기존의 지면으로 부터 자유롭게, 지면 위에 광고를 노출할 수 있습니다. Bottom sheet, Dialog 등의 방식으로 사용할 수 있습니다.

...


구현 편의를 위해 제공하는 형태로 커스터마이징이 제한적이기 때문에 조금 더 자유로운 구현을 원하시는 경우, Native Type 을 이용해야 합니다.

다음 과정이 완료 되었는지 확인이 필요합니다.

  •  Android X 환경이 준비 완료 되었는지 (링크)
  •  공통 적용 항목 연동이 완료 되었는지 (링크)

위의 과정 중 완료되지 않은 항목이 있다면, 이전 단계의 연동을 먼저 완료해야 합니다.

...

연동하기

1. 기본 설정을 적용하여 구현하기

InterstitialAdHandler 설정하기

[1] InterstitialAdHandler를 생성한 뒤, 발급받은 Unit Id 를 설정합니다. Dialog 또는 Bottomsheet을 사용할 수 있습니다. (InterstitialAdHandler.Type.Dialog, InterstitialAdHandler.Type.BottomSheet)

...

Code Block
languagejava
// 예시에 적힌 "Interstitial_Unit_Id" 를 '버즈빌에서 발급한 Unit Id'로 교체해 주세요.
final InterstitialAdHandler interstitialAdHandler = new InterstitialAdHandlerFactory()
        .create("Interstitial_Unit_Id", InterstitialAdHandler.Type.Dialog);
        
interstitialAdHandler.show(MainActivity.this);


...

연동하기

2. 추가 설정, 기능을 적용하기

다음 항목에 대한 확인이 필요합니다.

  •  연동하기 - [1. 기본 설정을 적용하여 구현하기] 를 통해 기본 값으로 구현을 완료한 광고 지면에서 정상적으로 광고를 확인하고 참여할 수 있는지 확인

디자인 커스터마이즈 - Interstitial Ad Config 설정

Interstitial 의 디자인을 변경할 수 있습니다. 설정된 InterstitialAdConfig는 interstitialAdHandler.show()를 호출할 때 넣어서 호출합니다. (아래의 제공 항목을 벗어나는 수정은 어렵습니다.)

...

Code Block
languagejava
InterstitialAdConfig interstitialAdConfig = 
                new InterstitialAdConfig.Builder()
                        .topIcon(R.drawable.bz_ic_checked_circle)
                        .titleText("지금 바로 참여하고 포인트 받기")
                        .textColor(android.R.color.white)
                        .layoutBackgroundColor(R.color.colorPrimaryDark)
                        .ctaViewBackgroundColorList(getBackgroundColorStateList())
                        .ctaRewardDrawable(R.drawable.bz_ic_custom_reward)
                        .ctaParticipatedDrawable(R.drawable.bz_ic_btn_more)
                        .ctaViewTextColor(getTextColorStateList())
                        .closeText("닫기")
                        .build();
final InterstitialAdHandler interstitialAdHandler = new InterstitialAdHandlerFactory()
                        .create("YOUR_INTERSTITIAL_UNIT_ID", InterstitialAdHandler.Type.Dialog);
interstitialAdHandler.show(MainActivity.this, interstitialAdConfig);

private ColorStateList getBackgroundColorStateList() {
    final int[][] states = new int[][]{
            new int[]{android.R.attr.state_enabled},  // enabled
            new int[]{android.R.attr.state_pressed}   // pressed
    };

    final int[] colors = new int[]{
            ContextCompat.getColor(this, android.R.color.holo_green_light),
            ContextCompat.getColor(this, android.R.color.holo_green_dark)
    };

    return new ColorStateList(states, colors);
}

private ColorStateList getTextColorStateList() {
    int[][] states = new int[][]{
            new int[]{android.R.attr.state_enabled},  // enabled
            new int[]{android.R.attr.state_pressed}   // pressed
    };

    int[] colors = new int[]{
            Color.WHITE,
            Color.WHITE
    };

    return new ColorStateList(states, colors);
}

여러 개의 광고 로드하기 - Bottom Sheet 전용

InterstitialAdConfig를 사용하여, Bottom Sheet 에서는 여러개의 광고를 로드할 수 있습니다.

  • adCount : 한번에 요청하는 광고의 개수, 최대 5 까지 가능합니다. 기본 값은 5로 설정되어 있습니다.

광고 로드 결과에 대한 리스너 등록

광고가 로드에 실패한 경우에 대해 리스너를 등록할 수 있습니다.

...