event.payload

Type Table
Event adsRequest
Revision Release 2024.3703
Keywords ads, advertising, monetization, fuse, adsRequest, payload
See also adsRequest
fuse.*

Overview

When a user completes an action, for example accepts an offer or completes a task like watching a video, an adsRequest event will be dispatched to the listener function specified in fuse.init() with event.phase equal to "completed". At this point, the event.payload property (table) provides your app with the context of that action so it can behave accordingly.

Payload Values

The event.payload property is a table and the properties contained within depend on the event.type.

Rewarded Video

For a rewarded video, the event.type will be "rewarded" and event.payload will contain:

  • preRollMessageString message displayed when the reward is offered (before the video starts playing).
  • rewardMessageString message displayed when the reward is granted (when the video is completed).
  • rewardItemString name of the rewarded virtual currency/item.
  • rewardAmount — The rewarded virtual currency amount (number).
  • rewardItemId — The rewarded item ID (number) as specified in the Fuse Dashboard.

Virtual Goods Offer

For a virtual goods offer, the event.type will be "virtualGoodsOffer" and event.payload will contain:

  • purchaseCurrencyString name of the virtual currency used to make the purchase.
  • purchasePrice — The amount of virtual currency required to make the purchase (number).
  • itemNameString name of the offered virtual good.
  • itemAmount — The amount of the offered virtual good (number).
  • startTime — Start time of the offer (number).
  • endTime — End time of the offer (number).
  • currencyID — ID of the virtual currency used to make the purchase (number).
  • virtualGoodID — ID of the offered virtual good (number).

In-App Purchase Offer

For an in-app purchase offer, the event.type will be "iapOffer" and event.payload will contain:

  • productIDString ID of the in-app purchase.
  • productPrice — Price of the in-app purchase (number) (0 or the value in local currency if available, for example 2.99).
  • itemNameString The name of the offered item or currency.
  • itemAmount — The amount of the offered item or currency (number).
  • startTime — Start time of the offer (number).
  • endTime — End time of the offer (number).