AI-generated Key Takeaways
-
GADUserDidEarnRewardHandleris a block executed when a user earns a reward. -
GADPaidEventHandlerhandles ad events estimated to have earned money. -
GADAdSizerepresents ad sizes and should be used with predefined constants or functions. -
GADAppOpenAdLoadCompletionHandler,GADInterstitialAdLoadCompletionHandler,GADRewardedAdLoadCompletionHandler, andGADRewardedInterstitialAdLoadCompletionHandlerare handler blocks for different ad load operations. -
Mediation load completion handlers like
GADMediationBannerLoadCompletionHandlerandGADMediationInterstitialLoadCompletionHandlerare called by adapters after loading an ad and return an ad event delegate.
Type-Definitions
The following type definitions are available globally.
-
Undocumented
Declaration
Swift
struct AdLoaderAdType : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable, @unchecked SendableObjective-C
typedef NSString *GADAdLoaderAdType -
Ad metadata key type.
Declaration
Swift
struct GADAdMetadataKey : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable, @unchecked SendableObjective-C
typedef NSString *GADAdMetadataKey -
A block to be executed when the user earns a reward.
Declaration
Swift
typealias GADUserDidEarnRewardHandler = () -> VoidObjective-C
typedef void (^GADUserDidEarnRewardHandler)(void) -
A valid GADAdSize is considered to be one of the predefined GADAdSize constants or a GADAdSize constructed by GADAdSizeFromCGSize, GADAdSizeFullWidthPortraitWithHeight, GADAdSizeFullWidthLandscapeWithHeight.
Do not create a GADAdSize manually. Use one of the GADAdSize constants. Treat GADAdSize as an opaque type. Do not access any fields directly. To obtain a concrete CGSize, use the function CGSizeFromGADAdSize().
-
Handles ad events that are estimated to have earned money.
Declaration
Swift
typealias GADPaidEventHandler = (AdValue) -> VoidObjective-C
typedef void (^GADPaidEventHandler)(GADAdValue *_Nonnull)
-
The handler block to execute when the ad load operation completes. On failure, the appOpenAd is nil and the |error| is non-nil. On success, the appOpenAd is non-nil and the |error| is nil.
Declaration
Swift
typealias GADAppOpenAdLoadCompletionHandler = (AppOpenAd?, (any Error)?) -> VoidObjective-C
typedef void (^GADAppOpenAdLoadCompletionHandler)(GADAppOpenAd *_Nullable, NSError *_Nullable) -
Native ad custom click handler block. |assetID| is the ID of asset that has received a click.
Declaration
Swift
typealias GADNativeAdCustomClickHandler = (String) -> VoidObjective-C
typedef void (^GADNativeAdCustomClickHandler)(NSString *_Nonnull) -
A block to be executed when the ad request operation completes. On success, interstitialAd is non-nil and |error| is nil. On failure, interstitialAd is nil and |error| is non-nil.
Declaration
Swift
typealias GADInterstitialAdLoadCompletionHandler = (InterstitialAd?, (any Error)?) -> VoidObjective-C
typedef void (^GADInterstitialAdLoadCompletionHandler)( GADInterstitialAd *_Nullable, NSError *_Nullable) -
A block called with the initialization status when [GADMobileAds startWithCompletionHandler:] completes or times out.
Declaration
Swift
typealias GADInitializationCompletionHandler = (InitializationStatus) -> VoidObjective-C
typedef void (^GADInitializationCompletionHandler)( GADInitializationStatus *_Nonnull) -
Completion handler for presenting Ad Inspector. Returns an error if a problem was detected during presentation, or nil otherwise.
Declaration
Swift
typealias GADAdInspectorCompletionHandler = ((any Error)?) -> VoidObjective-C
typedef void (^GADAdInspectorCompletionHandler)(NSError *_Nullable) -
Completion handler for signal request creation. Returns a signal or an error.
Declaration
Swift
typealias GADSignalCompletionHandler = (Signal?, (any Error)?) -> VoidObjective-C
typedef void (^GADSignalCompletionHandler)(GADSignal *_Nullable, NSError *_Nullable) -
Undocumented
Declaration
Swift
struct GADNativeAssetIdentifier : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable, @unchecked SendableObjective-C
typedef NSString *GADNativeAssetIdentifier -
Completion handler for query creation. Returns query info or an error.
Declaration
Swift
typealias GADQueryInfoCreationCompletionHandler = (QueryInfo?, (any Error)?) -> VoidObjective-C
typedef void (^GADQueryInfoCreationCompletionHandler)(GADQueryInfo *_Nullable, NSError *_Nullable) -
Maximum ad content rating.
Declaration
Swift
struct GADMaxAdContentRating : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable, @unchecked SendableObjective-C
typedef NSString *GADMaxAdContentRating -
A block to be executed when the ad request operation completes. On success, rewardedAd is non-nil and |error| is nil. On failure, rewardedAd is nil and |error| is non-nil.
Declaration
Swift
typealias GADRewardedAdLoadCompletionHandler = (RewardedAd?, (any Error)?) -> VoidObjective-C
typedef void (^GADRewardedAdLoadCompletionHandler)(GADRewardedAd *_Nullable, NSError *_Nullable) -
A block to be executed when the ad request operation completes. On success, rewardedInterstitialAd is non-nil and |error| is nil. On failure, rewardedInterstitialAd is nil and |error| is non-nil.
Declaration
Swift
typealias GADRewardedInterstitialAdLoadCompletionHandler = (RewardedInterstitialAd?, (any Error)?) -> VoidObjective-C
typedef void (^GADRewardedInterstitialAdLoadCompletionHandler)( GADRewardedInterstitialAd *_Nullable, NSError *_Nullable) -
Undocumented
Declaration
Swift
typealias GAMInterstitialAdLoadCompletionHandler = (AdManagerInterstitialAd?, (any Error)?) -> VoidObjective-C
typedef void (^GAMInterstitialAdLoadCompletionHandler)(GAMInterstitialAd *_Nullable interstitialAd, NSError *_Nullable error) -
Called by the adapter after loading the banner ad or encountering an error. Returns an ad event object to send ad events to the Google Mobile Ads SDK. The block returns nil if a delegate couldn’t be created or if the block has already been called.
Declaration
Swift
typealias GADMediationBannerLoadCompletionHandler = ((any MediationBannerAd)?, (any Error)?) -> (any MediationBannerAdEventDelegate)?Objective-C
typedef id<GADMediationBannerAdEventDelegate> _Nullable ( ^GADMediationBannerLoadCompletionHandler)( id<GADMediationBannerAd> _Nullable, NSError *_Nullable) -
Deprecated
Interscroller mediation is no longer supported. This API will be removed in a future release.
Called by the adapter after loading the interscroller ad or encountering an error. Returns an ad event object to send ad events to the Google Mobile Ads SDK. The block returns nil if a delegate couldn’t be created or if the block has already been called.
Declaration
Swift
typealias GADMediationInterscrollerAdLoadCompletionHandler = ((any GADMediationInterscrollerAd)?, (any Error)?) -> (any MediationBannerAdEventDelegate)?Objective-C
typedef id<GADMediationBannerAdEventDelegate> _Nullable ( ^GADMediationInterscrollerAdLoadCompletionHandler)( id<GADMediationInterscrollerAd> _Nullable, NSError *_Nullable) -
Called by the adapter after loading the interstitial ad or encountering an error. Returns an ad event delegate to send ad events to the Google Mobile Ads SDK. The block returns nil if a delegate couldn’t be created or if the block has already been called.
Declaration
Swift
typealias GADMediationInterstitialLoadCompletionHandler = ((any MediationInterstitialAd)?, (any Error)?) -> (any MediationInterstitialAdEventDelegate)?Objective-C
typedef id<GADMediationInterstitialAdEventDelegate> _Nullable ( ^GADMediationInterstitialLoadCompletionHandler)( id<GADMediationInterstitialAd> _Nullable, NSError *_Nullable) -
Called by the adapter after loading the native ad or encountering an error. Returns an ad event delegate to send ad events to the Google Mobile Ads SDK. The block returns nil if a delegate couldn’t be created or if the block has already been called.
Declaration
Swift
typealias GADMediationNativeLoadCompletionHandler = ((any MediationNativeAd)?, (any Error)?) -> (any MediationNativeAdEventDelegate)?Objective-C
typedef id<GADMediationNativeAdEventDelegate> _Nullable ( ^GADMediationNativeLoadCompletionHandler)( id<GADMediationNativeAd> _Nullable, NSError *_Nullable) -
Called by the adapter after loading the rewarded ad or encountering an error. Returns an ad event delegate to send ad events to the Google Mobile Ads SDK. The block returns nil if a delegate couldn’t be created or if the block has already been called.
Declaration
Swift
typealias GADMediationRewardedLoadCompletionHandler = ((any MediationRewardedAd)?, (any Error)?) -> (any MediationRewardedAdEventDelegate)?Objective-C
typedef id<GADMediationRewardedAdEventDelegate> _Nullable ( ^GADMediationRewardedLoadCompletionHandler)( id<GADMediationRewardedAd> _Nullable, NSError *_Nullable) -
Called by the adapter after loading the app open ad or encountering an error. Returns an ad event delegate to send ad events to the Google Mobile Ads SDK. The block returns nil if a delegate couldn’t be created or if the block has already been called.
Declaration
Swift
typealias GADMediationAppOpenLoadCompletionHandler = ((any MediationAppOpenAd)?, (any Error)?) -> (any MediationAppOpenAdEventDelegate)?Objective-C
typedef id<GADMediationAppOpenAdEventDelegate> _Nullable ( ^GADMediationAppOpenLoadCompletionHandler)( id<GADMediationAppOpenAd> _Nullable, NSError *_Nullable) -
Executes when adapter set up completes.
Declaration
Swift
typealias GADMediationAdapterSetUpCompletionBlock = ((any Error)?) -> VoidObjective-C
typedef void (^GADMediationAdapterSetUpCompletionBlock)(NSError *_Nullable) -
Version number information.
Declaration
Objective-C
typedef struct GADVersionNumber GADVersionNumber -
Completion handler for signal generation. Returns either signals or an error object.
Declaration
Swift
typealias GADRTBSignalCompletionHandler = (String?, (any Error)?) -> VoidObjective-C
typedef void (^GADRTBSignalCompletionHandler)(NSString *_Nullable, NSError *_Nullable)