GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GADRewardedAd
@interface GADRewardedAd : NSObject
The GADRewardedAd class is used for requesting and presenting a rewarded ad.
-
Initializes a rewarded ad with the provided ad unit ID. Create ad unit IDs using the AdMob
website for each unique ad placement in your app. Unique ad units improve targeting and
statistics.
Example AdMob ad unit ID: @ca-app-pub-3940256099942544/1712485313
Declaration
Objective-C
- (nonnull instancetype)initWithAdUnitID:(nonnull NSString *)adUnitID;
-
Requests an rewarded ad and calls the provided completion handler when the request finishes.
-
Declaration
Objective-C
@property (readonly, nonatomic, nonnull) NSString *adUnitID;
-
Indicates whether the rewarded ad is ready to be presented.
Declaration
Objective-C
@property (readonly, getter=isReady, nonatomic) BOOL ready;
-
The ad network class name that fetched the current ad. Is nil while the ready property is NO.
For both standard and mediated Google AdMob ads, this property is @GADMAdapterGoogleAdMobAds
.
For ads fetched via mediation custom events, this property is the mediated custom event adapter.
Declaration
Objective-C
@property (readonly, copy, nonatomic, nullable) NSString *adNetworkClassName;
-
The reward earned by the user for interacting with a rewarded ad. Is nil until the ad has
successfully loaded.
Declaration
Objective-C
@property (readonly, nonatomic, nullable) GADAdReward *reward;
-
Options specified for server-to-server user reward verification.
-
The loaded ad’s metadata. Is nil if no ad is loaded or the loaded ad doesn’t have metadata. Ad
metadata may update after loading. Use the rewardedAdMetadataDidChange: delegate method on
GADRewardedAdMetadataDelegate to listen for updates.
Declaration
Objective-C
@property (readonly, nonatomic, nullable)
NSDictionary<GADAdMetadataKey, id> *adMetadata;
-
Delegate for ad metadata changes.
-
Presents the rewarded ad with the provided view controller and rewarded delegate to call back on
various intermission events. The delegate is strongly retained by the receiver until a terminal
delegate method is called. Terminal methods are -rewardedAd:didFailToPresentWithError: and
-rewardedAdDidClose: of GADRewardedAdDelegate.
Declaration
Objective-C
- (void)presentFromRootViewController:(nonnull UIViewController *)viewController
delegate:
(nonnull id<GADRewardedAdDelegate>)delegate;
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 2021-03-03 UTC.
[null,null,["Last updated 2021-03-03 UTC."],[],[],null,["GADRewardedAd \n\n @interface GADRewardedAd : NSObject\n\nThe GADRewardedAd class is used for requesting and presenting a rewarded ad.\n- `\n ``\n ``\n `\n\n [-initWithAdUnitID:](#/c:objc(cs)GADRewardedAd(im)initWithAdUnitID:)`\n ` \n Initializes a rewarded ad with the provided ad unit ID. Create ad unit IDs using the AdMob\n website for each unique ad placement in your app. Unique ad units improve targeting and\n statistics.\n\n Example AdMob ad unit ID: @ca-app-pub-3940256099942544/1712485313 \n\n Declaration \n Objective-C \n\n - (nonnull instancetype)initWithAdUnitID:(nonnull NSString *)adUnitID;\n\n- `\n ``\n ``\n `\n\n [-loadRequest:completionHandler:](#/c:objc(cs)GADRewardedAd(im)loadRequest:completionHandler:)`\n ` \n Requests an rewarded ad and calls the provided completion handler when the request finishes. \n\n Declaration \n Objective-C \n\n - (void)loadRequest:(nullable ../Classes/GADRequest.html *)request\n completionHandler:\n (nullable ../Type-Definitions.html#/c:GADRewardedAd.h@T@GADRewardedAdLoadCompletionHandler)completionHandler;\n\n- `\n ``\n ``\n `\n\n [adUnitID](#/c:objc(cs)GADRewardedAd(py)adUnitID)`\n ` \n The ad unit ID. \n\n Declaration \n Objective-C \n\n @property (readonly, nonatomic, nonnull) NSString *adUnitID;\n\n- `\n ``\n ``\n `\n\n [ready](#/c:objc(cs)GADRewardedAd(py)ready)`\n ` \n Indicates whether the rewarded ad is ready to be presented. \n\n Declaration \n Objective-C \n\n @property (readonly, getter=isReady, nonatomic) BOOL ready;\n\n- `\n ``\n ``\n `\n\n [adNetworkClassName](#/c:objc(cs)GADRewardedAd(py)adNetworkClassName)`\n ` \n The ad network class name that fetched the current ad. Is nil while the ready property is NO.\n For both standard and mediated Google AdMob ads, this property is @GADMAdapterGoogleAdMobAds.\n For ads fetched via mediation custom events, this property is the mediated custom event adapter. \n\n Declaration \n Objective-C \n\n @property (readonly, copy, nonatomic, nullable) NSString *adNetworkClassName;\n\n- `\n ``\n ``\n `\n\n [reward](#/c:objc(cs)GADRewardedAd(py)reward)`\n ` \n The reward earned by the user for interacting with a rewarded ad. Is nil until the ad has\n successfully loaded. \n\n Declaration \n Objective-C \n\n @property (readonly, nonatomic, nullable) ../Classes/GADAdReward.html *reward;\n\n- `\n ``\n ``\n `\n\n [serverSideVerificationOptions](#/c:objc(cs)GADRewardedAd(py)serverSideVerificationOptions)`\n ` \n Options specified for server-to-server user reward verification. \n\n Declaration \n Objective-C \n\n @property (readwrite, copy, nonatomic, nullable)\n ../Classes/GADServerSideVerificationOptions.html *serverSideVerificationOptions;\n\n- `\n ``\n ``\n `\n\n [adMetadata](#/c:objc(cs)GADRewardedAd(py)adMetadata)`\n ` \n The loaded ad's metadata. Is nil if no ad is loaded or the loaded ad doesn't have metadata. Ad\n metadata may update after loading. Use the rewardedAdMetadataDidChange: delegate method on\n GADRewardedAdMetadataDelegate to listen for updates. \n\n Declaration \n Objective-C \n\n @property (readonly, nonatomic, nullable)\n NSDictionary\u003c../Type-Definitions.html#/c:GADAdMetadataKeys.h@T@GADAdMetadataKey, id\u003e *adMetadata;\n\n- `\n ``\n ``\n `\n\n [adMetadataDelegate](#/c:objc(cs)GADRewardedAd(py)adMetadataDelegate)`\n ` \n Delegate for ad metadata changes. \n\n Declaration \n Objective-C \n\n @property (readwrite, nonatomic, nullable) id\u003c../Protocols/GADRewardedAdMetadataDelegate.html\u003e\n adMetadataDelegate;\n\n- `\n ``\n ``\n `\n\n [-presentFromRootViewController:delegate:](#/c:objc(cs)GADRewardedAd(im)presentFromRootViewController:delegate:)`\n ` \n Presents the rewarded ad with the provided view controller and rewarded delegate to call back on\n various intermission events. The delegate is strongly retained by the receiver until a terminal\n delegate method is called. Terminal methods are -rewardedAd:didFailToPresentWithError: and\n -rewardedAdDidClose: of GADRewardedAdDelegate. \n\n Declaration \n Objective-C \n\n - (void)presentFromRootViewController:(nonnull UIViewController *)viewController\n delegate:\n (nonnull id\u003c../Protocols/GADRewardedAdDelegate.html\u003e)delegate;"]]