# GoogleMobileAds.Api.InterstitialAdPreloader

The preloader for interstitial ads.

## Summary

| ### Public static functions ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/interstitial-ad-preloader#class_google_mobile_ads_1_1_api_1_1_interstitial_ad_preloader_1a87bea4a7a96c87ccd7a310c5ab815233(string preloadId)` | `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/interstitial-ad#class_google_mobile_ads_1_1_api_1_1_interstitial_ad` Returns a preloaded ad and removes it from the cache. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/interstitial-ad-preloader#class_google_mobile_ads_1_1_api_1_1_interstitial_ad_preloader_1a80d8bcf012fbbda0413ff099fe211ecb(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/interstitial-ad-preloader#class_google_mobile_ads_1_1_api_1_1_interstitial_ad_preloader_1a7d3ed73d7dad66b914ea0c626de35e64()` | `void` Stops preloading and destroys preloaded ads for all preload configurations. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/interstitial-ad-preloader#class_google_mobile_ads_1_1_api_1_1_interstitial_ad_preloader_1a9c59cdde46c06cc39243bcab687dcf50(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/interstitial-ad-preloader#class_google_mobile_ads_1_1_api_1_1_interstitial_ad_preloader_1a5691a2f90db9c0f649d5771cd49673f6()` | `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/interstitial-ad-preloader#class_google_mobile_ads_1_1_api_1_1_interstitial_ad_preloader_1a01cb66bd81de4ec27dc2f5a12341db81(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/interstitial-ad-preloader#class_google_mobile_ads_1_1_api_1_1_interstitial_ad_preloader_1adb1733dc4f6012e5a2c3aae9d461febd(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/interstitial-ad-preloader#class_google_mobile_ads_1_1_api_1_1_interstitial_ad_preloader_1abe37e83dc7a640d5e0e7f4ab04c23642(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/interstitial-ad-preloader#class_google_mobile_ads_1_1_api_1_1_interstitial_ad_preloader_1a4599baaecee57052050b689414ab972e(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#
InterstitialAd 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.

### 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.