# firebase::gma

API for Google Mobile Ads with Firebase.

## Summary

The GMA API allows you to load and display mobile ads using the Google Mobile Ads SDK. Each ad format has its own header file.


**[Deprecated.](https://developers.google.com/admob/cpp/reference/deprecated/deprecated)**
**The Google Mobile Ads (GMA) C++ SDK is *deprecated* as of June 17, 2024 and should not be adopted in projects that don't already use it. It will enter *End-of-Maintenance (EoM)* on June 17, 2025. Note that versions of the SDK released before the EoM date will continue to function, but no further bug fixes or changes will be released after the EoM date.**

Instead of the Google Mobile Ads C++ SDK, consider using the [iOS](https://developers.google.com/docs/admob/ios/quick-start) and [Android](https://developers.google.com/docs/admob/android/quick-start) SDKs from AdMob. For support, reach out to the [Google Mobile Ads SDK Technical Forum](https://groups.google.com/g/google-admob-ads-sdk).

| ### Enumerations ||
|---|---|
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14{ https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a0ba0e33d712bb2a75f829d5f3df1706b, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14ae90077a56d597ebc392a1a63acc754b5, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14aa5fe95a2ac2a2620e9bc625a7c55b14c, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14ab9360a80bd77cfa5758057af6cd32eda, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a9e0a77bbaae434b94066af9d8562a52f, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a7968d215e60533f6465b40512e1cb9eb, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14ada32e2568986f02e0be721e4623beb21, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a0b42cfacfcdc60595fd32f1c3604f9ec, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a4d01d6deb18ee1aa2e9484767b91292c, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a7be1648c6bb67f6100d369fd47a1dcaa, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a353b5ce7ddbbdfd63cfd422964175b49, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14aa316486e03920fcc9197cab9904708d9, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14af0dcba2278710fd87c2edae912cec9bd, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14af5f96aa6e6c6e6b63ef0de4637eee32e, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a340510234e828912d58d16f62a46372b, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a8d2f772a946cdc7101aba4a608f684c0, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a2814bf3c32554adfabc72cf2ea31b50f, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a2a0f07c345fe24fb465963cab42964cd, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a2b8b2f12fd88c64a833426b7940a4f00, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a5ca0e40bda0b6a4530f18d55578dac6d, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a3cf4e2b0d26cea4dd331fe4d7f3bccb3, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14ab6458089e95f54ba6f759a0c9fe508e7, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14af52c6d6448ad765e43902f5b0eefdd7c, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14af385c10f0994e158e22706ff802e9bae, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a4d7aa27b8df041fcb11aa97d5941eeaf, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a05f30a4554ffad600427e41b93375d3a, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14ad2ed29cacae375fd52c06f0040d3ba67, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a0122b4f1672284559b4df015ba25413c, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a42fc54c8d9a5d227b4fd63d7d016337c, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14acda1a353d93a0d2650b39c7688517e74, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a25576de86fb9dfa2cef9f8492ada86dc, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a7db4f12fef04563f080a490f340e3d1e, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a0284f100f37ace3ef11ecd9a82804999, https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14a396dfc0a98f58ca71f59e5727a1ecffb }` | enumError codes returned by Future::error(). |

| ### Typedefs ||
|---|---|
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a1ed4b6a8f045afeb8aea12e47884ca9c` | typedef `void *` This is a platform specific datatype that is required to create a Google Mobile Ads ad. |

| ### Functions ||
|---|---|
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ae6cf4b463938ccfd3a7e924f15f14e36()` | `void` Disables mediation adapter initialization on iOS during initialization of the GMA SDK. |
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a7ad7ebfc8a0b1dfb5f0ffce4fe3a496b()` | `void` Disables automated SDK crash reporting on iOS. |
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a4c0dcbd90f0cb5510570e573efb71339()` | `https://developers.google.com/admob/cpp/reference/class/firebase/gma/adapter-initialization-status#classfirebase_1_1gma_1_1_adapter_initialization_status` Get the current adapter initialization status. |
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a72ef8ede39f74145327a02c4fd56a0d1()` | `https://developers.google.com/admob/cpp/reference/struct/firebase/gma/request-configuration#structfirebase_1_1gma_1_1_request_configuration` Gets the global [RequestConfiguration](https://developers.google.com/admob/cpp/reference/struct/firebase/gma/request-configuration#structfirebase_1_1gma_1_1_request_configuration). |
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a83cdc25dbc94f86347d97c4fc21afe61(const ::https://developers.google.com/admob/cpp/reference/class/firebase/app#classfirebase_1_1_app & app, InitResult *init_result_out)` | `https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future< https://developers.google.com/admob/cpp/reference/class/firebase/gma/adapter-initialization-status#classfirebase_1_1gma_1_1_adapter_initialization_status >` **[Deprecated.](https://developers.google.com/admob/cpp/reference/deprecated/deprecated)** The Google Mobile Ads C++ SDK is now deprecated. Please see the [SDK reference documentation](https://developers.google.com/admob/cpp/reference/namespace/firebase/gma) for more information. Initializes Google Mobile Ads (GMA) via Firebase. |
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a4da65155fe0530819922194746ab1d3a(JNIEnv *jni_env, jobject activity, InitResult *init_result_out)` | `https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future< https://developers.google.com/admob/cpp/reference/class/firebase/gma/adapter-initialization-status#classfirebase_1_1gma_1_1_adapter_initialization_status >` **[Deprecated.](https://developers.google.com/admob/cpp/reference/deprecated/deprecated)** The Google Mobile Ads C++ SDK is now deprecated. Please see <https://developers.google.com/admob/cpp/reference/namespace/firebase/gma> for more information. Initializes Google Mobile Ads (GMA) without Firebase for Android. |
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ab99627e36ca1f0aacdab666a4845042b(InitResult *init_result_out)` | `https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future< https://developers.google.com/admob/cpp/reference/class/firebase/gma/adapter-initialization-status#classfirebase_1_1gma_1_1_adapter_initialization_status >` **[Deprecated.](https://developers.google.com/admob/cpp/reference/deprecated/deprecated)** The Google Mobile Ads C++ SDK is now deprecated. Please see <https://developers.google.com/admob/cpp/reference/namespace/firebase/gma> for more information. Initializes Google Mobile Ads (GMA) without Firebase for iOS. |
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a106abcafafc86a2d21dcf91e21e5e1bb()` | `https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future< https://developers.google.com/admob/cpp/reference/class/firebase/gma/adapter-initialization-status#classfirebase_1_1gma_1_1_adapter_initialization_status >` Get the [Future](https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future) returned by a previous call to [firebase::gma::Initialize()](https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a83cdc25dbc94f86347d97c4fc21afe61). |
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a2421a15a8f6e072312c6362413f1a799(https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a1ed4b6a8f045afeb8aea12e47884ca9c parent, https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-inspector-closed-listener#classfirebase_1_1gma_1_1_ad_inspector_closed_listener *listener)` | `void` Opens the ad inspector UI. |
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ab2354558afd680d5a30d80ad9ab52760(bool is_enabled)` | `void` Controls whether the Google Mobile Ads SDK Same [App](https://developers.google.com/admob/cpp/reference/class/firebase/app#classfirebase_1_1_app) Key is enabled. |
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1add5fc03e6d996ce57faeeabd16d86d6f(const https://developers.google.com/admob/cpp/reference/struct/firebase/gma/request-configuration#structfirebase_1_1gma_1_1_request_configuration & request_configuration)` | `void` Sets the global [RequestConfiguration](https://developers.google.com/admob/cpp/reference/struct/firebase/gma/request-configuration#structfirebase_1_1gma_1_1_request_configuration) that will be used for every [AdRequest](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-request#classfirebase_1_1gma_1_1_ad_request) during the app's session. |
| `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a6380ae0bed055cbf130a8c40dda5d91e()` | `void` Terminate GMA. |

| ### Classes ||
|---|---|
| [firebase::gma::AdError](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error) | Information about why an ad operation failed. |
| [firebase::gma::AdInspectorClosedListener](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-inspector-closed-listener) | Listener to be invoked when the Ad Inspector has been closed. |
| [firebase::gma::AdListener](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-listener) | A listener for receiving notifications during the lifecycle of a BannerAd. |
| [firebase::gma::AdRequest](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-request) | Contains targeting information used to fetch an ad. |
| [firebase::gma::AdResult](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-result) | Information about the result of an ad operation. |
| [firebase::gma::AdReward](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-reward) | Describes a reward credited to a user for interacting with a [RewardedAd](https://developers.google.com/admob/cpp/reference/class/firebase/gma/rewarded-ad#classfirebase_1_1gma_1_1_rewarded_ad). |
| [firebase::gma::AdSize](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-size) | The size of a banner ad. |
| [firebase::gma::AdValue](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-value) | The monetary value earned from an ad. |
| [firebase::gma::AdView](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-view) | Loads and displays Google Mobile Ads [AdView](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-view#classfirebase_1_1gma_1_1_ad_view) ads. |
| [firebase::gma::AdViewBoundingBoxListener](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-view-bounding-box-listener) | A listener class that developers can extend and pass to an [AdView](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-view#classfirebase_1_1gma_1_1_ad_view) object's [AdView::SetBoundingBoxListener](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-view#classfirebase_1_1gma_1_1_ad_view_1acb82158262dd0edd340383ba184c1a94) method to be notified of changes to the size of the Ad's bounding box. |
| [firebase::gma::AdapterInitializationStatus](https://developers.google.com/admob/cpp/reference/class/firebase/gma/adapter-initialization-status) | An immutable snapshot of the GMA SDK's initialization status, categorized by mediation adapter. |
| [firebase::gma::AdapterResponseInfo](https://developers.google.com/admob/cpp/reference/class/firebase/gma/adapter-response-info) | Response information for an individual ad network contained within a [ResponseInfo](https://developers.google.com/admob/cpp/reference/class/firebase/gma/response-info#classfirebase_1_1gma_1_1_response_info) object. |
| [firebase::gma::AdapterStatus](https://developers.google.com/admob/cpp/reference/class/firebase/gma/adapter-status) | A snapshot of a mediation adapter's initialization status. |
| [firebase::gma::FullScreenContentListener](https://developers.google.com/admob/cpp/reference/class/firebase/gma/full-screen-content-listener) | Listener to be invoked when ads show and dismiss full screen content, such as a fullscreen ad experience or an in-app browser. |
| [firebase::gma::InterstitialAd](https://developers.google.com/admob/cpp/reference/class/firebase/gma/interstitial-ad) | Loads and displays Google Mobile Ads interstitial ads. |
| [firebase::gma::PaidEventListener](https://developers.google.com/admob/cpp/reference/class/firebase/gma/paid-event-listener) | Listener to be invoked when ads have been estimated to earn money. |
| [firebase::gma::ResponseInfo](https://developers.google.com/admob/cpp/reference/class/firebase/gma/response-info) | Information about an ad response. |
| [firebase::gma::RewardedAd](https://developers.google.com/admob/cpp/reference/class/firebase/gma/rewarded-ad) | Loads and displays Google Mobile Ads rewarded ads. |
| [firebase::gma::UserEarnedRewardListener](https://developers.google.com/admob/cpp/reference/class/firebase/gma/user-earned-reward-listener) | Listener to be invoked when the user earned a reward. |

| ### Structs ||
|---|---|
| [firebase::gma::BoundingBox](https://developers.google.com/admob/cpp/reference/struct/firebase/gma/bounding-box) | The screen location and dimensions of an [AdView](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-view#classfirebase_1_1gma_1_1_ad_view) once it has been initialized. |
| [firebase::gma::RequestConfiguration](https://developers.google.com/admob/cpp/reference/struct/firebase/gma/request-configuration) | Global configuration that will be used for every [AdRequest](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-request#classfirebase_1_1gma_1_1_ad_request). |

| ### Namespaces ||
|---|---|
| [firebase::gma::ump](https://developers.google.com/admob/cpp/reference/namespace/firebase/gma/ump) | API for User Messaging Platform. |

## Enumerations

### AdErrorCode

```c++
 AdErrorCode
```
Error codes returned by Future::error().

| Properties ||
|---|---|
| `kAdErrorCodeAdAlreadyUsed` | Will not send request because the ad object has already been used. |
| `kAdErrorCodeAdNetworkClassLoadError` | An attempt to load an Ad Network extras class for an ad request has failed. |
| `kAdErrorCodeAdNotReady` | The ad is not ready to be shown. |
| `kAdErrorCodeAdTooLarge` | Ad is too large for the scene. |
| `kAdErrorCodeAlreadyInitialized` | The ad is already initialized (repeat call). |
| `kAdErrorCodeAppNotInForeground` | The ad can not be shown when app is not in the foreground. |
| `kAdErrorCodeApplicationIdentifierMissing` | Will not send request because the application identifier is missing. |
| `kAdErrorCodeImageUrlMalformed` | Error processing image url. |
| `kAdErrorCodeInsepctorAlreadyOpen` | The request to show the Ad Inspector failed because it's already open. |
| `kAdErrorCodeInspectorFailedToLoad` | An attempt to load the Ad Inspector failed. |
| `kAdErrorCodeInternalError` | A call to load an ad has failed due to an internal SDK error. |
| `kAdErrorCodeInterstitialAlreadyUsed` | Will not send request because the interstitial object has already been used. |
| `kAdErrorCodeInvalidAdString` | Android Ad String is invalid. |
| `kAdErrorCodeInvalidArgument` | Invalid argument error. |
| `kAdErrorCodeInvalidRequest` | A call to load an ad has failed due to an invalid request. |
| `kAdErrorCodeLoadInProgress` | A call has failed because an ad is currently loading. |
| `kAdErrorCodeMediationAdapterError` | Error finding or creating a mediation ad network adapter. |
| `kAdErrorCodeMediationDataError` | The mediation response was invalid. |
| `kAdErrorCodeMediationInvalidAdSize` | Attempting to pass an invalid ad size to an adapter. |
| `kAdErrorCodeMediationNoFill` | A mediation ad network adapter received an ad request, but did not fill. The adapter's error is included as an underlyingError. |
| `kAdErrorCodeMediationShowError` | A mediation adapter failed to show the ad. |
| `kAdErrorCodeNetworkError` | A call to load an ad has failed due to a network error. |
| `kAdErrorCodeNoFill` | A call to load an ad has failed because no ad was available to serve. |
| `kAdErrorCodeNoWindowToken` | An attempt has been made to show an ad on an Android Activity that has no window token (such as one that's not done initializing). |
| `kAdErrorCodeNone` | Call completed successfully. |
| `kAdErrorCodeNotInTestMode` | A debug operation failed because the device is not in test mode. |
| `kAdErrorCodeNotMainThread` | Attempted to present ad from a non-main thread. This is an internal error which should be reported to support if encountered. |
| `kAdErrorCodeOSVersionTooLow` | The current device's OS is below the minimum required version. |
| `kAdErrorCodeReceivedInvalidResponse` | Received invalid response. |
| `kAdErrorCodeRewardedAdAlreadyUsed` | Will not send a request because the rewarded ad object has already been used. |
| `kAdErrorCodeServerError` | The ad server experienced a failure processing the request. |
| `kAdErrorCodeTimeout` | The request was unable to be loaded before being timed out. |
| `kAdErrorCodeUninitialized` | The ad has not been fully initialized. |
| `kAdErrorCodeUnknown` | Fallback error for any unidentified cases. |

## Typedefs

### AdParent

```c++
void * AdParent
```
This is a platform specific datatype that is required to create a Google Mobile Ads ad.

The following defines the datatype on each platform:

- Android: A `jobject` which references an Android Activity.
- iOS: An `id` which references an iOS UIView.

A void pointer for stub classes.

<br />

## Functions

### DisableMediationInitialization

```c++
void DisableMediationInitialization()
```
Disables mediation adapter initialization on iOS during initialization of the GMA SDK.

Calling this method may negatively impact your ad performance and should only be called if you will not use GMA SDK controlled mediation during this app session. This method must be called before initializing the GMA SDK or loading ads and has no effect once the SDK has been initialized.

This method has no effect on Android.

### DisableSDKCrashReporting

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

If not called, the SDK records the original exception handler if available and registers a new exception handler. The new exception handler only reports SDK related exceptions and calls the recorded original exception handler.

This method has no effect on Android.

### GetInitializationStatus

```c++
AdapterInitializationStatus GetInitializationStatus()
```
Get the current adapter initialization status.

You can poll this method to check which adapters have been initialized.

### GetRequestConfiguration

```c++
RequestConfiguration GetRequestConfiguration()
```
Gets the global [RequestConfiguration](https://developers.google.com/admob/cpp/reference/struct/firebase/gma/request-configuration#structfirebase_1_1gma_1_1_request_configuration).


> [!NOTE]
> **Note:** : on iOS, the [RequestConfiguration::tag_for_child_directed_treatment](https://developers.google.com/admob/cpp/reference/struct/firebase/gma/request-configuration#structfirebase_1_1gma_1_1_request_configuration_1a886267aa5db747c816f8441c53179195) and [RequestConfiguration::tag_for_under_age_of_consent](https://developers.google.com/admob/cpp/reference/struct/firebase/gma/request-configuration#structfirebase_1_1gma_1_1_request_configuration_1ae900aeac5dbacbbba0247870ed42a795) fields will be set to [RequestConfiguration.kChildDirectedTreatmentUnspecified](https://developers.google.com/admob/cpp/reference/struct/firebase/gma/request-configuration#structfirebase_1_1gma_1_1_request_configuration_1af443e316d761b48b3a011fc1b0969c50a882437101730928b6dd950c696776e36), and [RequestConfiguration.kUnderAgeOfConsentUnspecified](https://developers.google.com/admob/cpp/reference/struct/firebase/gma/request-configuration#structfirebase_1_1gma_1_1_request_configuration_1a0da2ae73e7c75d8008b3de8a6d05b200aaca4f94a4790e0250786cf25d334db17), respectfully.

<br />

| Details ||
|---|---|
| **Returns** | the currently active [RequestConfiguration](https://developers.google.com/admob/cpp/reference/struct/firebase/gma/request-configuration#structfirebase_1_1gma_1_1_request_configuration) that's being used for every ad request. |

### Initialize

```c++
Future< AdapterInitializationStatus > Initialize(
  const ::firebase::App & app,
  InitResult *init_result_out
)
```
Initializes Google Mobile Ads (GMA) via Firebase.

**[Deprecated.](https://developers.google.com/admob/cpp/reference/deprecated/deprecated)** The Google Mobile Ads C++ SDK is now deprecated. Please see the [SDK reference documentation](https://developers.google.com/admob/cpp/reference/namespace/firebase/gma) for more information.
Details Parameters `app` The Firebase app for which to initialize mobile ads. `init_result_out` Optional: If provided, write the basic init result here. kInitResultSuccess if initialization succeeded, or kInitResultFailedMissingDependency on Android if Google Play services is not available on the current device and the Google Mobile Ads SDK requires Google Play services (for example, when using 'play-services-ads-lite'). Note that this does not include the adapter initialization status, which is returned in the [Future](https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future). **Returns** If init_result_out is kInitResultSuccess, this [Future](https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future) will contain the initialization status of each adapter once initialization is complete. Otherwise, the returned [Future](https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future) will have kFutureStatusInvalid.

### Initialize

```c++
Future< AdapterInitializationStatus > Initialize(
  JNIEnv *jni_env,
  jobject activity,
  InitResult *init_result_out
)
```
Initializes Google Mobile Ads (GMA) without Firebase for Android.

The arguments to [Initialize](https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a83cdc25dbc94f86347d97c4fc21afe61) are platform-specific so the caller must do something like this:

```c++
#if defined(__ANDROID__)
firebase::gma::Initialize(jni_env, activity);
#else
firebase::gma::Initialize();
#endif
```

<br />

**[Deprecated.](https://developers.google.com/admob/cpp/reference/deprecated/deprecated)** The Google Mobile Ads C++ SDK is now deprecated. Please see <https://developers.google.com/admob/cpp/reference/namespace/firebase/gma> for more information.
Details Parameters `jni_env` JNIEnv pointer. `activity` Activity used to start the application. `init_result_out` Optional: If provided, write the basic init result here. kInitResultSuccess if initialization succeeded, or kInitResultFailedMissingDependency on Android if Google Play services is not available on the current device and the Google Mobile Ads SDK requires Google Play services (for example, when using 'play-services-ads-lite'). Note that this does not include the adapter initialization status, which is returned in the [Future](https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future). **Returns** If init_result_out is kInitResultSuccess, this [Future](https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future) will contain the initialization status of each adapter once initialization is complete. Otherwise, the returned [Future](https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future) will have kFutureStatusInvalid.

### Initialize

```c++
Future< AdapterInitializationStatus > Initialize(
  InitResult *init_result_out
)
```
Initializes Google Mobile Ads (GMA) without Firebase for iOS.

**[Deprecated.](https://developers.google.com/admob/cpp/reference/deprecated/deprecated)** The Google Mobile Ads C++ SDK is now deprecated. Please see <https://developers.google.com/admob/cpp/reference/namespace/firebase/gma> for more information.
Details Parameters `init_result_out` Optional: If provided, write the basic init result here. kInitResultSuccess if initialization succeeded, or kInitResultFailedMissingDependency on Android if Google Play services is not available on the current device and the Google Mobile Ads SDK requires Google Play services (for example, when using 'play-services-ads-lite'). Note that this does not include the adapter initialization status, which is returned in the [Future](https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future). **Returns** If init_result_out is `kInitResultSuccess`, this [Future](https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future) will contain the initialization status of each adapter once initialization is complete. Otherwise, the returned [Future](https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future) will have `kFutureStatusInvalid`.

### InitializeLastResult

```c++
Future< AdapterInitializationStatus > InitializeLastResult()
```
Get the [Future](https://developers.google.com/admob/cpp/reference/class/firebase/future#classfirebase_1_1_future) returned by a previous call to [firebase::gma::Initialize()](https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a83cdc25dbc94f86347d97c4fc21afe61).

### OpenAdInspector

```c++
void OpenAdInspector(
  AdParent parent,
  AdInspectorClosedListener *listener
)
```
Opens the ad inspector UI.

<br />

Details Parameters `parent` The platform-specific UI element that will host the ad inspector. For iOS this should be the window's `UIViewController`. For Android this is the `Activity` Context which the GMA SDK is running in. `listener` The listener will be invoked when the user closes the ad inspector UI. [firebase::gma::Initialize()](https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a83cdc25dbc94f86347d97c4fc21afe61). must be called prior to this function.

### SetIsSameAppKeyEnabled

```c++
void SetIsSameAppKeyEnabled(
  bool is_enabled
)
```
Controls whether the Google Mobile Ads SDK Same [App](https://developers.google.com/admob/cpp/reference/class/firebase/app#classfirebase_1_1_app) Key is enabled.

This function must be invoked after GMA has been initialized. The value set persists across app sessions. The key is enabled by default.

This operation is supported on iOS only. This is a no-op on Android systems.

<br />

Details Parameters `is_enabled` whether the Google Mobile Ads SDK Same [App](https://developers.google.com/admob/cpp/reference/class/firebase/app#classfirebase_1_1_app) Key is enabled.

### SetRequestConfiguration

```c++
void SetRequestConfiguration(
  const RequestConfiguration & request_configuration
)
```
Sets the global [RequestConfiguration](https://developers.google.com/admob/cpp/reference/struct/firebase/gma/request-configuration#structfirebase_1_1gma_1_1_request_configuration) that will be used for every [AdRequest](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-request#classfirebase_1_1gma_1_1_ad_request) during the app's session.

<br />

Details Parameters `request_configuration` The request configuration that should be applied to all ad requests.

### Terminate

```c++
void Terminate()
```
Terminate GMA.

Frees resources associated with GMA that were allocated during [firebase::gma::Initialize()](https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1a83cdc25dbc94f86347d97c4fc21afe61).