Displaying Ads - Rewarded Video Ads

In order to properly implement rewarded video ads in your game using Homa Belly, you need to do those 3 things:

  • Suggesting the rewarded video
  • waiting for the rewarded video to load
  • Show the rewarded video

Suggesting a Rewarded Video Ad

Rewarded video ads have to be triggered by the player. Either by clicking a button, or interacting with specific elements in the game world.

Whenever this action is available to the player, you are suggesting the rewarded video to the player. When the menu with the button opens, or when the player starts the level the rewarded video element is in.

When a rewarded video is suggested, you need to call the following method:


// Don't forget to import the HomaBelly namespace
using HomaGames.HomaBelly;

Analytics.RewardedAdSuggested("[your ad name]");

ℹ️ If you are using high value ads, or a custom ad placement ID, you must specify as second parameter AdPlacementType,HighValue or AdPlacementType.User respectively.

The ad name correspond to the emplacement the player can take the rewarded video in. It will be used to differentiate those places in analytics.

Waiting for the ad to load

To know if a rewarded video ad is loaded, you can call:


HomaBelly.Instance.IsRewardedVideoAdAvailable();

You can also subscribe to Events.onRewardedVideoAvailabilityChangedEvent to be notified when the ad is loaded.

It is recommended that you show the loading of the ad to the user only after the user triggered the rewarded video.

For example in the case of a UI button, you can keep it as interactable even if the rewarded video is not loaded. Only when the player clicks on it, you will show a loading icon, asking them to wait a bit for the ad to show. Make sure to show the ad once it is loaded, only if the player is still in the button's menu!

Showing a Rewarded Video Ad

⚠️ You must show the ad only if it is available!

In order to show a rewarded video ad call:


HomaBelly.Instance.ShowRewardedVideoAd("[your ad name]");

The analytics system requires that the name you provide here is the same as the one you gave when suggesting the ad.

You can listen to callbacks from Events.onRewardedVideoAdStartedEvent and Events.onRewardedVideoAdRewardedEvent to know when the ad started showing, and when we received the ad reward respectively.

Multiple ad placement IDs

💡 This feature is only available from Homa Belly Core 1.6.2

⚠️ Only use this feature if asked by your project manager

In order to add a placement ID to load, call LoadExtraRewardedVideoAd


// Load an extra Rewarded video ad
HomaBelly.Instance.LoadExtraRewardedVideoAd("your_placement_id");

You will then need to pass this placement ID to methods you will be calling. For example to test if this extra ad ID has been loaded, you will need to call:


HomaBelly.Instance.IsRewardedVideoAdAvailable("your_placement_id");

High Value Ads

⚠️ Only use this feature if asked by your project manager

If properly configured in Homa Lab, you’ll be able to use the High Value Ads API.

High Value ads are just like regular ads, but have a different ad waterfall / ad network configurations. High value ads should be shown in priority, and more aggressively, when loaded, than regular ads.

You will find "high value" versions of all the rewarded video related methods. When you get a callback from the Events class, you can check the AdInfo.PlacementType to see if the callback is associated to regular ad placement or high value ad placement.

API Reference