SDK
Ads
Ask for an ad break; VPlay shows the ad, pauses your game and resumes it.
Games on VPlay show only VaryGaming's ads. Do not add any other ad network or ad code (AdSense or AdMob of your own, GameMonetize, GameDistribution, CrazyGames, Poki, Unity Ads, AppLovin, or any other). We scan every game for third-party ads before it goes live, and a game found running its own ads is switched off.
Ask for an ad break with VPlay.ads.show. VPlay decides whether and when, shows its own ad (the Android app's AdMob, or AdSense for games on the web where available), pauses your game with a pause event, and resumes it with resume.
JavaScript
// Between levels:
if (VPlay.ads.available("interstitial")) {
await VPlay.ads.show({ type: "interstitial", placement: "level_end" });
}
// Opt-in bonus ("watch an ad for an extra life"):
if (VPlay.ads.available("rewarded")) {
const r = await VPlay.ads.show({ type: "rewarded", placement: "extra_life" });
if (r.rewarded) grantExtraLife(); // VPlay paused your game and resumed it for you
}| status | Meaning |
|---|---|
completed | The ad ran to the end. |
skipped | The player closed it early. |
unavailable | No ad right now: nothing filled, not consented, switched off, or an older host. Normal and frequent: carry on. |
cooldown | Too soon after the last ad, or another sheet is open. VPlay decides this, not your game. |
error | Something went wrong; treat it as no ad. |
rewardedis true only when a rewarded ad ran to the end. Then give your own in-game reward. Offer rewarded ads only as the player's choice.- Use interstitials at natural breaks (between levels), never mid-action. An interstitial is refused in the first 45 seconds of a session and within 2 minutes of the last ad.
- Ask
VPlay.ads.available(type)when you draw a button; ads can be switched off or unavailable on a device at any time.
