AI Integration Agent Instructions for Interstitial Ads
Gotchas
Google Mobile Ads SDK uses NS_SWIFT_NAME macros to provide idiomatic Swift
names.
Interstitial ad workflow
Load the ad
- For Swift code, use
async/awaitinstead of a completion handler.
- For Swift code, use
Register for ad event callbacks
- Set the
fullScreenContentDelegateon theInterstitialAdobject.- Drop the reference to the interstitial ad when the ad is dismissed or fails to show.
- Set the
Show the ad
- ViewController Parameter: The
rootViewControllerparameter in thepresent(from:)method is an optional parameter and can be set tonil.
- ViewController Parameter: The
Verify the implementation: Verify the build to ensure there are no compile errors:
- If
xcodebuildis available: Runxcodebuildto programmatically verify that the iOS project compiles properly with the GMA SDK. Resolve any GMA-SDK related compile errors. - If
xcodebuildis NOT available: Output instructions directing the user to build the project in Xcode and manually verify there are no compile errors.
- If
Links
Additional documentation: