GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GADAppOpenAd
An app open ad. Used to monetize app load screens.
-
Declaration
Swift
class func load(with adUnitID: String, request: Request?) async throws -> AppOpenAd
Parameters
adUnitID
|
An ad unit ID created in the AdMob or Ad Manager UI.
|
request
|
An ad request object. If nil, a default ad request object is used.
|
completionHandler
|
A handler to execute when the load operation finishes or times out.
|
-
Declaration
Swift
class func load(with adResponseString: String) async throws -> AppOpenAd
Parameters
adResponseString
|
A server-to-server ad response string.
|
completionHandler
|
A handler to execute when the load operation finishes or times out.
|
-
Optional delegate object that receives notifications about presentation and dismissal of full
screen content from this ad. Full screen content covers your application’s content. The delegate
may want to pause animations and time sensitive interactions. Set this delegate before
presenting the ad.
Declaration
Swift
weak var fullScreenContentDelegate: (any FullScreenContentDelegate)? { get set }
-
Declaration
Swift
var adUnitID: String { get }
Objective-C
@property (nonatomic, readonly, nonnull) NSString *adUnitID;
-
Information about the ad response that returned the ad.
Declaration
Swift
var responseInfo: ResponseInfo { get }
Objective-C
@property (nonatomic, readonly, nonnull) GADResponseInfo *responseInfo;
-
Called when the ad is estimated to have earned money. Available for allowlisted accounts only.
-
An identifier for a placement in reporting. This property must be set prior to presenting the
ad.
Declaration
Swift
var placementID: Int64 { get set }
Objective-C
@property (nonatomic) int64_t placementID;
-
Indicates whether the app open ad can be presented from the provided root view controller. Must
be called on the main thread.
Declaration
Swift
@MainActor func canPresent(from rootViewController: UIViewController?) throws
Objective-C
- (BOOL)canPresentFromRootViewController:
(nullable UIViewController *)rootViewController
error:(NSError *_Nullable *_Nullable)error;
Return Value
YES
if the app open ad can be presented from the provided root view controller,
NO
otherwise.
-
Presents the app open ad with the provided view controller. Must be called on the main thread.
If rootViewController is nil, attempts to present from the top view controller of the
application’s main window.
Declaration
Swift
@MainActor func present(from rootViewController: UIViewController?)
Objective-C
- (void)presentFromRootViewController:
(nullable UIViewController *)rootViewController;
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\u003e\u003ccode\u003eGADAppOpenAd\u003c/code\u003e is designed to monetize app load screens by displaying ads during app startup.\u003c/p\u003e\n"],["\u003cp\u003eIt can be loaded using an ad unit ID and request object or a server-to-server ad response string.\u003c/p\u003e\n"],["\u003cp\u003eIt provides a delegate (\u003ccode\u003efullScreenContentDelegate\u003c/code\u003e) for handling ad presentation and dismissal events.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGADAppOpenAd\u003c/code\u003e offers methods to check presentability (\u003ccode\u003ecanPresentFromRootViewController:error:\u003c/code\u003e) and present the ad (\u003ccode\u003epresentFromRootViewController:\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eInformation about the ad response and ad unit ID are accessible through \u003ccode\u003eresponseInfo\u003c/code\u003e and \u003ccode\u003eadUnitID\u003c/code\u003e properties, respectively.\u003c/p\u003e\n"]]],["GADAppOpenAd is used for monetizing app load screens. Key actions include loading ads using `loadWithAdUnitID:request:completionHandler:` or `loadWithAdResponseString:completionHandler:`. It can set a `fullScreenContentDelegate` for presentation notifications. The ad contains a read-only `adUnitID`, and `responseInfo`. The `paidEventHandler` is available to some accounts. `canPresentFromRootViewController:error:` checks presentability and `presentFromRootViewController:` shows the ad.\n"],null,["GADAppOpenAd \n\n\n @interface GADAppOpenAd : NSObject \u003c../Protocols/GADFullScreenPresentingAd.html\u003e\n\nAn app open ad. Used to monetize app load screens.\n- `\n ``\n ``\n `\n\n [+loadWithAdUnitID:request:completionHandler:](#/c:objc(cs)GADAppOpenAd(cm)loadWithAdUnitID:request:completionHandler:)`\n ` \n Loads an app open ad. \n\n Declaration \n Swift \n\n class func load(with adUnitID: String, request: Request?) async throws -\u003e AppOpenAd\n\n Objective-C \n\n + (void)loadWithAdUnitID:(nonnull NSString *)adUnitID\n request:(nullable ../Classes/GADRequest.html *)request\n completionHandler:\n (nonnull ../Type-Definitions.html#/c:GADAppOpenAd.h@T@GADAppOpenAdLoadCompletionHandler)completionHandler;\n\n Parameters\n\n |---------------------------|---------------------------------------------------------------------|\n | ` `*adUnitID*` ` | An ad unit ID created in the AdMob or Ad Manager UI. |\n | ` `*request*` ` | An ad request object. If nil, a default ad request object is used. |\n | ` `*completionHandler*` ` | A handler to execute when the load operation finishes or times out. |\n\n- `\n ``\n ``\n `\n\n [+loadWithAdResponseString:completionHandler:](#/c:objc(cs)GADAppOpenAd(cm)loadWithAdResponseString:completionHandler:)`\n ` \n Loads an app open ad. \n\n Declaration \n Swift \n\n class func load(with adResponseString: String) async throws -\u003e AppOpenAd\n\n Objective-C \n\n + (void)loadWithAdResponseString:(nonnull NSString *)adResponseString\n completionHandler:\n (nonnull ../Type-Definitions.html#/c:GADAppOpenAd.h@T@GADAppOpenAdLoadCompletionHandler)completionHandler;\n\n Parameters\n\n |---------------------------|---------------------------------------------------------------------|\n | ` `*adResponseString*` ` | A server-to-server ad response string. |\n | ` `*completionHandler*` ` | A handler to execute when the load operation finishes or times out. |\n\n- `\n ``\n ``\n `\n\n [fullScreenContentDelegate](#/c:objc(cs)GADAppOpenAd(py)fullScreenContentDelegate)`\n ` \n Optional delegate object that receives notifications about presentation and dismissal of full\n screen content from this ad. Full screen content covers your application's content. The delegate\n may want to pause animations and time sensitive interactions. Set this delegate before\n presenting the ad. \n\n Declaration \n Swift \n\n weak var fullScreenContentDelegate: (any FullScreenContentDelegate)? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) id\u003c../Protocols/GADFullScreenContentDelegate.html\u003e fullScreenContentDelegate;\n\n- `\n ``\n ``\n `\n\n [adUnitID](#/c:objc(cs)GADAppOpenAd(py)adUnitID)`\n ` \n The ad unit ID. \n\n Declaration \n Swift \n\n var adUnitID: String { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nonnull) NSString *adUnitID;\n\n- `\n ``\n ``\n `\n\n [responseInfo](#/c:objc(cs)GADAppOpenAd(py)responseInfo)`\n ` \n Information about the ad response that returned the ad. \n\n Declaration \n Swift \n\n var responseInfo: ResponseInfo { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nonnull) ../Classes/GADResponseInfo.html *responseInfo;\n\n- `\n ``\n ``\n `\n\n [paidEventHandler](#/c:objc(cs)GADAppOpenAd(py)paidEventHandler)`\n ` \n Called when the ad is estimated to have earned money. Available for allowlisted accounts only. \n\n Declaration \n Swift \n\n var paidEventHandler: ../Type-Definitions.html#/c:GADAdValue.h@T@GADPaidEventHandler? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) ../Type-Definitions.html#/c:GADAdValue.h@T@GADPaidEventHandler paidEventHandler;\n\n- `\n ``\n ``\n `\n\n [placementID](#/c:objc(cs)GADAppOpenAd(py)placementID)`\n ` \n An identifier for a placement in reporting. This property must be set prior to presenting the\n ad. \n\n Declaration \n Swift \n\n var placementID: Int64 { get set }\n\n Objective-C \n\n @property (nonatomic) int64_t placementID;\n\n- `\n ``\n ``\n `\n\n [-canPresentFromRootViewController:error:](#/c:objc(cs)GADAppOpenAd(im)canPresentFromRootViewController:error:)`\n ` \n Indicates whether the app open ad can be presented from the provided root view controller. Must\n be called on the main thread. \n\n Declaration \n Swift \n\n @MainActor func canPresent(from rootViewController: UIViewController?) throws\n\n Objective-C \n\n - (BOOL)canPresentFromRootViewController:\n (nullable UIViewController *)rootViewController\n error:(NSError *_Nullable *_Nullable)error;\n\n Return Value\n\n `YES` if the app open ad can be presented from the provided root view controller,\n `NO` otherwise.\n- `\n ``\n ``\n `\n\n [-presentFromRootViewController:](#/c:objc(cs)GADAppOpenAd(im)presentFromRootViewController:)`\n ` \n Presents the app open ad with the provided view controller. Must be called on the main thread.\n If rootViewController is nil, attempts to present from the top view controller of the\n application's main window. \n\n Declaration \n Swift \n\n @MainActor func present(from rootViewController: UIViewController?)\n\n Objective-C \n\n - (void)presentFromRootViewController:\n (nullable UIViewController *)rootViewController;"]]