Getting Started

Integrating BuzzAdPop SDK for Android

The below items are necessary to proceed with the integration:

  • Request the following to Buzzvil's BD manager

    • app_id

    • unit_id

  • Provide your postback url to Buzzvil's BD manager

    • Postback API document (link)

Prerequisites

  • Android Studio 3.2 or higher

  • minSdkVersion 15 or higher

  • compileSdkVersion 29 or higher

 

Index


Step 1: Installation

BuzzAdPop is distributed as part of the BuzzAdBenefit SDK.

Add the dependencies in build.gradle

 

repositories { maven { url "https://dl.buzzvil.com/public/maven" } } dependencies { implementation "com.buzzvil:buzzad-benefit-pop:1.7.0" }

 

If BuzzAd Benefit was already integrated, remove the following code from build.gradle.

 

exclude group: 'com.buzzvil', module: 'buzzad-benefit-pop'

 

Step 2: Initialization

As BuzzAdPop is distributed as part of the BuzzAdBenefit SDK, BuzzAd Pop is initialized via BuzzAd Benefit.. BuzzAd Pop can be initialized by calling BuzzAdBenefit.init() with configurations that includes unit_id, app_id and more (See Initializing Pop for more details). The initialization needed only once when running the app. The code below is an example of initializing BuzzAd Pop from Application class.

 

package ... import ... import com.buzzvil.buzzad.benefit.BuzzAdBenefit; import com.buzzvil.buzzad.benefit.BuzzAdBenefitConfig; import com.buzzvil.buzzad.benefit.presentation.pop.PopConfig; public class App extends Application { @Override public void onCreate() { super.onCreate(); final PopConfig popConfig = new PopConfig.Builder("POP_UNIT_ID_HERE") .build(); final BuzzAdBenefitConfig buzzAdBenefitConfig = new BuzzAdBenefitConfig.Builder("BENEFIT_APP_ID_HERE") .add("POP_UNIT_ID_HERE", popConfig) .build(); BuzzAdBenefit.init(this, buzzAdBenefitConfig); } }

 

Step 3: Setting the UserProfile

User ID and targeting information (gender, birth year) is necessary for the proper functioning of BuzzAd Benefit. Ads are served only after the setUserProfile method is called.

Please set the UserProfile at the user login.

  • userId : A unique identifier assigned to each user

    • Please consult with the BD manager if there is a possibility of userId changing.

    • e.g.: userId changes when a user reinstalls the app after deletion

  • gender

    • UserProfile.Gender.MALE

    • UserProfile.Gender.FEMALE

  • birthYear

 

 

Please set UserProfile to null upon logging out.

 

 

Step 4: Setting the Permission

For proper functioning of BuzzAd Pop, Draw Over Other Apps permission is necessary. This requires the user to enable the permission for the app integrating BuzzAd Pop. BuzzAd Pop provides facile methods to gain the permission from users.

 

  1. Add BuzzAdPop class as a variable to the Activity that will set the permission for BuzzAd Pop.

     

  2. Create an instance of BuzzAdPop using the unit_id of the BuzzAd Pop in onCreate of the Activity.

     

  3. The below is the code to request the permission from users.

     

  4. The user will return to their original Activity once the permission is enabled in Settings. The value passed via Intent provides information on whether the permission has been granted or not.

     

Step 5. Activation

Call buzzAdPop.showPop() to activate BuzzAd Pop. Once activated, the foreground service will start running and BuzzAd Pop will be displayed continuously whenever the screen is turned on. For effective operation call BuzzAdPop.showPop() with the ad preloaded.

 

 

UI Customization

Changing CTA color and incorporating features like MessagePreview can be done via UI Customization.

Additional Resource

Sample app for BuzzAd Pop (GitHub)