handleEventForNimbus

fun AdManagerAdView.handleEventForNimbus(name: String, info: String): Boolean

App Event handler for the Nimbus SDK for com.google.android.gms.ads.admanager.AdManagerAdView and com.google.android.gms.ads.AdView.

This function is designed to work in conjunction with an existing app event listener attached to the AdView and should be added to all AdViews that may render a Nimbus ad.

Example usage:

AdManagerAdView(context).apply {
setAppEventListener { s, s2 ->
if (handleEventForNimbus(name = s, info = s2)) return@setAppEventListener

TODO("Event was not meant for Nimbus")
}
}

Return

true if the event was for the Nimbus SDK.

Parameters

name

the event name

info

the event payload


fun <T : InterstitialAd> T.handleEventForNimbus(name: String, info: String): Boolean

App Event handler for the Nimbus SDK for com.google.android.gms.ads.admanager.AdManagerInterstitialAd and com.google.android.gms.ads.interstitial.InterstitialAd.

This function is designed to work in conjunction with an existing app event listener attached to the InterstitialAd and should be added to all Interstitials that may render a Nimbus ad.

Example usage:

AdManagerInterstitialAd.load(context, "placement_id", AdManagerAdRequest.Builder().build(),
object : AdManagerInterstitialAdLoadCallback() {
override fun onAdLoaded(interstitialAd: AdManagerInterstitialAd) {
interstitialAd.setAppEventListener { s, s2 ->
if (handleEventForNimbus(name = s, info = s2)) return@setAppEventListener

TODO("Event was not meant for Nimbus")
}
interstitialAd.show(activity)
}

override fun onAdFailedToLoad(p0: LoadAdError) { TODO("Handle Error") }
}
)

Return

true if the event was for the Nimbus SDK.

Parameters

name

the event name

info

the event payload