Interstitial
Integración
Para hacer uso de los anuncios intersticiales, es necesario solicitar su carga en algún momento de la app, siendo recomendable hacerlo lo más pronto posible.
A continuación, se muestra un ejemplo de como cargar y mostrar un anuncio intersticial:
// Se crea un intersticial
WortiseInterstitial interstitialAd = new WortiseInterstitial(
"Ad Unit ID de Wortise"
);
// Se solicita la carga de un anuncio
interstitialAd.LoadAd();
// Se muestra el anuncio si está disponible
if (interstitialAd.IsAvailable) {
interstitialAd.ShowAd();
}
Configuración de listeners
Se pueden añadir listeners para recibir los diferentes eventos que sucedan durante el ciclo de vida del intersticial. Para ello, puede hacer uso de los siguientes atributos disponibles en la clase WortiseInterstitial
:
OnClicked
OnDismissed
OnFailedToLoad
OnFailedToShow
OnImpression
OnLoaded
OnRevenuePaid
OnShown
Ejemplo
interstitialAd.OnClicked += () => Debug.Log('Interstitial clicked');
interstitialAd.OnDismissed += () => Debug.Log('Interstitial dismissed');
interstitialAd.OnFailedToLoad += () => Debug.Log('Interstitial failed to load');
interstitialAd.OnFailedToShow += () => Debug.Log('Interstitial failed to show');
interstitialAd.OnImpression. += () => Debug.Log('Interstitial impression');
interstitialAd.OnLoaded += () => Debug.Log('Interstitial loaded');
interstitialAd.OnRevenuePaid += (data) => Debug.Log('Interstitial revenue paid');
interstitialAd.OnShown += () => Debug.Log('Interstitial shown');
Última actualización