Implement ad monetization
HyperKit covers all ad monetization needs out of the box, no additional configuration is necessary. Each ad format serves different purposes and should be implemented strategically throughout your game to maximize revenue while maintaining a positive user experience.
Below you will find code snippets for each ad format supported by HyperKit:
Banner
Section titled “Banner”Banner ads are reloaded automatically, all you have to do is toggle the visibility.
Example code:
// To show the bannerHyperKit.Ads.ShowBanner();
// To hide the bannerHyperKit.Ads.HideBanner();Interstitial
Section titled “Interstitial”Interstitial ads are being loaded automatically, you just need to trigger the ad to be shown.
Example code:
using Services.Analytics.Models;
HyperKit.Ads.ShowInterstitial("interstitial-id",new LevelContext("main", levelNumber, $"main_{levelNumber}"),result =>{ statusText.text = result ? "Interstitial was shown properly" : "Interstitial was not shown";});Rewarded
Section titled “Rewarded”Rewarded ads are being loaded automatically, you just need to trigger the ad to be shown.
It’s also a common practice to check for rewarded ads to be available before showing that option to the user.
using Services.Analytics.Models;
if (HyperKit.Ads.IsRewardedAdReady()){ statusText.text = "Rewarded requested";
HyperKit.Ads.ShowRewardedAd("rewarded-id", result => { statusText.text = result ? "Rewarded OK" : "Rewarded not shown"; }, new LevelContext("main", levelNumber, $"main_{levelNumber}"));}else{ statusText.text = "Rewarded not ready";}MREC ads are reloaded automatically, all you have to do is toggle the visibility.
Example code:
// To show the MRECHyperKit.Ads.ShowMrec();
// To hide the MRECHyperKit.Ads.HideMrec();