Showing Interstitial and Rewarded Ads

When you’re ready to show an ad, you can check that it’s ready to show and then display it like so:

if ([self.interstitialAd readyToShow]) {
  [self.interstitialAd showAdWithViewController:self];
}
else {
  //when there’s no Helium Ad ready to show immediately,
  //fall through to your chosen backup behavior
  [self.interstitialAd loadAd];
}
 
if ([self.rewardedAd readyToShow]) {
  [self.rewardedAd showAdWithViewController:self];
}
else {
  //when there’s no Helium Ad ready to show immediately,
  //fall through to your chosen backup behavior
  [self.rewardedAd loadAd];
}

If the readyToShow response comes back negative, this can be a good opportunity to gracefully recover by making a new attempt to load a Mediation Ad as well as implement any fall through behavior you desire.

You can implement CHBHeliumInterstitialAdDelegate or CHBHeliumRewardedAdDelegate in your class to receive notifications about the lifecycle of the ad display process. See section Delegate Usage for more details.

Showing Banner Ads

When you’re ready to show a banner ad, you can check that it’s ready to show and then display it like so:

/// Banner ads are now automatically shown. All that you need to do
/// is add it to the view hierarchy.
[self.view addSubview:self.bannerAd];
if ([self.bannerAd readyToShow]) {
    // Remember to attach the banner to your View Controller Layout.
    // Show the banner
    [self.bannerAd showAdWithViewController:self.parentViewController];
} else {
  //when there’s no Helium Ad ready to show immediately,
  //fall through to your chosen backup behavior
}

If you enable auto-refresh for a banner placement in the dashboard, then the Mediation SDK will apply that setting when the placement is shown.

Any auto refresh changes made on the dashboard will take approximately one hour to take effect and the SDK must be rebooted in order to pick up the changes once they're available.

Releasing Mediation Ads

To clear resources used by Mediation Ads, you can use the destroy method associated with the respective Mediation Ad you have used.

// Example of Releasing Banner Ads
if (self.bannerAd) {
      [self.bannerAd removeFromSuperview];
      self.bannerAd = nil;
      self.bannerConstraints = nil;
}