GADAppOpenAd
@interface GADAppOpenAd : NSObject <GADFullScreenPresentingAd>
An app open ad. Used to monetize app load screens.
-
Loads an app open ad.
Declaration
Swift
class func load(withAdUnitID adUnitID: String, request: GADRequest?) async throws -> GADAppOpenAd
Objective-C
+ (void)loadWithAdUnitID:(nonnull NSString *)adUnitID request:(nullable GADRequest *)request completionHandler: (nonnull GADAppOpenAdLoadCompletionHandler)completionHandler;
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.
-
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: GADFullScreenContentDelegate? { get set }
Objective-C
@property (nonatomic, weak, nullable) id<GADFullScreenContentDelegate> fullScreenContentDelegate;
-
Information about the ad response that returned the ad.
Declaration
Swift
var responseInfo: GADResponseInfo { get }
Objective-C
@property (nonatomic, readonly, nonnull) GADResponseInfo *responseInfo;
-
Called when the ad is estimated to have earned money. Available for allowlisted accounts only.
Declaration
Swift
var paidEventHandler: GADPaidEventHandler? { get set }
Objective-C
@property (nonatomic, copy, nullable) GADPaidEventHandler paidEventHandler;
-
Returns whether the app open ad can be presented from the provided root view controller. Sets the error out parameter if the app open ad can’t be presented. Must be called on the main thread.
Declaration
Swift
func canPresent(fromRootViewController rootViewController: UIViewController) throws
Objective-C
- (BOOL)canPresentFromRootViewController: (nonnull UIViewController *)rootViewController error:(NSError *_Nullable *_Nullable)error;
-
Presents the app open ad with the provided view controller. Must be called on the main thread.
Declaration
Swift
func present(fromRootViewController rootViewController: UIViewController)
Objective-C
- (void)presentFromRootViewController: (nonnull UIViewController *)rootViewController;
-
Deprecated. Use +loadWithAdUnitID:request:completionHandler instead.
Declaration
Swift
class func load(withAdUnitID adUnitID: String, request: GADRequest?, orientation: UIInterfaceOrientation) async throws -> GADAppOpenAd
Objective-C
+ (void)loadWithAdUnitID:(nonnull NSString *)adUnitID request:(nullable GADRequest *)request orientation:(UIInterfaceOrientation)orientation completionHandler: (nonnull GADAppOpenAdLoadCompletionHandler)completionHandler;