AI-generated Key Takeaways
-
GADPresentationErrorCode
is an enum representing errors that can occur when presenting ads in the Google Mobile Ads SDK. -
These errors can include scenarios like the ad not being ready, being too large for the display, or having already been used.
-
Internal errors and issues stemming from mediation ad networks are also covered by this error enum.
-
Each error code has a corresponding integer value and is available in both Swift and Objective-C.
-
Ad presentation attempts made from threads other than the main thread will result in a
GADPresentationErrorNotMainThread
error.
GADPresentationErrorCode
enum GADPresentationErrorCode : NSInteger {}
Error codes in the Google Mobile Ads SDK domain that surface due to errors when attempting to present an ad.
-
Ad isn’t ready to be shown.
Declaration
Swift
case codeAdNotReady = 15
Objective-C
GADPresentationErrorCodeAdNotReady = 15
-
Ad is too large for the scene.
Declaration
Swift
case codeAdTooLarge = 16
Objective-C
GADPresentationErrorCodeAdTooLarge = 16
-
Internal error.
Declaration
Swift
case codeInternal = 17
Objective-C
GADPresentationErrorCodeInternal = 17
-
Ad has already been used.
Declaration
Swift
case codeAdAlreadyUsed = 18
Objective-C
GADPresentationErrorCodeAdAlreadyUsed = 18
-
Attempted to present ad from a non-main thread.
Declaration
Swift
case notMainThread = 21
Objective-C
GADPresentationErrorNotMainThread = 21
-
A mediation ad network adapter failed to present the ad. The adapter’s error is included as an underlyingError.
Declaration
Swift
case mediation = 22
Objective-C
GADPresentationErrorMediation = 22