Requesting Banner Ads – Android Unity Plugin

Maaf, entri ini hanya tersedia dalam bahasa English. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language.

Note: For Banner Ads, please ensure that you have turned off the refresh from the mediation partner’s web interface when using a fresh integration of VMAX SDK 3.4.0 or higher. This change in settings is not required when updating from an earlier version to 3.4.0 or higher.

To request for a Banner Ad

SDK 3.6.0 onwards

Construct an object of the Class VmaxPlugin and pass the adspotId , uxType as the parameter into the constructor.

load():ThisApi will fetch ad andshow at the position you have specified insetPosition()api

Callbacks

SDK 3.6.0 onwards

1

2

3

4

5

6

7

8

9

publicvoidonAdError(stringrequestCode){}

publicvoidonAdReady(stringrequestCode){}

publicvoidonAdInteracted(stringrequestCode){}

publicvoidonAdEnd(stringrequestCode){}

publicvoidonAdExpand(stringrequestCode){}

publicvoidonAdCollapsed(stringrequestCode){}

publicvoidonAdDismissed(stringrequestCode){}

publicvoidonAdLeftApplication(stringrequestCode){}

publicvoidonAdStarted(stringrequestCode){}

Before SDK 3.6.0

1

2

3

4

5

6

7

8

9

10

11

publicvoiddidFailedToLoadAd(stringrequestCode){}

publicvoiddidFailedToCacheAd(stringrequestCode){}

publicvoidadViewDidLoadAd(stringrequestCode){}

publicvoidadViewDidCacheAd(stringrequestCode){}

publicvoiddidInteractWithAd(stringrequestCode){}

publicvoidonVideoView(stringrequestCode){}

publicvoidonAdExpand(stringrequestCode){}

publicvoidonAdCollapsed(stringrequestCode){}

publicvoidwillDismissAd(stringrequestCode){}

publicvoidwillLeaveApp(stringrequestCode){}

publicvoidwillPresentAd(stringrequestCode){}

Note: Ensure that you handle the lifecycle of VmaxPlugin

1

2

3

4

5

6

7

8

9

10

voidOnApplicationPause(boolpauseStatus){

if(pauseStatus){

vmaxPluginBanner.onPause();

}else{

vmaxPluginBanner.onResume();

}

}

voidOnApplicationQuit(){

vmaxPluginBanner.onDestroy();

}

Show/Hide Banner Ads

You can show/hide banners using showBanner() and hideBanner() APIs.

1

2

vmaxPluginBanner.hideBanner();// to hide the banner ad if shown

vmaxPluginBanner.showBanner();// to show the banner ad if hidden

Managing Refresh Rate for Banner Ads

You can manage the the frequency at which the Banner Ads are refreshed using the setRefreshRate() method. The minimum Ad Refresh rate is 30 seconds; setting a lower value will default to 30 seconds.
Here is the example to setRefreshRate():

1

vmaxPluginBanner.setRefreshRate(45);// parameter is 45 second passed to it.

To set Demographic parameters using VMAX API use below mentioned APIs.

1

2

3

4

5

6

7

8

9

10

11

setAge(intage)// set the age

setRefresh(boolrefresh)// set Refresh

setTimeOut(inttimeOutSeconds)// set the timeout

setRefreshRate(intrefreshRate)// set Refresh Rate

setCity(stringcity)// set the user City

setGender(stringgender)// set the user Gender

setEmail(StringemailId)// set the user email

setLoginId(stringloginId)// to set user Login Id

setSection(stringsection)// set the user section

setKeyword(Stringkeyword)// set the search keyword for targeting Ads

setAdViewBackgroundColor(Stringcolor)// specify the background color of Adview. By deafult transparent for banners and black for interstitial.