Show Sidebar

Ad Events

Ads have events which are exposed to the developer using callbacks, for eg. a rewarded video ad gives a onAdMediaStart callback when the ad media starts, hence this is an indicative for the developer to pause all the media being played in the background etc.

onAdReady(string response)

This callback is received when Ad is ready to render state. You can split the response string with the delimiter ‘|’ to obtain request-code and ad-State respectively.

onAdError(string response)
This callback is received when the SDK fails to fetch/render an ad. You can split the response string with the delimiter ‘|’ to obtain request-code, error code, error title and error description respectively.
Below are the possible values for the error code.

1001 – ERROR_NOFILL
1002 – ERROR_ADREQUEST_NOT_ALLOWED
1003 – ERROR_MANIFEST_ENTRY_MISSING
1004 – ERROR_TIMEOUT
1005 – ERROR_INTERNAL_SERVER
1006 – ERROR_SDK_INITIALIZATION
1007 – ERROR_MISMATCHUX_OR_MARKUP
1008 – ERROR_NETWORK_ERROR
1009 – ERROR_MANDATORY_PARAM_MISSING
1010 – ERROR_RENDITION_ERROR
1011 – ERROR_PARSING
1012 – ERROR_UNKNOWN
1013 – ERROR_INVALID_REQUEST_ARGUMENTS
1014 – ERROR_AD_EXPIRED

onAdClose(string requestCode)
This callback is received when ad is closed for full-screen ads. You are expected to resume your application animation loops/in-game sounds etc. It is recommended to cache next ad after this event.

onAdView(string requestCode)
This callback is received when ad enters or exits the viewport i.e ad is visible to the user or not.

onAdClick(string requestCode)
This callback is received when the ad is clicked. This will cause your app to go in pause state.

onAdRefresh(string requestCode)
This callback is applicable only for ad formats banner/billboard/native where SDK is managing refresh cycle. It will be triggered for every subsequent ad rotated inside ad-space.

onAdSkippable(string requestCode)
It will be triggered after a particular interval after which the next ad request can be made.

Note: Below callback is applicable only for the ads that has associated media(audio/video)

onAdMediaStart(string requestCode)
It will be triggered when media starts playing.

onAdMediaEnd(string response)
It will be triggered when media ends playing. You can split the response string with the delimiter ‘|’ to obtain request-Code, a boolean value indicating weather media on the Ad is completed or not and the reward that needs to be gratified respectively.

onAdMediaExpand(string requestCode)
It will be triggered when media on a billboard ad is expanded to full-screen view.

onAdMediaCollapse(string requestCode)
It will be triggered when media on a billboard ad is brought back to normal view from full-screen view.