# Interstitial

## Integración

A continuación se muestra un sencillo ejemplo para entender el funcionamiento de los intersticiales:

```dart
import 'package:wortise/interstitial_ad.dart';

InterstitialAd _interstitialAd;

// Se crea un intersticial
_interstitialAd = InterstitialAd('Ad Unit ID de Wortise', listener: (event, args) {
  // Este listener será invocado cuando se produzca algún evento
});

// Se solicita la carga de un anuncio
await _interstitialAd.loadAd();

/* ... */

// Se muestra el anuncio si está disponible
if (await _interstitialAd.isAvailable) {
  await _interstitialAd.showAd();
}
```

El constructor de la clase `InterstitialAd` admite un tercer parámetro, llamado `reloadOnDismissed`, que al establecerse a `true` (el valor por defecto es `false`) permite que el interstitial cargue automáticamente un nuevo anuncio cuando se finalice de mostrar el actual.

## **Eventos del listener**

El listener asignado a un `InterstitialAd` puede recibir los siguientes eventos:

```dart
// El anuncio ha sido clickeado
InterstitialAdEvent.CLICKED
// El anuncio ha sido cerrado
InterstitialAdEvent.DISMISSED
// El anuncio no se ha podido cargar
InterstitialAdEvent.FAILED_TO_LOAD
// El anuncio no se ha podido mostrar
InterstitialAdEvent.FAILED_TO_SHOW
// El anuncio ha generado una impresión
InterstitialAdEvent.IMPRESSION
// El anuncio ha sido cargado
InterstitialAdEvent.LOADED
// El anuncio ha generado un ingreso
InterstitialAdEvent.REVENUE_PAID
// El anuncio ha sido mostrado
InterstitialAdEvent.SHOWN
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wortise.com/flutter-sdk/integracion-del-sdk/interstitial.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
