# GoogleMobileAds.Api.MobileAds

Contains logic that applies to the Google Mobile Ads SDK as a whole.

## Summary

| ### Properties ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1ac336c4e4c7a0e079f57887ae5be5d4e3` | `static https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads` The `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads` static instance. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1a933f0522dcfc8ce146c63a4c28125864` | `static bool` Determines whether ad events raised by the Google Mobile Ads Unity plugin should be invoked on the Unity main thread. |

| ### Public static functions ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1a65ad3d0d9e2f508a0d7e99a860252059()` | `void` Call before MobileAds.Initialize(Action{InitializationStatus}) to disable mediation adapter initialization. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1a77feaf02330ebcd3437eb77b3b37e949()` | `void` Disables automated SDK crash reporting on iOS. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1a979adcc7f61caf4bdf3d50af3eb0630e()` | `Version` Gets the underlying Google Mobile Ads Android or iOS SDK version for the active platform. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1ac0de94c64e94ed660eb5f47ad0822ef1()` | `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/request-configuration#class_google_mobile_ads_1_1_api_1_1_request_configuration` Gets the global [RequestConfiguration](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/request-configuration#class_google_mobile_ads_1_1_api_1_1_request_configuration). |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1a822c4a00ced0478772f5465ebbf31b86()` | `Version` Gets the Google Mobile Ads Unity SDK version. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1a35cfaf166969e9caeca3b43eb7968a4f(Action< https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/initialization-status#class_google_mobile_ads_1_1_api_1_1_initialization_status > initCompleteAction)` | `void` Initializes the Google Mobile Ads SDK. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1af3ef95944838c1b65a404839226e7c8e(Action< https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-inspector-error#class_google_mobile_ads_1_1_api_1_1_ad_inspector_error > adInspectorClosedAction)` | `void` Opens ad inspector UI. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1adf8d1792c811e154e86c1827a667259b(List< 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 > configurations, Action< 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 > onAdAvailable, Action< 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 > onAdsExhausted)` | `void` Preloads ads for the given configurations. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1a1054aaee87c3f72b3d0f428b7dd55845(bool muted)` | `void` Sets whether the app's audio is muted. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1aa641e39012d2ecb90ae401299a5d2d44(float volume)` | `void` Sets the app's audio volume. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1a6bede723fff4ce9b21c8ff32ec3324f5(https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/request-configuration#class_google_mobile_ads_1_1_api_1_1_request_configuration requestConfiguration)` | `void` Sets the global [RequestConfiguration](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/request-configuration#class_google_mobile_ads_1_1_api_1_1_request_configuration) that is used for every [AdRequest](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-request#class_google_mobile_ads_1_1_api_1_1_ad_request) during the app's session. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads_1a944f80e92035e3619507c30ac6c1d5b6(bool pause)` | `void` Indicates if the Unity app should be paused when a full-screen ad is displayed. |

| ### Classes ||
|---|---|
| [GoogleMobileAds.Api.MobileAds.Utils](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads/utils) | Contains methods for returning the device scale and safe width. |

## Properties

### Instance

```c#
static MobileAds Instance
```
The `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/mobile-ads#class_google_mobile_ads_1_1_api_1_1_mobile_ads` static instance.

### RaiseAdEventsOnUnityMainThread

```c#
static bool RaiseAdEventsOnUnityMainThread
```
Determines whether ad events raised by the Google Mobile Ads Unity plugin should be invoked on the Unity main thread.

The default value is false.

## Public static functions

### DisableMediationInitialization

```c#
void DisableMediationInitialization()
```
Call before MobileAds.Initialize(Action{InitializationStatus}) to disable mediation adapter initialization.

Warning: Calling this method might negatively impact your mediation performance. This method should only be called if you include mediation adapters in your app, but you don't plan on using Google mediation during this app session (for example, you are running an A/B test).

### DisableSDKCrashReporting

```c#
void DisableSDKCrashReporting()
```
Disables automated SDK crash reporting on iOS.

Call this method closer to the app start.

