YMANativeAdDelegate
Objective-C
@protocol YMANativeAdDelegate <NSObject>
Swift
protocol YMANativeAdDelegate : NSObjectProtocol
The protocol defines the methods of the delegate that monitors native ads.
- Methods
- -viewControllerForPresentingModalView
- -nativeAdDidClick:
- -nativeAdWillLeaveApplication:
- -nativeAd:willPresentScreen:
- -nativeAd:didDismissScreen:
- -nativeAd:didTrackImpressionWithData:
- -closeNativeAd:
UIViewController
object that is used for showing a modal controller in response to the user’s interaction with the banner.
Declaration
Objective-C
- (nullable UIViewController *)viewControllerForPresentingModalView;
Swift
optional func viewControllerForPresentingModalView() -> UIViewController?
Return Value
UIViewController
object that is used for showing a modal controller in response to the user’s interaction with the banner.
Notifies that the user clicked on the ad.
Declaration
Objective-C
- (void)nativeAdDidClick:(nonnull id<YMANativeAd>)ad;
Parameters
ad | A reference to the object that invoked the method. |
ad | A reference to the object that invoked the method. |
Notifies that the user switched from the ad to an app (for example, the browser).
Declaration
Objective-C
- (void)nativeAdWillLeaveApplication:(nonnull id<YMANativeAd>)ad;
Parameters
ad | A reference to the object that invoked the method. |
ad | A reference to the object that invoked the method. |
Notifies that the ad will show the modal UIViewController
in response to the user interacting with the banner.
Declaration
Objective-C
- (void)nativeAd:(nonnull id<YMANativeAd>)ad
willPresentScreen:(nullable UIViewController *)viewController;
Parameters
ad | A reference to the object that invoked the method. |
viewController | Modal |
ad | A reference to the object that invoked the method. |
viewController | Modal |
Notifies that the ad finished showing the modal UIViewController
in response to the user interacting with the banner.
Declaration
Objective-C
- (void)nativeAd:(nonnull id<YMANativeAd>)ad
didDismissScreen:(nullable UIViewController *)viewController;
Parameters
ad | A reference to the object that invoked the method. |
viewController | Modal |
ad | A reference to the object that invoked the method. |
viewController | Modal |
It’s called when an ad impression has been counted.
Declaration
Objective-C
- (void)nativeAd:(nonnull id<YMANativeAd>)ad
didTrackImpressionWithData:(nullable id<YMAImpressionData>)impressionData;
Parameters
ad | A reference to the object of the |
impressionData | Revenue data at the level of ad impressions. |
ad | A reference to the object of the |
impressionData | Revenue data at the level of ad impressions. |
Notifies that the user has chosen a reason for closing the ad and the ad must be hidden.
Ads won’t be hidden. The developer must determine what to do with the ad after the reason for closing it is chosen.
Declaration
Objective-C
- (void)closeNativeAd:(nonnull id<YMANativeAd>)ad;
Parameters
ad | A reference to the object that invoked the method. |
ad | A reference to the object that invoked the method. |