Interstitial νμ
BuzzAd-Benefit SDK: Type C - Interstitial
λ³Έ κ°μ΄λλ BuzzAd-Benefit SDKμ Interstitial νμ κ΄κ³ λ₯Ό μ°λνλ λ°©λ²μ λ€λ£¨λ λ¬Έμμ λλ€.
β» μ£Όμμ¬ν
Interstitial νμ μ μ°λνκΈ° μ ,Β κ³΅ν΅ κ°μ΄λμ μ°λ μ¬νμ λͺ¨λ μ μ©νλμ§ νμΈν΄μ£ΌμΈμ.
β» μ°Έκ³ μ¬ν
Interstitial νμ μΒ λ€μ΄ν°λΈ νμ Β λ°©μμ νμ©ν΄μ 맀체μ¬κ° μ체μ μΌλ‘ ꡬννμ€ μ μκΈ°λ νλ, 맀체μ¬μ ꡬν νΈμμ±μ μνμ¬ BuzzAd-Benefit SDK λ΄μλ 미리 ꡬνμ ν΄ λμ κΈ°λ₯μ λλ€. λ°λΌμ Customizationμ΄ κ°λ₯ν μμμ΄ μ νμ μ΄κΈ° λλ¬Έμ μ‘°κΈ λ μμ λ‘μ΄ κ΅¬νμ μνμλ κ²½μ°Β λ€μ΄ν°λΈ νμ Β λ°©μμ μ΄μ©ν΄ μ£Όμλ©΄ κ°μ¬νκ² μ΅λλ€.
Β
Index
Β
Basic Usage
InterstitialAdHandler
Β μ€μ
Interstitial unit_idμ InterstitialAdHandlerμ type (Dialog λλ Bottomsheet, μμΈν λ΄μ©μ μλ μ°Έμ‘°)μ μ¬μ©νμ¬Β
InterstitialAdHandler
λ₯Ό μμ±ν©λλ€.interstitialAdHandler.show(κ΄κ³ κ°_λ ΈμΆλ _Activity.this)
λ₯Ό νΈμΆνμ¬ κ΄κ³ λ₯Ό νΈμΆν©λλ€.final InterstitialAdHandler interstitialAdHandler = new InterstitialAdHandlerFactory() .create("YOUR_INTERSTITIAL_UNIT_ID", InterstitialAdHandler.Type.Dialog); interstitialAdHandler.show(MainActivity.this);
Interstitial Type
Β μ€μ
Interstitial κ΄κ³ type μ€ Dialogμ BottomSheetμ μ 곡ν©λλ€. μμμ InterstitialAdHandler μ€μ μ μνμλ TypeμΌλ‘ κ°κ°Β InterstitialAdHandler.Type.Dialog
Β λλΒ InterstitialAdHandler.Type.BottomSheet
μΌλ‘ μ€μ νμλ©΄ λ©λλ€.
Bottom sheet
Β
Dialog
Β
Β
Advanced Usage
InterstitialAdConfig
μ μ€μ
Interstitial κ΄κ³ μ λμμΈ μμ λ° κ΄κ³ μμ² κ°μμ λν΄μ 맀체μ¬μμ Customize ν μ μλλ‘ μ§μνκ³ μμ΅λλ€. μ€μ λΒ InterstitialAdConfig
λΒ interstitialAdHandler.show()
λ₯Ό νΈμΆν λ λ£μ΄μ νΈμΆν©λλ€.
κ³΅ν΅ Config
topIcon
Β : Interstitial κ΄κ³ μλ¨μ μλ μμ΄μ½ (μνμ½λμ²λΌ drawableμ idλ‘ μ§μ νκ±°λ drawable typeμΌλ‘ μ§μ κ°λ₯)titleText
Β : Interstitial κ΄κ³ μλ¨μ μλ TexttextColor
Β : titleTextμ μκΉlayoutBackgroundColor
Β : Interstitial κ΄κ³ μ 체μ λ°°κ²½ μκΉctaViewBackgroundColorList
Β : CTAμ λ°°κ²½ μκΉctaRewardDrawable
Β : CTAμ ν¬ν¨λ κΈ°λ³Έ μμ΄μ½ (μνμ½λμ²λΌ drawableμ idλ‘ μ§μ νκ±°λ drawable typeμΌλ‘ μ§μ κ°λ₯)ctaParticipatedDrawable
Β : κ΄κ³ μ°Έμ¬ μλ£ ν 보μ¬μ£Όλ CTAμ ν¬ν¨λ μμ΄μ½ (μνμ½λμ²λΌ drawableμ idλ‘ μ§μ νκ±°λ drawable typeμΌλ‘ μ§μ κ°λ₯)ctaViewTextColor
Β : CTAμ Text μκΉ
Dialog μ μ©
closeText
Β : λ«κΈ° λ²νΌμ Text
Bottom Sheet μ μ©
adCount
Β : νλ²μ μμ²νλ κ΄κ³ μ κ°μ. 1 ~ 5κ° κ°λ₯νλ©°, adCountλ₯Ό μ§μ νμ§ μκ±°λ 1 ~ 5 μΈμ λ²μλ₯Ό μ§μ ν κ²½μ° 5λ‘ κ³ μ λ¨
Β
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);
}
κ΄κ³ λ‘λ κ²°κ³Όμ λν 리μ€λ λ±λ‘
κ΄κ³ κ° λ‘λμ μ€ν¨ν κ²½μ°μ λν΄ λ¦¬μ€λλ₯Ό λ±λ‘ν μ μμ΅λλ€.
Β
interstitialAdHandler.show(MainActivity.this, interstitialAdConfig, new InterstitialAdHandler.OnInterstitialAdEventListener() {
@Override
public void onAdLoadFailed(AdError error) {
// λ‘λ μ€ν¨μ. errorλ₯Ό ν΅ν΄ λ‘λ μ€ν¨ μ΄μ λ₯Ό μ μ μμ
}
@Override
public void onAdLoaded() {
// λ‘λ μ±κ³΅μ
}
});