GADAppOpenAdPreloader
@interface GADAppOpenAdPreloader : NSObjectPreloader for app open ads.
-
Returns the shared GADAppOpenAdPreloader instance.
Declaration
Swift
class var shared: AppOpenAdPreloader { get }Objective-C
@property (class, nonatomic, readonly, nonnull) GADAppOpenAdPreloader *sharedInstance; -
Starts preloading app open ads from the configuration for the given preload ID. If a delegate is provided, ad events will be forwarded to the delegate. Returns false if preload failed to start. Check console for error log.
Declaration
Swift
func preload(for preloadID: String, configuration: PreloadConfigurationV2, delegate: (any PreloadDelegate)?) -> BoolObjective-C
- (BOOL)preloadForPreloadID:(nonnull NSString *)preloadID configuration:(nonnull GADPreloadConfigurationV2 *)configuration delegate:(nullable id<GADPreloadDelegate>)delegate;Parameters
preloadIDA string that refers to a set of preloaded ads.
configurationA GADPreloadConfigurationV2 instance.
delegateAn optional delegate to receive ad event callbacks.
-
Returns whether an app open ad is preloaded for the given preload ID.
Declaration
Swift
func isAdAvailable(with preloadID: String) -> BoolObjective-C
- (BOOL)isAdAvailableWithPreloadID:(nonnull NSString *)preloadID;Parameters
preloadIDA string that refers to a set of preloaded ads.
-
Returns a preloaded app open ad for the given preload ID. Returns nil if an ad is not available.
Declaration
Swift
func ad(with preloadID: String) -> AppOpenAd?Objective-C
- (nullable GADAppOpenAd *)adWithPreloadID:(nonnull NSString *)preloadID;Parameters
preloadIDA string that refers to a set of preloaded ads.
-
Returns the responseInfo of a preloaded app open ad for the given preload ID without removing the ad from the queue. Returns nil if an ad is not available.
Declaration
Swift
func responseInfo(with preloadID: String) -> ResponseInfo?Objective-C
- (nullable GADResponseInfo *)adResponseInfoWithPreloadID: (nonnull NSString *)preloadID;Parameters
preloadIDA string that refers to a set of preloaded ads.
-
Returns the number of preloaded app open ads available for the given preload ID.
Declaration
Swift
func numberOfAdsAvailable(with preloadID: String) -> UIntObjective-C
- (NSUInteger)numberOfAdsAvailableWithPreloadID:(nonnull NSString *)preloadID;Parameters
preloadIDA string that refers to a set of preloaded ads.
-
Stops preloading app open ads and removes preloaded app open ads for the given preload ID.
Declaration
Swift
func stopPreloadingAndRemoveAds(for preloadID: String)Objective-C
- (void)stopPreloadingAndRemoveAdsForPreloadID:(nonnull NSString *)preloadID;Parameters
preloadIDA string that refers to a set of preloaded ads.
-
Stops preloading all app open ads and removes all preloaded app open ads.
Declaration
Swift
func stopPreloadingAndRemoveAllAds()Objective-C
- (void)stopPreloadingAndRemoveAllAds; -
Returns the corresponding configuration for the given preload ID.
Declaration
Swift
func configuration(with preloadID: String) -> PreloadConfigurationV2?Objective-C
- (nullable GADPreloadConfigurationV2 *)configurationWithPreloadID: (nonnull NSString *)preloadID;Parameters
preloadIDA string that refers to a set of preloaded ads.
-
Returns a map of preload IDs to their corresponding configurations.
Declaration
Swift
func configurations() -> [String : PreloadConfigurationV2]Objective-C
- (nonnull NSDictionary<NSString *, GADPreloadConfigurationV2 *> *) configurations;