addEventListener(event_type, callback)

Mtx events

This method can be used to listen for events related to the incentivized advertising API

The addEventListener method takes two arguments, the event type, and a callback function:

Name

Type

Description

event_type

String

Type of event to listen for

callback

Function

Function to call when the event is triggered

Incentivized ad events

The following event types are currently supported:

Name

Description

adsAvailable

Ads are now available, and showIncentivizedAd will work

adsUnavailable

Ads are not available, and showIncentivizedAd will fail

adOpened

An ad is being displayed

adCompleted

An ad has completed successfully, and the player should be rewarded

adAbandoned

Ad ad has been closed before completion, the player should not be rewarded

Related: