Rewarded Video #

Rewarded videos can be used to open chests early in Squad Alpha by Say Games.
Rewarded videos can be used to open chests early in Squad Alpha by Say Games.

Rewarded video - Placements in Hiro - is a way for players to obtain rewards, such as in-game currency, collectables or consumables, or energy, by watching video ads.

Using the GDK you can track the start, status, and completion of ads watched by users, defining rewarded video placements and then granting rewards to players when they finish watching a video ad.

Hiro supports IronSrc server-side webhooks for authoritative reward grants, and also provides for fallback reward grants when user connections cause slow or unreliable webhook calls.

See the customization parameters for placements here.

Listing available placements #

You can list available placements.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
foreach (var placement in economySystem.Placements)
{
    Debug.Log($"Placement {placement.Id}. Rewards:");
    
    foreach (var currency in placement.Reward.Currencies)
    {
        Debug.Log($"{currency.Key}: {currency.Value}");
    }
    
    foreach (var energy in placement.Reward.Energies)
    {
        Debug.Log($"{energy.Key}: {energy.Value}");
    }
}

Starting a placement #

You can start a placement for the user.

1
2
var placementStatus = await economySystem.PlacementStartAsync("<placementId1>");
Debug.Log($"Placement {placementStatus.PlacementId} created at {placementStatus.CreateTime}");

Getting a placement status #

You can get the status for a placement.

1
2
var attemptCount = 1;
var placementStatus = await economySystem.PlacementStatusAsync("<placementId1>", "<rewardId1>", attemptCount);

You can optionally poll for a placement status instead.

1
2
3
uint attempts = 5u;
uint interval = 5000u;
economySystem.PollPlacementStatusAsync("<placementId1>", "<rewardId1>", attempts, interval);