firebase:: admob
API for AdMob with Firebase.
Summary
The AdMob API allows you to load and display mobile ads using the Google Mobile Ads SDK. Each ad format has its own header file.
Enumerations |
|
---|---|
AdMobError{
|
enum Error codes returned by Future::error(). |
AdSizeType
|
enum Types of ad sizes. |
ChildDirectedTreatmentState{
|
enum Indicates whether an ad request is considered tagged for child-directed treatment. |
Gender{
|
enum Gender information used as part of the firebase::admob::AdRequest struct. |
Typedefs |
|
---|---|
AdParent
|
typedefvoid *
This is a platform specific datatype that is required to create an AdMob ad. |
Functions |
|
---|---|
Initialize(const ::firebase::App & app)
|
Initializes AdMob via Firebase.
|
Initialize(const ::firebase::App & app, const char *admob_app_id)
|
Initializes AdMob via Firebase with the publisher's AdMob app ID.
|
Initialize(JNIEnv *jni_env, jobject activity)
|
Initializes AdMob without Firebase for Android.
|
Initialize(JNIEnv *jni_env, jobject activity, const char *admob_app_id)
|
Initializes AdMob via Firebase with the publisher's AdMob app ID.
|
Initialize()
|
Initializes AdMob without Firebase for iOS.
|
Initialize(const char *admob_app_id)
|
Initializes AdMob with the publisher's AdMob app ID and without Firebase for iOS.
|
Terminate()
|
void
Terminate AdMob.
|
Classes |
|
---|---|
firebase:: |
Loads and displays AdMob banner ads. |
firebase:: |
Loads and displays AdMob interstitial ads. |
firebase:: |
Loads and displays ads from AdMob Native Ads Express. |
Structs |
|
---|---|
firebase:: |
The information needed to request an ad. |
firebase:: |
An ad size value to be used in requesting ads. |
firebase:: |
The screen location and dimensions of an ad view once it has been initialized. |
firebase:: |
Generic Key-Value container used for the "extras" values in an firebase::admob::AdRequest. |
Namespaces |
|
---|---|
firebase:: |
Loads and displays rewarded video ads via AdMob mediation. |
Enumerations
AdMobError
AdMobError
Error codes returned by Future::error().
AdSizeType
AdSizeType
Types of ad sizes.
ChildDirectedTreatmentState
ChildDirectedTreatmentState
Indicates whether an ad request is considered tagged for child-directed treatment.
Gender
Gender
Gender information used as part of the firebase::admob::AdRequest struct.
Typedefs
AdParent
void * AdParent
This is a platform specific datatype that is required to create an AdMob 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
Initialize
InitResult Initialize( const ::firebase::App & app )
Initializes AdMob via Firebase.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
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').
|
Initialize
InitResult Initialize( const ::firebase::App & app, const char *admob_app_id )
Initializes AdMob via Firebase with the publisher's AdMob app ID.
Initializing the Google Mobile Ads SDK with the AdMob app ID at app launch allows the SDK to fetch app-level settings and perform configuration tasks as early as possible. This can help reduce latency for the initial ad request. AdMob app IDs are unique identifiers given to mobile apps when they're registered in the AdMob console. To find your app ID in the AdMob console, click the App management (https://apps.admob.com/#account/appmgmt:) option under the settings dropdown (located in the upper right-hand corner). App IDs have the form ca-app-pub-XXXXXXXXXXXXXXXX~NNNNNNNNNN.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
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').
|
Initialize
InitResult Initialize( JNIEnv *jni_env, jobject activity )
Initializes AdMob without Firebase for Android.
The arguments to Initialize are platform-specific so the caller must do something like this:
#if defined(__ANDROID__) firebase::admob::Initialize(jni_env, activity); #else firebase::admob::Initialize(); #endif
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
kInitResultSuccess if initialization succeeded, or kInitResultFailedMissingDependency on Android if Google Play services is not available on the current device and the AdMob SDK requires Google Play services (for example when using 'play-services-ads-lite').
|
Initialize
InitResult Initialize( JNIEnv *jni_env, jobject activity, const char *admob_app_id )
Initializes AdMob via Firebase with the publisher's AdMob app ID.
Initializing the Google Mobile Ads SDK with the AdMob app ID at app launch allows the SDK to fetch app-level settings and perform configuration tasks as early as possible. This can help reduce latency for the initial ad request. AdMob app IDs are unique identifiers given to mobile apps when they're registered in the AdMob console. To find your app ID in the AdMob console, click the App management (https://apps.admob.com/#account/appmgmt:) option under the settings dropdown (located in the upper right-hand corner). App IDs have the form ca-app-pub-XXXXXXXXXXXXXXXX~NNNNNNNNNN.
The arguments to Initialize are platform-specific so the caller must do something like this:
#if defined(__ANDROID__) firebase::admob::Initialize(jni_env, activity, admob_app_id); #else firebase::admob::Initialize(admob_app_id); #endif
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
kInitResultSuccess if initialization succeeded, or kInitResultFailedMissingDependency on Android if Google Play services is not available on the current device and the AdMob SDK requires Google Play services (for example when using 'play-services-ads-lite').
|