# Rewarded

## Integración

Para hacer uso de los anuncios recompensados, 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 recompensado:

```csharp
// Se crea un anuncio recompensado
WortiseRewarded rewardedAd = new WortiseRewarded(
    "Ad Unit ID de Wortise"
);

// Se solicita la carga de un anuncio
rewardedAd.LoadAd();

// Se muestra el anuncio si está disponible
if (rewardedAd.IsAvailable) {
    rewardedAd.ShowAd();
}
```

## **Configuración de listeners**

Se pueden añadir listeners para recibir los diferentes eventos que sucedan durante el ciclo de vida del recompensado. Para ello, puede hacer uso de los siguientes atributos disponibles en la clase `WortiseRewarded`:

* `OnClicked`
* `OnCompleted`
* `OnDismissed`
* `OnFailedToLoad`
* `OnFailedToShow`
* `OnImpression`
* `OnLoaded`
* `OnRevenuePaid`
* `OnShown`

### Ejemplo

```csharp
rewardedAd.OnClicked      += () => Debug.Log('Rewarded clicked');
rewardedAd.OnCompleted    += (reward) => Debug.Log('Rewarded completed');
rewardedAd.OnDismissed    += () => Debug.Log('Rewarded dismissed');
rewardedAd.OnFailedToLoad += () => Debug.Log('Rewarded failed to load');
rewardedAd.OnFailedToShow += () => Debug.Log('Rewarded failed to show');
rewardedAd.OnImpression.  += () => Debug.Log('Rewarded impression');
rewardedAd.OnLoaded       += () => Debug.Log('Rewarded loaded');
rewardedAd.OnRevenuePaid  += (data) => Debug.Log('Rewarded revenue paid');
rewardedAd.OnShown        += () => Debug.Log('Rewarded 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/unity-sdk/integracion-del-sdk/rewarded.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.
