GoogleMobileAds.
Api.
MobileAds
Contains logic that applies to the Google Mobile Ads SDK as a whole.
Summary
Properties
static bool
Public static functions
void
void
Version
GetVersion
()
Version
Initialize
(Action< InitializationStatus
> initCompleteAction)
void
OpenAdInspector
(Action< AdInspectorError
> adInspectorClosedAction)
void
Preload
(List< PreloadConfiguration
> configurations, Action< PreloadConfiguration
> onAdAvailable, Action< PreloadConfiguration
> onAdsExhausted)
void
SetApplicationMuted
(bool muted)
void
SetApplicationVolume
(float volume)
void
SetRequestConfiguration
( RequestConfiguration
requestConfiguration)
void
SetiOSAppPauseOnBackground
(bool pause)
void
Classes
Contains methods for returning the device scale and safe width.
Properties
RaiseAdEventsOnUnityMainThread
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
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
void DisableSDKCrashReporting ()
Disables automated SDK crash reporting on iOS.
Call this method closer to the app start.
GetPlatformVersion
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.
| Details | |
|---|---|
| Returns | The Google Mobile Ads Android or iOS SDK version for the platform the app is running on.
|
GetRequestConfiguration
RequestConfiguration GetRequestConfiguration ()
GetVersion
Version GetVersion ()
Gets the Google Mobile Ads Unity SDK version.
| Details | |
|---|---|
| Returns | The Google Mobile Ads Unity SDK version.
|
Initialize
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.
initCompleteAction
InitializationStatus
of the SDK as a parameter.OpenAdInspector
void OpenAdInspector ( Action < AdInspectorError > adInspectorClosedAction )
Opens ad inspector UI.
adInspectorClosedAction
Preload
void Preload ( List < PreloadConfiguration > configurations , Action < PreloadConfiguration > onAdAvailable , Action < PreloadConfiguration > onAdsExhausted )
Preloads ads for the given configurations.
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
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.
muted
SetApplicationVolume
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.
volume
SetRequestConfiguration
void SetRequestConfiguration ( RequestConfiguration requestConfiguration )
Sets the global RequestConfiguration that is used for every AdRequest during the app's session.
requestConfiguration
SetiOSAppPauseOnBackground
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.
pause

