/
(Android v3.0.x) 4. Interstitial 마이그레이션 가이드

(Android v3.0.x) 4. Interstitial 마이그레이션 가이드

주요 변경 내역

BuzzAd Android용 SDK 3.0부터 Interstitial 광고 지면 상단의 제목 표시줄 영역을 제거하여 더욱 광고에 집중할 수 있도록 변경되었습니다.

 

Interstitial 기본 설정

광고 할당 및 표시하기

Interstitial 지면에 광고를 할당받기 위해 사용했던 InterstitialAdHandler 클래스는 더 이상 지원하지 않습니다.

BuzzAd Android용 SDK 3.0에서 Interstitial 광고 할당 및 표시하려면 BuzzAdInterstitial를 사용하여 아래 순서대로 구현하세요.

  1. 기존에 사용했던 InterstitialAdHandler 관련 코드를 삭제하세요.

    // TODO: 아래 코드를 모두 삭제합니다. final InterstitialAdHandler interstitialAdHandler = new InterstitialAdHandlerFactory() .create("YOUR_INTERSTITIAL_UNIT_ID", InterstitialAdHandler.Type.Dialog); interstitialAdHandler.show(context);
  2. 기존에 사용했던 Interstitial 지면의 Unit ID로 BuzzAdInterstitial을 생성하세요.

  3. Interstitial UI 타입에 따라 적절한 메소드를 호출하세요.

    • 다이얼로그 UI: BuzzAdInterstitial.Builder().buildDialog()를 호출하세요.

    • 바텀 시트 UI: BuzzAdInterstitial.Builder().buildBottomSheet()를 호출하세요.

  4. load()를 호출하여 광고를 할당받으세요.

  5. show(context)를 호출하여 광고를 표시하세요.

// Interstitial 지면의 UNIT ID로 BuzzAdNative 객체를 생성합니다. final BuzzAdInterstitial buzzAdInterstitial = new BuzzAdInterstitial.Builder("YOUR_INTERSTITIAL_UNIT_ID") .buildDialog(); // 이 예시에서는 다이얼로그 UI로 설정했습니다. // 광고를 할당 받습니다. buzzAdInterstitial.load(new InterstitialAdListener() { @Override public void onAdLoaded() { // 할당된 광고가 있으면 호출됩니다. // Interstitial 광고를 화면에 표시합니다. buzzAdInterstitial.show(context); } @Override public void onAdLoadFailed(@Nullable AdError adError) { // 할당된 광고가 없으면 호출됩니다. Log.e(TAG, "Failed to load a native ad.", adError); } @Override public void onAdClosed() { super.onAdClosed(); // Interstitial 지면이 종료되면 호출됩니다. // 필요에 따라 추가 기능을 구현하세요. } });

Interstitial 고급 설정 / 디자인 커스터마이징

광고 개수 설정하기

바텀 시트 형태의 Interstitial 지면에서 한 번에 요청할 광고 개수 설정 방법이 변경되었습니다.

  1. 기존에 사용했던 InterstitialAdConfig 구문은 삭제하세요.

    // TODO: 아래 코드를 모두 삭제합니다. InterstitialAdConfig interstitialAdConfig = new InterstitialAdConfig.Builder() .adCount(3) // 1 ~ 5 .build(); interstitialAdHandler.show(context, interstitialAdConfig);
  2. 원하는 광고 개수를 버즈빌 담당자에게 전달하세요.

 

배경 및 텍스트 색상 변경

Interstitial 광고의 배경 및 텍스트 색상을 설정하는 InterstitialAdConfig는 더 이상 지원하지 않습니다.

