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. 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 and Android SDKs from AdMob. For support, reach out to the Google Mobile Ads SDK Technical Forum.
Typedefs |
|
---|---|
AdParent
|
typedefvoid *
This is a platform specific datatype that is required to create a Google Mobile Ads ad. |
Functions |
|
---|---|
DisableMediationInitialization()
|
void
Disables mediation adapter initialization on iOS during initialization of the GMA SDK.
|
DisableSDKCrashReporting()
|
void
Disables automated SDK crash reporting on iOS.
|
GetInitializationStatus()
|
Get the current adapter initialization status.
|
GetRequestConfiguration()
|
Gets the global RequestConfiguration.
|
Initialize(const ::firebase::App & app, InitResult *init_result_out)
|
Deprecated.
The Google Mobile Ads C++ SDK is now deprecated. Please see the SDK reference documentation for more information. Initializes Google Mobile Ads (GMA) via Firebase. |
Initialize(JNIEnv *jni_env, jobject activity, InitResult *init_result_out)
|
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. |
Initialize(InitResult *init_result_out)
|
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. |
InitializeLastResult()
|
Get the Future returned by a previous call to firebase::gma::Initialize().
|
OpenAdInspector(AdParent parent, AdInspectorClosedListener *listener)
|
void
Opens the ad inspector UI.
|
SetIsSameAppKeyEnabled(bool is_enabled)
|
void
Controls whether the Google Mobile Ads SDK Same App Key is enabled.
|
SetRequestConfiguration(const RequestConfiguration & request_configuration)
|
void
Sets the global RequestConfiguration that will be used for every AdRequest during the app's session.
|
Terminate()
|
void
Terminate GMA.
|
Classes |
|
---|---|
firebase:: |
Information about why an ad operation failed. |
firebase:: |
Listener to be invoked when the Ad Inspector has been closed. |
firebase:: |
A listener for receiving notifications during the lifecycle of a BannerAd. |
firebase:: |
Contains targeting information used to fetch an ad. |
firebase:: |
Information about the result of an ad operation. |
firebase:: |
Describes a reward credited to a user for interacting with a RewardedAd. |
firebase:: |
The size of a banner ad. |
firebase:: |
The monetary value earned from an ad. |
firebase:: |
Loads and displays Google Mobile Ads AdView ads. |
firebase:: |
A listener class that developers can extend and pass to an AdView object's AdView::SetBoundingBoxListener method to be notified of changes to the size of the Ad's bounding box. |
firebase:: |
An immutable snapshot of the GMA SDK’s initialization status, categorized by mediation adapter. |
firebase:: |
Response information for an individual ad network contained within a ResponseInfo object. |
firebase:: |
A snapshot of a mediation adapter's initialization status. |
firebase:: |
Listener to be invoked when ads show and dismiss full screen content, such as a fullscreen ad experience or an in-app browser. |
firebase:: |
Loads and displays Google Mobile Ads interstitial ads. |
firebase:: |
Listener to be invoked when ads have been estimated to earn money. |
firebase:: |
Information about an ad response. |
firebase:: |
Loads and displays Google Mobile Ads rewarded ads. |
firebase:: |
Listener to be invoked when the user earned a reward. |
Structs |
|
---|---|
firebase:: |
The screen location and dimensions of an AdView once it has been initialized. |
firebase:: |
Global configuration that will be used for every AdRequest. |
Namespaces |
|
---|---|
firebase:: |
API for User Messaging Platform. |
Enumerations
AdErrorCode
AdErrorCode
Error codes returned by Future::error().
Typedefs
AdParent
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.
Functions
DisableMediationInitialization
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
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
AdapterInitializationStatus GetInitializationStatus()
Get the current adapter initialization status.
You can poll this method to check which adapters have been initialized.
GetRequestConfiguration
RequestConfiguration GetRequestConfiguration()
Gets the global RequestConfiguration.
Details | |
---|---|
Returns |
the currently active RequestConfiguration that's being used for every ad request.
|
Initialize
Future< AdapterInitializationStatus > Initialize( const ::firebase::App & app, InitResult *init_result_out )
Initializes Google Mobile Ads (GMA) via Firebase.
Deprecated. The Google Mobile Ads C++ SDK is now deprecated. Please see the SDK reference documentation for more information.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Initialize
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 are platform-specific so the caller must do something like this:
#if defined(__ANDROID__) firebase::gma::Initialize(jni_env, activity); #else firebase::gma::Initialize(); #endif
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 |
|
||||||
Returns |
Initialize
Future< AdapterInitializationStatus > Initialize( InitResult *init_result_out )
Initializes Google Mobile Ads (GMA) without Firebase for iOS.
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 |
|
||
Returns |
InitializeLastResult
Future< AdapterInitializationStatus > InitializeLastResult()
Get the Future returned by a previous call to firebase::gma::Initialize().
OpenAdInspector
void OpenAdInspector( AdParent parent, AdInspectorClosedListener *listener )
Opens the ad inspector UI.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
SetIsSameAppKeyEnabled
void SetIsSameAppKeyEnabled( bool is_enabled )
Controls whether the Google Mobile Ads SDK Same 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.
Details | |||
---|---|---|---|
Parameters |
|
SetRequestConfiguration
void SetRequestConfiguration( const RequestConfiguration & request_configuration )
Sets the global RequestConfiguration that will be used for every AdRequest during the app's session.
Details | |||
---|---|---|---|
Parameters |
|
Terminate
void Terminate()
Terminate GMA.
Frees resources associated with GMA that were allocated during firebase::gma::Initialize().