GADInstreamAd
@interface GADInstreamAd : NSObject
An instream ad.
-
Loads an instream ad with the provided ad unit ID. Instream ads only support GADMediaAspectRatioLandscape and GADMediaAspectRatioPortrait media aspect ratios, defaulting to GADMediaAspectRatioLandscape. Calls the provided completion handler when the ad load completes.
Declaration
Swift
class func loadAd(withAdUnitID adUnitID: String, request: GADRequest?, mediaAspectRatio: GADMediaAspectRatio, completionHandler: @escaping GADInstreamAdLoadCompletionHandler)
Objective-C
+ (void)loadAdWithAdUnitID:(nonnull NSString *)adUnitID request:(nullable GADRequest *)request mediaAspectRatio:(GADMediaAspectRatio)mediaAspectRatio completionHandler: (nonnull GADInstreamAdLoadCompletionHandler)completionHandler;
-
Loads an instream ad with the provided ad tag. Calls the provided completion handler when the ad load completes.
Declaration
Swift
class func loadAd(withAdTag adTag: String, completionHandler: @escaping GADInstreamAdLoadCompletionHandler)
Objective-C
+ (void)loadAdWithAdTag:(nonnull NSString *)adTag completionHandler: (nonnull GADInstreamAdLoadCompletionHandler)completionHandler;
-
Media content metadata and controls.
Declaration
Swift
var mediaContent: GADMediaContent { get }
Objective-C
@property (readonly, nonatomic, nonnull) GADMediaContent *mediaContent;
-
Information about the ad response that returned the ad.
Declaration
Swift
var responseInfo: GADResponseInfo { get }
Objective-C
@property (readonly, nonatomic, 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 (copy, nonatomic, nullable) GADPaidEventHandler paidEventHandler;