interface IRewardParams {
    adBreakDone?: ((placementInfo: IPlacementInfo) => void);
    adDismissed: (() => void);
    adViewed: (() => void);
    afterAd?: (() => void);
    beforeAd?: (() => void);
    beforeReward: ((showAdFn: (() => void)) => void);
    name?: string;
    type: "reward";
}

Properties

adBreakDone?: ((placementInfo: IPlacementInfo) => void)

(OPTIONAL) Always called as the last step in an adBreak(), even if there was no ad shown. Function takes as argument a placementInfo object defined

Type declaration

    • (placementInfo): void
    • Parameters

      Returns void

adDismissed: (() => void)

Called only for rewarded ads when the player dismisses the ad. It is only called if the player dismisses the ad before it completes. In this case the reward should not be granted.

Type declaration

    • (): void
    • Returns void

adViewed: (() => void)

Called only for rewarded ads when the player completes the ad and should be granted the reward.

Type declaration

    • (): void
    • Returns void

afterAd?: (() => void)

(OPTIONAL) Called after the ad is finished (for any reason). For rewarded ads, it is called after either adDismissed or adViewed, depending on player actions. This function should be used to resume game flow. For example, use to unmute the sound and start the next level.

Type declaration

    • (): void
    • Returns void

beforeAd?: (() => void)

(OPTIONAL) Called before the ad is displayed. The game should pause and mute the sound. These actions must be done synchronously. The ad will be displayed immediately after this callback finishes.

Type declaration

    • (): void
    • Returns void

beforeReward: ((showAdFn: (() => void)) => void)

Called if a rewarded ad is available. The function should take a single argument–showAdFn() which must be called to display the rewarded ad.

Type declaration

    • (showAdFn): void
    • Parameters

      • showAdFn: (() => void)
          • (): void
          • Returns void

      Returns void

name?: string

(OPTIONAL) a name for this particular ad placement within your game. It is an internal identifier, and is not shown to the player. In future releases this identifier may be used to enable additional reporting and optimization features.

We recommend you name all of your placements.

type

'reward' a rewarded ad