Like occurs with banners, a listener can be set to receive the events that happen during the interstitial lifecycle. For this, it is needed to implement the WAInterstitialDelegate interface just as shown in the example below:
extension ViewController : WAInterstitialDelegate {
func didClick(interstitialAd: WAInterstitialAd) {
// Invoked when the ad has been clicked
}
func didDismiss(interstitialAd: WAInterstitialAd) {
// Invoked when the ad has been dismissed
}
func didFailToLoad(interstitialAd: WAInterstitialAd, error: WAAdError) {
// Invoked when the ad could not be loaded
// (because of an error or no fill)
}
func didFailToShow(interstitialAdenAd: WAInterstitialAd, error: WAAdError) {
// Invoked when the ad could not be shown
}
func didImpress(interstitialAd: WAInterstitialAd) {
// Invoked when the ad has generated an impression
}
func didLoad(interstitialAd: WAInterstitialAd) {
// Invoked when the ad has been loaded
}
func didShow(interstitialAd: WAInterstitialAd) {
// Invoked when the ad has been shown
}
}
Once the interface is implemented, the delegate is assigned to the ad instance: