Skip to content
:docs

User experience features

Learn how to implement additional user experience features after integrating the Buzzvil SDK.

Configure the dark theme

Buzzvil SDK automatically applies dark theme according to your app's theme setting.

Disable dark theme in your app

Set your app to always use light theme in onCreate of Application.

Kotlin
class MyApplication : Application {
    override fun onCreate() {
        super.onCreate()
       
        // 아래 코드 추가
        AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
    }
}

Add user support for action-based ads

The Buzzvil SDK provides action-based ads that reward users for actions such as watching videos, installing apps, and liking Facebook pages. If a user completes an action-based ad but does not receive points, the SDK provides a service that automates the submission and handling of support requests (VOC). Follow these steps to add VOC support.

  1. Design a UI element (an icon or tab) that opens the VOC support page.

  2. Call BuzzAdBenefit.getInstance().showInquiryPage(Context, YOUR_UNIT_ID) when the user clicks the UI you designed in step 1.

  • The YOUR_UNIT_ID argument is required. Use the Unit ID for the relevant placement.

Change video ad playback conditions

By default, video ads autoplay only on Wi-Fi. Choose one of the following playback settings.

  • Autoplay only on Wi-Fi (default).
  • Always autoplay, regardless of connection type.
  • Never autoplay, regardless of connection type.

Use the following example to change video ad autoplay conditions.

Kotlin
import com.buzzvil.buzzad.benefit.BuzzAdBenefit
import com.buzzvil.buzzad.benefit.core.models.AutoplayType
import com.buzzvil.buzzad.benefit.core.models.UserPreferences

val userPreferences = UserPreferences.Builder(BuzzAdBenefit.getUserPreferences())
    .autoplayType(AutoplayType.ON_WIFI)
    // .autoplayType(AutoplayType.DISABLED) // 동영상 광고를 자동으로 재생하지 않습니다.
    // .autoplayType(AutoplayType.ENABLED) //  동영상 광고를 항상 자동재생합니다.
    .build()
BuzzAdBenefit.setUserPreferences(userPreferences)

Check the ad type

Use the functions in NativeAd or NativeAd2 to identify ad types in BenefitHub or Native.

The following ad type functions are available in NativeAd or NativeAd2.

FunctionDescriptionReturn value
NativeAd.revenueType or NativeAd2.revenueTypeReturns revenueType as a string.
  • cpinsta: Awards points for following an Instagram account.
  • cpa: Awards points for completing a specific action, such as signing up or requesting an insurance quote.
  • cpe: Awards points for installing and launching an app.
  • cpi: Awards points for installing an app.
  • cpl: Awards points for following a Facebook account.
  • cps: Awards points for completing a purchase.
  • cpyoutube: Awards points for subscribing to a YouTube channel.
  • cpylike: Awards points for subscribing to a YouTube channel and liking a video.
  • cptiktok: Awards points for following a TikTok account.
  • cpnstore: Awards points for favoriting a Naver Smart Store.
  • cpq, cpqlite, cpcquiz: Awards points for answering a quiz correctly.
  • cpk: Awards points for adding a Kakao page.
  • cpc: Awards points for clicking through to the advertiser's page.
  • cpm: The advertiser pays for every 1,000 ad impressions.
  • cpv: Awards points for watching a video to completion.
  • -cps: Includes all ads except cps ads.
  • |

    The following example checks the ad type in NativeAd when configuring BenefitHub ad UI.

    Kotlin
    import com.buzzvil.buzzad.benefit.feed.benefithub.list.adapter.BenefitHubAdViewAdapter
    import com.buzzvil.buzzad.benefit.presentation.nativead.NativeAd
    import com.buzzvil.buzzad.benefit.presentation.nativead.NativeAdView
    
    class CustomBenefitHubAdViewAdapter : BenefitHubAdViewAdapter {
        override fun getNativeAdView(): NativeAdView {}
    
        override fun onBindView(nativeAd: NativeAd) {
            val revenueType = nativeAd.revenueType
    
            if (revenueType == "cpa") {
                // 액션형 광고일 때 동작
            }
        }
    
        override fun onCreateView(context: Context, parent: ViewGroup): View {}
    
        override fun onDestroyView() {}
    }
    

    The following example checks the ad type in NativeAd2 during Native integration.

    Kotlin
    import com.buzzvil.buzzad.benefit.feed.benefithub.list.adapter.BenefitHubAdViewAdapter
    import com.buzzvil.buzzad.benefit.nativead2.api.NativeAd2
    import com.buzzvil.buzzad.benefit.nativead2.api.NativeAd2StateChangedListener
    
    nativeAd2ViewBinder.addNativeAd2StateChangedListener(object : NativeAd2StateChangedListener {
        override fun onComplete() {}
    
        override fun onError(adError: AdError) {}
    
        override fun onNext(nativeAd2: NativeAd2) {
            val revenueType = nativeAd.revenueType
    
            if (revenueType == "cpa") {
                // 액션형 광고일 때 동작
            }
        }
    
        override fun onRequested() {}
    })