Ad break method

break(
  o: {
     type: '<type>',
     name: '<name>',
     beforeAd: () => {},
     afterAd: () => {},
     beforeReward: (showAdFn) => {},
     adDismissed: () => {},
     adViewed: () => {},
     adBreakDone: (placementInfo) => {},
  }
): void;

Places interstitial and rewarded ads in your game.

This method wraps adBreak from the Ad Placement API and supports the same parameter. o should be an object containing the parameters of adBreak.

For more details see Ad Placement API Documentation

Note

Parameters like beforeReward, adDismissed, adViewed are rewarded ads only.

Your game shouldn't inject adsbygoogle.js or use the Ad Placement API directly.

Requirements

See monetization requirements.

Examples

Interstitial ad between levels:

GameSnacks.ad.break({type: 'next', ...});

Rewarded ad:

GameSnacks.ad.break({type: 'reward', ...});