GoogleMobileAds (Beta) Framework Reference

GADRewardedInterstitialAdPreloader


@interface GADRewardedInterstitialAdPreloader : NSObject

Preloader for rewarded interstitial ads.

  • Returns the shared GADRewardedInterstitialAdPreloader instance.

    Declaration

    Swift

    class var shared: RewardedInterstitialAdPreloader { get }

    Objective-C

    @property (class, nonatomic, readonly, nonnull) GADRewardedInterstitialAdPreloader *sharedInstance;
  • Starts preloading rewarded interstitial 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)?) -> Bool

    Objective-C

    - (BOOL)preloadForPreloadID:(nonnull NSString *)preloadID
                  configuration:(nonnull GADPreloadConfigurationV2 *)configuration
                       delegate:(nullable id<GADPreloadDelegate>)delegate;

    Parameters

    preloadID

    A string that refers to a set of preloaded ads.

    configuration

    A GADPreloadConfigurationV2 instance.

    delegate

    An optional delegate to receive ad event callbacks.

  • Returns whether a rewarded interstitial ad is preloaded for the given preload ID.

    Declaration

    Swift

    func isAdAvailable(with preloadID: String) -> Bool

    Objective-C

    - (BOOL)isAdAvailableWithPreloadID:(nonnull NSString *)preloadID;

    Parameters

    preloadID

    A string that refers to a set of preloaded ads.

  • Returns a preloaded rewarded interstitial ad for the given preload ID. Returns nil if an ad is not available.

    Declaration

    Swift

    func ad(with preloadID: String) -> RewardedInterstitialAd?

    Objective-C

    - (nullable GADRewardedInterstitialAd *)adWithPreloadID:
        (nonnull NSString *)preloadID;

    Parameters

    preloadID

    A string that refers to a set of preloaded ads.

  • Returns the responseInfo of a preloaded rewarded interstitial 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

    preloadID

    A string that refers to a set of preloaded ads.

  • Returns the number of preloaded rewarded interstitial ads available for the given preload ID.

    Declaration

    Swift

    func numberOfAdsAvailable(with preloadID: String) -> UInt

    Objective-C

    - (NSUInteger)numberOfAdsAvailableWithPreloadID:(nonnull NSString *)preloadID;

    Parameters

    preloadID

    A string that refers to a set of preloaded ads.

  • Stops preloading rewarded interstitial ads and removes preloaded rewarded interstitial ads for the given preload ID.

    Declaration

    Swift

    func stopPreloadingAndRemoveAds(for preloadID: String)

    Objective-C

    - (void)stopPreloadingAndRemoveAdsForPreloadID:(nonnull NSString *)preloadID;

    Parameters

    preloadID

    A string that refers to a set of preloaded ads.

  • Stops preloading all rewarded interstitial ads and removes all preloaded rewarded interstitial 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

    preloadID

    A 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;