### GetPlatformVersion

```c#
Version GetPlatformVersion()
```
Gets the underlying Google Mobile Ads Android or iOS SDK version for the active platform.

When running on the Unity editor, this method returns the Google Mobile Ads Unity SDK version.

<br />

| Details ||
|---|---|
| **Returns** | The Google Mobile Ads Android or iOS SDK version for the platform the app is running on. |

### GetRequestConfiguration

```c#
RequestConfiguration GetRequestConfiguration()
```
Gets the global [RequestConfiguration](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/request-configuration#class_google_mobile_ads_1_1_api_1_1_request_configuration).

<br />

| Details ||
|---|---|
| **Returns** | The global configuration that is used for every [AdRequest](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-request#class_google_mobile_ads_1_1_api_1_1_ad_request). |

### GetVersion

```c#
Version GetVersion()
```
Gets the Google Mobile Ads Unity SDK version.

<br />

| Details ||
|---|---|
| **Returns** | The Google Mobile Ads Unity SDK version. |

### Initialize

```c#
void Initialize(
  Action< InitializationStatus > initCompleteAction
)
```
Initializes the Google Mobile Ads SDK.

Call this method before loading an ad and before interacting with the rest of the Google Mobile Ads SDK.

<br />

Details Parameters `initCompleteAction` An action which is invoked after initialization is complete. Includes the `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/initialization-status#class_google_mobile_ads_1_1_api_1_1_initialization_status` of the SDK as a parameter.

### OpenAdInspector

```c#
void OpenAdInspector(
  Action< AdInspectorError > adInspectorClosedAction
)
```
Opens ad inspector UI.

<br />

Details Parameters `adInspectorClosedAction` Called when ad inspector UI closes.

### Preload

```c#
void Preload(
  List< PreloadConfiguration > configurations,
  Action< PreloadConfiguration > onAdAvailable,
  Action< PreloadConfiguration > onAdsExhausted
)
```
Preloads ads for the given configurations.

<br />

Details Parameters `configurations` The configurations to preload ads. `onAdAvailable` Called when an ad becomes available for the configuration. `onAdsExhausted` Called when the last available ad is exhausted for the configuration.

### SetApplicationMuted

```c#
void SetApplicationMuted(
  bool muted
)
```
Sets whether the app's audio is muted.

Affects initial mute state for all ads.

Warning: Muting your app reduces video ad eligibility and might reduce your app's ad revenue. Use this API only if your app provides a custom mute control and reflects the user's mute decision through the API.

<br />

Details Parameters `muted` True if the app is muted, false otherwise. Defaults to false.

### SetApplicationVolume

```c#
void SetApplicationVolume(
  float volume
)
```
Sets the app's audio volume.

Affects audio volumes of all ads relative to other audio output.

Warning: Lowering your app's audio volume reduces video ad eligibility and might reduce your app's ad revenue. Use this API only if your app provides custom volume control and reflects the user's volume choice through the API.

<br />

Details Parameters `volume` The volume as a float from 0 (muted) to 1.0 (full media volume). Defaults to 1.0.

### SetRequestConfiguration

```c#
void SetRequestConfiguration(
  RequestConfiguration requestConfiguration
)
```
Sets the global [RequestConfiguration](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/request-configuration#class_google_mobile_ads_1_1_api_1_1_request_configuration) that is used for every [AdRequest](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-request#class_google_mobile_ads_1_1_api_1_1_ad_request) during the app's session.

<br />

Details Parameters `requestConfiguration` The global configuration that is used for every [AdRequest](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-request#class_google_mobile_ads_1_1_api_1_1_ad_request).

### SetiOSAppPauseOnBackground

```c#
void SetiOSAppPauseOnBackground(
  bool pause
)
```
Indicates if the Unity app should be paused when a full-screen ad is displayed.

On Android, Unity is paused when displaying full-screen ads. Calling this method with `true` duplicates this behavior on iOS.

<br />

Details Parameters `pause` True if iOS should pause the app when backgrounded. Default is false.