Interstitial ads

An interstitial ad is a configurable ad that covers the entire screen and responds to clicks.

To enable advertising:

  1. Add the import:

    #import <YandexMobileAds/YandexMobileAds.h>
  2. Create @property where the link to the banner ad will be stored:

    @property (nonatomic, strong) YMAInterstitialController *interstitialAd;
  3. Perform initialization and pre-loading of the ad. This must be performed after displaying the app interface.

    Optionally, you can use the YMAAdRequest class to transmit the data for targeting.

    self.interstitialAd = [[YMAInterstitialController alloc] initWithBlockID:<your unique BlockID>];
    self.interstitialAd.delegate = self;[self.interstitialAd load];
    Block ID is a unique identifier in the adf-XXXXXX/YYYYYY format, which is assigned in the Partner interface.
    Attention.

    In the mobile mediation interface, the Block ID is called the location ID.

    In addition, self must conform to the YMAInterstitialDelegate protocol. The ad must be pre-loaded in the same orientation as it will be shown (otherwise, the ad will not be shown because the banner size won't match the screen size).

  4. Start displaying ads by using this method:

    - (void)interstitialDidLoadAd:(YMAInterstitialController *)interstitial
         {
             [interstitial presentInterstitialFromViewController:self];
         }
  5. You can optionally enable logging by using the enableLogging method. If an impression wasn't registered, a message appears in the console.

To find out why ads aren't working correctly, use the method

- (void)interstitialDidFailToLoadAd:(YMAInterstitialController *)interstitial error:(NSError *)error;

For error descriptions, see YMAAdErrorCode.