GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GADMobileAds
@interface GADMobileAds : NSObject
Google Mobile Ads SDK settings.
-
Returns the shared GADMobileAds instance.
Declaration
Swift
class var shared: MobileAds { get }
Objective-C
@property (class, nonatomic, readonly, nonnull) GADMobileAds *sharedInstance;
-
Returns the Google Mobile Ads SDK’s version number.
Declaration
Swift
var versionNumber: VersionNumber { get }
-
The application’s audio volume. Affects audio volumes of all ads relative to other audio output.
Valid ad volume values range from 0.0 (silent) to 1.0 (current device volume). Defaults to 1.0.
Warning: Lowering your app’s audio volume reduces video ad eligibility and may reduce your app’s
ad revenue. You should only utilize this API if your app provides custom volume controls to the
user, and you should reflect the user’s volume choice in this API.
Declaration
Swift
var applicationVolume: Float { get set }
Objective-C
@property (nonatomic) float applicationVolume;
-
Indicates whether the application’s audio is muted. Affects initial mute state for all ads.
Defaults to NO.
Warning: Muting your application reduces video ad eligibility and may reduce your app’s ad
revenue. You should only utilize this API if your app provides a custom mute control to the
user, and you should reflect the user’s mute decision in this API.
Declaration
Swift
var isApplicationMuted: Bool { get set }
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite,
getter=isApplicationMuted) BOOL applicationMuted;
-
Manages the Google Mobile Ads SDK’s audio and video settings.
Declaration
Swift
var audioVideoManager: AudioVideoManager { get }
Objective-C
@property (nonatomic, strong, readonly, nonnull) GADAudioVideoManager *audioVideoManager;
-
Request configuration that is common to all requests.
Declaration
Swift
var requestConfiguration: RequestConfiguration { get }
-
Initialization status of the ad networks available to the Google Mobile Ads SDK.
Declaration
Swift
var initializationStatus: InitializationStatus { get }
-
Returns YES if the current SDK version is at least |major|.|minor|.|patch|. This method can be
used by libraries that depend on a specific minimum version of the Google Mobile Ads SDK to warn
developers if they have an incompatible version.
Available in Google Mobile Ads SDK 7.10 and onwards. Before calling this method check if the
GADMobileAds’s shared instance responds to this method. Calling this method on a Google Mobile
Ads SDK lower than 7.10 can crash the app.
Declaration
Swift
func isSDKVersionAtLeast(major: Int, minor: Int, patch: Int) -> Bool
Objective-C
- (BOOL)isSDKVersionAtLeastMajor:(NSInteger)major
minor:(NSInteger)minor
patch:(NSInteger)patch;
-
Starts the Google Mobile Ads SDK. Call this method as early as possible to reduce latency on the
session’s first ad request. Calls completionHandler when the GMA SDK and all mediation networks
are fully set up or if set-up times out. The Google Mobile Ads SDK starts on the first ad
request if this method is not called.
Declaration
Swift
func start() async -> InitializationStatus
-
Disables automated SDK crash reporting. 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.
Declaration
Swift
func disableSDKCrashReporting()
Objective-C
- (void)disableSDKCrashReporting;
-
Disables mediation adapter initialization 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.
Declaration
Swift
func disableMediationInitialization()
Objective-C
- (void)disableMediationInitialization;
-
Presents Ad Inspector. The device calling this API must be registered as a test device in order
to launch Ad Inspector. Set
GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers to enable test mode on
this device.
Declaration
Swift
func presentAdInspector(from viewController: UIViewController?) async throws
Objective-C
- (void)presentAdInspectorFromViewController:
(nullable UIViewController *)viewController
completionHandler:
(nullable GADAdInspectorCompletionHandler)
completionHandler;
Parameters
viewController
|
A view controller to present Ad Inspector. If nil, uses the top view
controller of the app’s main window.
|
completionHandler
|
A handler to execute when Ad Inspector is closed.
|
-
Registers a web view with the Google Mobile Ads SDK to improve in-app ad monetization of ads
within this web view.
Declaration
Swift
func register(_ webView: WKWebView)
Objective-C
- (void)registerWebView:(nonnull WKWebView *)webView;
-
Generates a signal that can be used as input in a server-to-server Google request. Calls
completionHandler asynchronously on the main thread once a signal has been generated or
when an error occurs.
Declaration
Swift
class func generateSignal(_ request: SignalRequest) async throws -> Signal
Parameters
request
|
The signal request that will be used to generate the signal.
|
completionHandler
|
A handler to execute when the signal generation is done.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003eGADMobileAds provides settings and controls for the Google Mobile Ads SDK.\u003c/p\u003e\n"],["\u003cp\u003eIt manages ad volume, mute state, request configurations, and SDK initialization.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use it to start the SDK, disable crash reporting, and present an Ad Inspector.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods for signal generation and web view registration to enhance ad monetization.\u003c/p\u003e\n"],["\u003cp\u003eThe shared instance of GADMobileAds can be accessed using \u003ccode\u003esharedInstance()\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `GADMobileAds` class manages the Google Mobile Ads SDK. Key actions include: retrieving the shared instance and version number, configuring application audio volume and mute settings, and managing audio/video aspects. It also allows for starting the SDK, disabling crash reporting and mediation initialization, and presenting the Ad Inspector. Additional functionalities include registering a web view for ad monetization, and generating a signal for server-to-server ad requests. Furthermore, it lets you check if the SDK version is above certain version.\n"],null,["GADMobileAds \n\n\n @interface GADMobileAds : NSObject\n\nGoogle Mobile Ads SDK settings.\n- `\n ``\n ``\n `\n\n [sharedInstance](#/c:objc(cs)GADMobileAds(cpy)sharedInstance)`\n ` \n Returns the shared GADMobileAds instance. \n\n Declaration \n Swift \n\n class var shared: MobileAds { get }\n\n Objective-C \n\n @property (class, nonatomic, readonly, nonnull) GADMobileAds *sharedInstance;\n\n- `\n ``\n ``\n `\n\n [versionNumber](#/c:objc(cs)GADMobileAds(py)versionNumber)`\n ` \n Returns the Google Mobile Ads SDK's version number. \n\n Declaration \n Swift \n\n var versionNumber: VersionNumber { get }\n\n Objective-C \n\n @property (nonatomic, readonly) ../Structs/GADVersionNumber.html versionNumber;\n\n- `\n ``\n ``\n `\n\n [applicationVolume](#/c:objc(cs)GADMobileAds(py)applicationVolume)`\n ` \n The application's audio volume. Affects audio volumes of all ads relative to other audio output.\n Valid ad volume values range from 0.0 (silent) to 1.0 (current device volume). Defaults to 1.0.\n\n Warning: Lowering your app's audio volume reduces video ad eligibility and may reduce your app's\n ad revenue. You should only utilize this API if your app provides custom volume controls to the\n user, and you should reflect the user's volume choice in this API. \n\n Declaration \n Swift \n\n var applicationVolume: Float { get set }\n\n Objective-C \n\n @property (nonatomic) float applicationVolume;\n\n- `\n ``\n ``\n `\n\n [applicationMuted](#/c:objc(cs)GADMobileAds(py)applicationMuted)`\n ` \n Indicates whether the application's audio is muted. Affects initial mute state for all ads.\n Defaults to NO.\n\n Warning: Muting your application reduces video ad eligibility and may reduce your app's ad\n revenue. You should only utilize this API if your app provides a custom mute control to the\n user, and you should reflect the user's mute decision in this API. \n\n Declaration \n Swift \n\n var isApplicationMuted: Bool { get set }\n\n Objective-C \n\n @property (nonatomic, assign, unsafe_unretained, readwrite,\n getter=isApplicationMuted) BOOL applicationMuted;\n\n- `\n ``\n ``\n `\n\n [audioVideoManager](#/c:objc(cs)GADMobileAds(py)audioVideoManager)`\n ` \n Manages the Google Mobile Ads SDK's audio and video settings. \n\n Declaration \n Swift \n\n var audioVideoManager: AudioVideoManager { get }\n\n Objective-C \n\n @property (nonatomic, strong, readonly, nonnull) ../Classes/GADAudioVideoManager.html *audioVideoManager;\n\n- `\n ``\n ``\n `\n\n [requestConfiguration](#/c:objc(cs)GADMobileAds(py)requestConfiguration)`\n ` \n Request configuration that is common to all requests. \n\n Declaration \n Swift \n\n var requestConfiguration: RequestConfiguration { get }\n\n Objective-C \n\n @property (nonatomic, strong, readonly, nonnull) ../Classes/GADRequestConfiguration.html *requestConfiguration;\n\n- `\n ``\n ``\n `\n\n [initializationStatus](#/c:objc(cs)GADMobileAds(py)initializationStatus)`\n ` \n Initialization status of the ad networks available to the Google Mobile Ads SDK. \n\n Declaration \n Swift \n\n var initializationStatus: InitializationStatus { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nonnull) ../Classes/GADInitializationStatus.html *initializationStatus;\n\n- `\n ``\n ``\n `\n\n [-isSDKVersionAtLeastMajor:minor:patch:](#/c:objc(cs)GADMobileAds(im)isSDKVersionAtLeastMajor:minor:patch:)`\n ` \n Returns YES if the current SDK version is at least \\|major\\|.\\|minor\\|.\\|patch\\|. This method can be\n used by libraries that depend on a specific minimum version of the Google Mobile Ads SDK to warn\n developers if they have an incompatible version.\n\n Available in Google Mobile Ads SDK 7.10 and onwards. Before calling this method check if the\n GADMobileAds's shared instance responds to this method. Calling this method on a Google Mobile\n Ads SDK lower than 7.10 can crash the app. \n\n Declaration \n Swift \n\n func isSDKVersionAtLeast(major: Int, minor: Int, patch: Int) -\u003e Bool\n\n Objective-C \n\n - (BOOL)isSDKVersionAtLeastMajor:(NSInteger)major\n minor:(NSInteger)minor\n patch:(NSInteger)patch;\n\n- `\n ``\n ``\n `\n\n [-startWithCompletionHandler:](#/c:objc(cs)GADMobileAds(im)startWithCompletionHandler:)`\n ` \n Starts the Google Mobile Ads SDK. Call this method as early as possible to reduce latency on the\n session's first ad request. Calls completionHandler when the GMA SDK and all mediation networks\n are fully set up or if set-up times out. The Google Mobile Ads SDK starts on the first ad\n request if this method is not called. \n\n Declaration \n Swift \n\n func start() async -\u003e InitializationStatus\n\n Objective-C \n\n - (void)startWithCompletionHandler:\n (nullable ../Type-Definitions.html#/c:GADMobileAds.h@T@GADInitializationCompletionHandler)completionHandler;\n\n- `\n ``\n ``\n `\n\n [-disableSDKCrashReporting](#/c:objc(cs)GADMobileAds(im)disableSDKCrashReporting)`\n ` \n Disables automated SDK crash reporting. If not called, the SDK records the original exception\n handler if available and registers a new exception handler. The new exception handler only\n reports SDK related exceptions and calls the recorded original exception handler. \n\n Declaration \n Swift \n\n func disableSDKCrashReporting()\n\n Objective-C \n\n - (void)disableSDKCrashReporting;\n\n- `\n ``\n ``\n `\n\n [-disableMediationInitialization](#/c:objc(cs)GADMobileAds(im)disableMediationInitialization)`\n ` \n Disables mediation adapter initialization during initialization of the GMA SDK. Calling this\n method may negatively impact your ad performance and should only be called if you will not use\n GMA SDK controlled mediation during this app session. This method must be called before\n initializing the GMA SDK or loading ads and has no effect once the SDK has been initialized. \n\n Declaration \n Swift \n\n func disableMediationInitialization()\n\n Objective-C \n\n - (void)disableMediationInitialization;\n\n- `\n ``\n ``\n `\n\n [-presentAdInspectorFromViewController:completionHandler:](#/c:objc(cs)GADMobileAds(im)presentAdInspectorFromViewController:completionHandler:)`\n ` \n Presents Ad Inspector. The device calling this API must be registered as a test device in order\n to launch Ad Inspector. Set\n GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers to enable test mode on\n this device. \n\n Declaration \n Swift \n\n func presentAdInspector(from viewController: UIViewController?) async throws\n\n Objective-C \n\n - (void)presentAdInspectorFromViewController:\n (nullable UIViewController *)viewController\n completionHandler:\n (nullable ../Type-Definitions.html#/c:GADMobileAds.h@T@GADAdInspectorCompletionHandler)\n completionHandler;\n\n Parameters\n\n |---------------------------|-----------------------------------------------------------------------------------------------------------|\n | ` `*viewController*` ` | A view controller to present Ad Inspector. If nil, uses the top view controller of the app's main window. |\n | ` `*completionHandler*` ` | A handler to execute when Ad Inspector is closed. |\n\n- `\n ``\n ``\n `\n\n [-registerWebView:](#/c:objc(cs)GADMobileAds(im)registerWebView:)`\n ` \n Registers a web view with the Google Mobile Ads SDK to improve in-app ad monetization of ads\n within this web view. \n\n Declaration \n Swift \n\n func register(_ webView: WKWebView)\n\n Objective-C \n\n - (void)registerWebView:(nonnull WKWebView *)webView;\n\n- `\n ``\n ``\n `\n\n [+generateSignal:completionHandler:](#/c:objc(cs)GADMobileAds(cm)generateSignal:completionHandler:)`\n ` \n Generates a signal that can be used as input in a server-to-server Google request. Calls\n completionHandler asynchronously on the main thread once a signal has been generated or\n when an error occurs. \n\n Declaration \n Swift \n\n class func generateSignal(_ request: SignalRequest) async throws -\u003e Signal\n\n Objective-C \n\n + (void)generateSignal:(nonnull ../Classes/GADSignalRequest.html *)request\n completionHandler:(nonnull ../Type-Definitions.html#/c:GADMobileAds.h@T@GADSignalCompletionHandler)completionHandler;\n\n Parameters\n\n |---------------------------|--------------------------------------------------------------|\n | ` `*request*` ` | The signal request that will be used to generate the signal. |\n | ` `*completionHandler*` ` | A handler to execute when the signal generation is done. |"]]