YMAInterstitialAdDelegate
Objective-C
@protocol YMAInterstitialAdDelegate <NSObject>
Swift
protocol YMAInterstitialAdDelegate : NSObjectProtocol
The protocol defines the methods of the delegate that tracks ads. Methods are called by an object of the YMAInterstitialAd
class when its state changes.
- Methods
- -interstitialAdDidLoad:
- -interstitialAdDidFailToLoad:error:
- -interstitialAdWillLeaveApplication:
- -interstitialAdDidFailToPresent:error:
- -interstitialAdWillAppear:
- -interstitialAdDidAppear:
- -interstitialAdWillDisappear:
- -interstitialAdDidDisappear:
- -interstitialAdDidClick:
- -interstitialAd:willPresentScreen:
- -interstitialAd:didTrackImpressionWithData:
Notifies that the ad loaded successfully.
Declaration
Objective-C
- (void)interstitialAdDidLoad:(nonnull YMAInterstitialAd *)interstitialAd;
Swift
optional func interstitialAdDidLoad(_ interstitialAd: YMAInterstitialAd)
Parameters
interstitialAd | A reference to the object of the |
interstitialAd | A reference to the object of the |
Notifies that the ad failed to load.
Declaration
Objective-C
- (void)interstitialAdDidFailToLoad:(nonnull YMAInterstitialAd *)interstitialAd
error:(nonnull NSError *)error;
Swift
optional func interstitialAdDidFail(toLoad interstitialAd: YMAInterstitialAd, error: Error)
Parameters
interstitialAd | A reference to the object of the |
error | Information about the error (for details, see |
interstitialAd | A reference to the object of the |
error | Information about the error (for details, see |
Notifies that the app will run in the background now because the user clicked on the ad and is about to switch to a different app (Phone, App Store, and so on).
Declaration
Objective-C
- (void)interstitialAdWillLeaveApplication:
(nonnull YMAInterstitialAd *)interstitialAd;
Swift
optional func interstitialAdWillLeaveApplication(_ interstitialAd: YMAInterstitialAd)
Parameters
interstitialAd | A reference to the object of the |
interstitialAd | A reference to the object of the |
Notifies that the ad can’t be displayed.
Declaration
Objective-C
- (void)interstitialAdDidFailToPresent:
(nonnull YMAInterstitialAd *)interstitialAd
error:(nonnull NSError *)error;
Swift
optional func interstitialAdDidFail(toPresent interstitialAd: YMAInterstitialAd, error: Error)
Parameters
interstitialAd | A reference to the object of the |
error | Information about the error (for details, see |
interstitialAd | A reference to the object of the |
error | Information about the error (for details, see |
Called before the interstitial ad appears.
Declaration
Objective-C
- (void)interstitialAdWillAppear:(nonnull YMAInterstitialAd *)interstitialAd;
Swift
optional func interstitialAdWillAppear(_ interstitialAd: YMAInterstitialAd)
Parameters
interstitialAd | A reference to the object of the |
interstitialAd | A reference to the object of the |
Called after the interstitial ad appears.
Declaration
Objective-C
- (void)interstitialAdDidAppear:(nonnull YMAInterstitialAd *)interstitialAd;
Swift
optional func interstitialAdDidAppear(_ interstitialAd: YMAInterstitialAd)
Parameters
interstitialAd | A reference to the object of the |
interstitialAd | A reference to the object of the |
Called before hiding the interstitial ad.
Declaration
Objective-C
- (void)interstitialAdWillDisappear:(nonnull YMAInterstitialAd *)interstitialAd;
Swift
optional func interstitialAdWillDisappear(_ interstitialAd: YMAInterstitialAd)
Parameters
interstitialAd | A reference to the object of the |
interstitialAd | A reference to the object of the |
Called after hiding the interstitial ad.
Declaration
Objective-C
- (void)interstitialAdDidDisappear:(nonnull YMAInterstitialAd *)interstitialAd;
Swift
optional func interstitialAdDidDisappear(_ interstitialAd: YMAInterstitialAd)
Parameters
interstitialAd | A reference to the object of the |
interstitialAd | A reference to the object of the |
Notifies that the user clicked on the ad.
Declaration
Objective-C
- (void)interstitialAdDidClick:(nonnull YMAInterstitialAd *)interstitialAd;
Swift
optional func interstitialAdDidClick(_ interstitialAd: YMAInterstitialAd)
Parameters
interstitialAd | A reference to the object of the |
interstitialAd | A reference to the object of the |
Notifies that the in-app browser will be displayed.
Declaration
Objective-C
- (void)interstitialAd:(nonnull YMAInterstitialAd *)interstitialAd
willPresentScreen:(nullable UIViewController *)webBrowser;
Swift
optional func interstitialAd(_ interstitialAd: YMAInterstitialAd, willPresentScreen webBrowser: UIViewController?)
Parameters
interstitialAd | A reference to the object of the |
webBrowser | The in-app browser. |
interstitialAd | A reference to the object of the |
webBrowser | The in-app browser. |
It’s called when an ad impression has been counted.
Declaration
Objective-C
- (void)interstitialAd:(nonnull YMAInterstitialAd *)interstitialAd
didTrackImpressionWithData:(nullable id<YMAImpressionData>)impressionData;
Parameters
interstitialAd | A reference to the object of the |
impressionData | Revenue data at the level of ad impressions. |
interstitialAd | A reference to the object of the |
impressionData | Revenue data at the level of ad impressions. |