ads_set_reward_callback

Set the reward callback script for PlayHaven interstitial.

Syntax:

GML Code Example

ads_set_reward_callback(placement)


Argument Description
placement The PlayHaven placement name (a string)


Returns: N/A


Description

When generating content for the user using PlayHaven, the content can return callback values to your game, depending on what content it is and what rewards 8if any) are associated with it. To deal with this, you should create a script resource into which GameMaker: Studio will automatically pass the return arguments:

  • argument0 - A real number that represents the quantity/value returned by PlayHaven. -1 means that the interstitial was closed by the user without any action being taken.
  • argument1 - A string that contains the reward name as defined by you in the PlayHaven dashboard.

In this way with one single script you can reward the player with in game currency, items, etc... depending on the quantity returned and the reward name used.


Example:

GML Code Example

ads_set_reward_callback(scr_AdsCallback);
 ads_event("game_start");

The above code will set the callback script and then request an ad from PlayHaven for the placement named "game_start".





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here