BuzzAd Android용 SDK 3.0에서 BuzzAdInterstitialTheme를 사용하여 아래 순서대로 구현하세요.

  1. Interstitial 광고의 디자인 커스터마이징할 수 있는 BuzzAdInterstitialTheme 객체를 생성하세요.

  2. 변경하고자 하는 색상 타입에 따라 적절한 메소드를 호출하세요.

    1. textColor : Interstitial 광고 타이틀, 설명 문구의 색상

    2. backgroundColor : Interstitial 광고 지면의 배경 색상

  3. BuzzAdInterstitial.theme()에 위에서 설정한 BuzzAdInterstitialTheme 객체를 설정하세요.

    // TODO: Interstitial 광고의 디자인 커스터마이징할 수 있는 BuzzAdInterstitialTheme 객체를 생성합니다. final BuzzAdInterstitialTheme theme = BuzzAdInterstitialTheme .getDefault() .textColor(R.color.your_text_color) // 광고 타이틀, 설명 문구 색상 .backgroundColor(R.color.your_background_color); // 광고 지면 배경 색상 final BuzzAdInterstitial buzzAdInterstitial = new BuzzAdInterstitial.Builder("YOUR_INTERSTITIAL_UNIT_ID") .theme(theme) // TODO: 위에서 생성한 Theme 객체를 설정합니다. .buildDialog();
  4. 코드 중복을 위해, 기존에 사용했던 InterstitialAdConfig 관련 코드를 삭제하세요.

    // TODO: 아래 코드를 삭제하세요. InterstitialAdConfig interstitialAdConfig = new InterstitialAdConfig.Builder() .textColor(android.R.color.your_color) .layoutBackgroundColor(R.color.your_color) .build(); final InterstitialAdHandler interstitialAdHandler = new InterstitialAdHandlerFactory() .create("YOUR_INTERSTITIAL_UNIT_ID", InterstitialAdHandler.Type.Dialog); interstitialAdHandler.show(context, interstitialAdConfig);

     

CTA 버튼 디자인 변경하기

BuzzAd Android용 SDK 3.0에서 제공하는 CTA 버튼의 디자인을 변경할 수 있습니다.

CTA 버튼 디자인을 변경하려면 GlobalTheme을 설정해 앱에 연동된 모든 유형의 지면의 CTA 버튼 디자인을 변경하거나, 각 지면에서 개별적으로 변경해야 합니다.

또는 GlobalTheme을 설정한 후에 각 지면의 CTA 버튼 디자인을 개별적으로 변경할 수 있습니다. 앱에 연동한 모든 지면의 디자인을 효율적인 관리를 위해, 버즈빌은 GlobalTheme을 설정한 후에 각 지면의 CTA 버튼 디자인을 개별적으로 변경하는 방법을 권장합니다. 자세한 내용은 CTA 버튼 커스터마이징하기 토픽을 참고하세요.

final BuzzAdInterstitialTheme theme = BuzzAdInterstitialTheme .getDefault() .ctaBackgroundSelector(R.color.your_background_color) // CTA 버튼 배경 .ctaTextColorSelector(R.color.your_text_color) // CTA 텍스트 색상 .ctaTextSize(R.dimen.your_cta_text_size) // CTA 텍스트 크기 .rewardIcon(R.drawable.your_reward_icon) // CTA 리워드 아이콘 .participatedIcon(R.drawable.ic_participated); // 참여 완료 후 CTA 리워드 아이콘 final BuzzAdInterstitial buzzAdInterstitial = new BuzzAdInterstitial.Builder("YOUR_INTERSTITIAL_UNIT_ID") .theme(theme) .buildDialog();

 

API 변경 내역

InterstitialAdConfig.Builder 속성

2.x

3.0

설명

2.x

3.0

설명

ctaViewBackgroundColorList

BuzzAdInterstitialTheme.ctaBackgroundSelector()

BuzzvilTheme 혹은 BuzzAdInterstitialTheme 을 통해 제어하도록 변경됨

ctaViewTextColor

BuzzAdInterstitialTheme.ctaTextColorSelector()

BuzzvilTheme 혹은 BuzzAdInterstitialTheme 을 통해 제어하도록 변경됨

ctaRewardDrawable

BuzzAdInterstitialTheme.rewardIcon()

BuzzvilTheme 혹은 BuzzAdInterstitialTheme 을 통해 제어하도록 변경됨

ctaParticipatedDrawable

BuzzAdInterstitialTheme.participatedIcon()

BuzzvilTheme 혹은 BuzzAdInterstitialTheme 을 통해 제어하도록 변경됨

textColor

BuzzAdInterstitialTheme.textColor()

BuzzAdInterstitialTheme 을 통해 제어하도록 변경됨

layoutBackgroundColor

BuzzAdInterstitialTheme.backgroundColor()

BuzzAdInterstitialTheme 을 통해 제어하도록 변경됨

showInquiryButton

BuzzAdInterstitial.Builder.inquiryButtonEnabled()

 

navigateCommand

BuzzAdInterstitial.Builder.buzzAdNavigator()

 

topIcon

-

해당하는 UI가 삭제됨

titleText

-

해당하는 UI가 삭제됨

adCount

-

각 유닛의 설정에서 제어하도록 변경됨

closeText

-

Deprecated API가 삭제됨

feedUnitId

-

Deprecated API가 삭제됨

Related content