Rewarded Ads - GameDistribution/GD-HTML5 GitHub Wiki

To be able to use rewarded ads feature of SDK, firstly, SDK Integration is supposed to be handled. Follow the instructions in here.

Rewarded Ads

Users can watch an in-game video and receive rewards (like in-game currency, premium content, extra lives and credits, etc) in return. For detailed explanations: Rewarded Ads are here!

Recommended way of using rewarded ads is preloading the ad first and show it when your user wants to get a reward. showAd('rewarded') method preload ad if exists. Otherwise, it will request a new one and show it as soon as it gathers one.

if (gdsdk !== 'undefined' && gdsdk.preloadAd !== 'undefined') {
  gdsdk
    .preloadAd('rewarded')
    .then(response => {
      // A rewarded ad can be shown to user when he/she clicked it.
    })
    .catch(error => {
      // Any Rewarded ad is not available to user.
    });
}

showRewardedAdButton.addEventListener("click", () => {
  if (gdsdk !== 'undefined' && gdsdk.showAd !== 'undefined') {
    gdsdk.showAd('rewarded')
    .then(response => {
      // Ad process done. You can track "SDK_REWARDED_WATCH_COMPLETE" event if that event triggered, that means the user watched the advertisement completely, you can give reward there.
    })
    .catch(error => {
      // An error catched. Please don't give reward here.
    });
  }
});

IMPORTANT: DO NOT FORGET TO CHECK REWARDED ADS FLAG on https://developer.gamedistribution.com for your game. Otherwise, your game is unable to request rewarded ads.

Best Practice for Rewarded Ads

You can use multiple ad slots for rewarded ads and give your players multiple way of gathering rewards. Samples below is very nice way of implementing this feature.

Also, check Superhero.io game to see how rewarded ads are implemented.

Let them watch an ad to increase their attacks!

No coin no pain? Oh, it is not. Let them gain some free coins.

Who doesn't want a second chance?

Your players can take their chances to gain some buffs!

You can give away some daily gifts to your players.