# GoogleMobileAds.Api.AppOpenAdPreloader

The preloader for app open ads.

## Summary

| ### Public static functions ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/app-open-ad-preloader#class_google_mobile_ads_1_1_api_1_1_app_open_ad_preloader_1af1dc95aa52cb6e24193c9933caf05400(string preloadId)` | `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/app-open-ad#class_google_mobile_ads_1_1_api_1_1_app_open_ad` Returns a preloaded ad and removes it from the cache. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/app-open-ad-preloader#class_google_mobile_ads_1_1_api_1_1_app_open_ad_preloader_1afa95254eb5864a16819fa4318a89ee6b(string preloadId)` | `void` Stops preloading for the given `preloadId` and destroys all associated preloaded ads. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/app-open-ad-preloader#class_google_mobile_ads_1_1_api_1_1_app_open_ad_preloader_1a80922cb9099151548ff5671e71bfa823()` | `void` Stops preloading and destroys preloaded ads for all preload configurations. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/app-open-ad-preloader#class_google_mobile_ads_1_1_api_1_1_app_open_ad_preloader_1aca3141f95e0d1fbf96a6b64e7162c3a2(string preloadId)` | `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/preload-configuration#class_google_mobile_ads_1_1_api_1_1_preload_configuration` Get the AppOpen ad [PreloadConfiguration](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/preload-configuration#class_google_mobile_ads_1_1_api_1_1_preload_configuration) associated with the given preload ID, or null if one does not exist. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/app-open-ad-preloader#class_google_mobile_ads_1_1_api_1_1_app_open_ad_preloader_1a083ced53c889e3c3a1f46c793167a97b()` | `Dictionary< string, https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/preload-configuration#class_google_mobile_ads_1_1_api_1_1_preload_configuration >` Get a dictionary of all AppOpen ad PreloadConfigurations, keyed by their associated preload ID, or an empty dictionary if no preloaders exist. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/app-open-ad-preloader#class_google_mobile_ads_1_1_api_1_1_app_open_ad_preloader_1a8bc18c57f4b9cf82de18c7f6b371534e(string preloadId)` | `int` Get the number of ads available for the given preload ID. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/app-open-ad-preloader#class_google_mobile_ads_1_1_api_1_1_app_open_ad_preloader_1a5c2afdb074c871490cea03bbc95059c0(string preloadId)` | `bool` Determines whether at least one ad is available for the given `preloadId`. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/app-open-ad-preloader#class_google_mobile_ads_1_1_api_1_1_app_open_ad_preloader_1a8f1c392c2295c27705cda5f0835928ea(string preloadId)` | `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/response-info#class_google_mobile_ads_1_1_api_1_1_response_info` Returns the [ResponseInfo](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/response-info#class_google_mobile_ads_1_1_api_1_1_response_info) of a preloaded ad for the given preload ID without dequeuing it, or null if no ad is available. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/app-open-ad-preloader#class_google_mobile_ads_1_1_api_1_1_app_open_ad_preloader_1a3f9e049a46a991283a4bf82f8736c4ae(string preloadId, https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/preload-configuration#class_google_mobile_ads_1_1_api_1_1_preload_configuration preloadConfiguration, Action< string, https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/response-info#class_google_mobile_ads_1_1_api_1_1_response_info > onAdPreloaded, Action< string, https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-error#class_google_mobile_ads_1_1_api_1_1_ad_error > onAdFailedToPreload, Action< string > onAdsExhausted)` | `bool` Starts preloading app open ads from the configuration for the given preload ID. |

## Public static functions

### DequeueAd

```c#
AppOpenAd DequeueAd(
  string preloadId
)
```
Returns a preloaded ad and removes it from the cache.

<br />

Details Parameters `preloadId` A string identifier used to preload the ads for that configuration. **Returns** The preloaded ad for the given preload ID, or null if no ad is available.

The ad returned may be any of the ads preloaded for `preloadId`. The order returned is not guaranteed to match the order of `OnAdAvailable` events.

### Destroy

```c#
void Destroy(
  string preloadId
)
```
Stops preloading for the given `preloadId` and destroys all associated preloaded ads.

<br />

Details Parameters `preloadId` The preload ID to stop preloading for. **Returns** True if an active preload configuration was destroyed; `false` if there is no active preload configuration for the given `preloadId`.

### DestroyAll

```c#
void DestroyAll()
```
Stops preloading and destroys preloaded ads for all preload configurations.

### GetConfiguration

```c#
PreloadConfiguration GetConfiguration(
  string preloadId
)
```
Get the AppOpen ad [PreloadConfiguration](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/preload-configuration#class_google_mobile_ads_1_1_api_1_1_preload_configuration) associated with the given preload ID, or null if one does not exist.

### GetConfigurations

```c#
Dictionary< string, PreloadConfiguration > GetConfigurations()
```
Get a dictionary of all AppOpen ad PreloadConfigurations, keyed by their associated preload ID, or an empty dictionary if no preloaders exist.

### GetNumAdsAvailable

```c#
int GetNumAdsAvailable(
  string preloadId
)
```
Get the number of ads available for the given preload ID.

<br />

Details Parameters `preloadId` The preload ID to check for available ads. **Returns** The number of ads available for the given preload ID.

### IsAdAvailable

```c#
bool IsAdAvailable(
  string preloadId
)
```
Determines whether at least one ad is available for the given `preloadId`.

<br />

Details Parameters `preloadId` The preload ID to check for availability. **Returns** True if there is an ad available for the given preload ID.

### PeekAdResponseInfo

```c#
ResponseInfo PeekAdResponseInfo(
  string preloadId
)
```
Returns the [ResponseInfo](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/response-info#class_google_mobile_ads_1_1_api_1_1_response_info) of a preloaded ad for the given preload ID without dequeuing it, or null if no ad is available.

<br />

Details Parameters `preloadId` A string identifier used to preload the ads for that configuration. **Returns** The [ResponseInfo](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/response-info#class_google_mobile_ads_1_1_api_1_1_response_info) of the preloaded ad for the given preload ID, or null if no ad is available.

### Preload

```c#
bool Preload(
  string preloadId,
  PreloadConfiguration preloadConfiguration,
  Action< string, ResponseInfo > onAdPreloaded,
  Action< string, AdError > onAdFailedToPreload,
  Action< string > onAdsExhausted
)
```
Starts preloading app open ads from the configuration for the given preload ID.

<br />

Details Parameters `preloadId` A string that uniquely identifies the `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/preload-configuration#class_google_mobile_ads_1_1_api_1_1_preload_configuration`. Use this identifier when calling `DequeueAd` to retrieve a preloaded ad for this configuration. `preloadConfiguration` The configuration that dictates how ads are preloaded. `onAdPreloaded` Called when a new ad is available for the given preload ID. `onAdFailedToPreload` Called when an ad failed to load for a given preload ID. `onAdsExhausted` Called when the last available ad is exhausted for the given preload ID. **Returns** False if preloading fails to start.