Skip to content

3. Using the Heyzap Extension

Robin Schaafsma edited this page Mar 24, 2019 · 14 revisions

3.1. Requirements

  • General Requirements:

  • Stencyl 3.4 or above;

  • iOS Testing:

  • Mac OS X 10.9 (10.9 or higher recommended);

  • Xcode 8 (8.0 or higher recommended);

  • Android Testing:

  • Android device with Android 2.3.x or higher; NOTE: Android emulators are NOT recommended.

3.2. How to use the blocks

This extension contains the following blocks. You can find them in your Palette under the “Extension” tab.

Fill in your Publisher ID in the Toolset Manager
You can find your Publisher ID under your Account at Heyzap.
toolsetheyzap


Initialize Heyzap
heyzapinitialize
Use this block to initialize your Heyzap. Use this block once per user session (from the moment the user starts to play until the user quits the game). For example in a loading scene.


Fetch/Show Interstitial
heyzapfetchshowinterstitial
Use this block to fetch or show the interstitial or Video from heyzap, use fetch before you can show an Ad.

  • “Fetch”
  • “Show”

Fetch/Show Video
heyzapfetchshowvideo
Use this block to fetch or show the video ads from heyzap, use fetch before you can show an Ad.

  • “Fetch”
  • “Show”

Fetch/Show Rewarded Video
heyzapfetchshowvrewarded
Use this block to fetch or show the Rewarded video ads from heyzap, use fetch before you can show an Ad.

  • “Fetch”
  • “Show”

Show/Hide Banner
heyzapshowhidebanner
Use this block to Show or Hide the Banner ads from heyzap, by default the banner will be at the bottom.

  • “Show”
  • “Hide”

Move Banner
heyzapmovebanner
Use this block to move the banner to Bottom of Top. (You only need to call this function once).

  • “Bottom”
  • “Top”

Callbacks Interstitial
callbackinitializeheyzap
Use this block in an “if statement”. Each condition becomes TRUE when a specific event is happening. Before and after the event, the condition will always be FALSE.

  • “did successfully load”. It becomes TRUE when an Interstitial ad successfully loads.
  • “did fail to load”. It becomes TRUE when an Interstitial ad fails to load.
  • “is Closed”. It becomes TRUE when an Interstitial is closed (dismiss).
  • “is Clicked”. It becomes TRUE when an Interstitial ad is Clicked.
  • “is Showing”. It becomes TRUE when an Interstitial ad is Showing.

Callback Video
heyzapvideocallback
Use this block in an “if statement”. Each condition becomes TRUE when a specific event is happening. Before and after the event, the condition will always be FALSE.

  • “did successfully load”. It becomes TRUE when an Interstitial ad successfully loads.
  • “did fail to load”. It becomes TRUE when an Interstitial ad fails to load.
  • “is Closed”. It becomes TRUE when an Interstitial is closed (dismiss).
  • “is Clicked”. It becomes TRUE when an Interstitial ad is Clicked.
  • “is Showing”. It becomes TRUE when an Interstitial ad is Showing.

Callbacks Rewarded Video
callbackrewardedheyzap
Use this block in an “if statement”. Each condition becomes TRUE when a specific event is happening. Before and after the event, the condition will always be FALSE.

  • “did successfully load”. It becomes TRUE when an Interstitial ad successfully loads.
  • “did fail to load”. It becomes TRUE when an Interstitial ad fails to load.
  • “is Closed”. It becomes TRUE when an Interstitial is closed (dismiss).
  • “is Clicked”. It becomes TRUE when an Interstitial ad is Clicked.
  • “is Showing”. It becomes TRUE when an Interstitial ad is Showing.
  • “has been fully watched” It becomes TRUE when an Rewarded Video ad is fully watched.
  • “has not been fully watched” It becomes TRUE when an Rewarded Video ad is not fully watched.

Callback Banner
heyzapbannercallback
Use this block in an “if statement”. Each condition becomes TRUE when a specific event is happening. Before and after the event, the condition will always be FALSE.

  • “did successfully load”. It becomes TRUE when an Interstitial ad successfully loads.
  • “did fail to load”. It becomes TRUE when an Interstitial ad fails to load.

Test SDK (Debug only)
sdktestheyzap
Use this block to test if SDK is of 3rd party is installed. (Put it under a button)
Remove this block when you publish your game.


Set/Get Consent value (for Europe users only)

Set Consent
setconsent

If you want to set the consent programmatically you can use this block.
YES: Yes, i agree to personalized experience.
NO: No, I do not want personalized experience.
Go to https://www.fyber.com/gdpr-faqs/ for more information.

Get Consent
setconsent
Return true(YES) if consent is set to YES and return false(NO) when consent is set to NO.

If you want to check if a user is in Europe, you can use the "User is in Continent: Europe" boolean block from https://byrobingames.github.io


Example:

Initialize Heyzap in your first scene (loading scene)
heyzapinitialize

Fetch/Show Interstitial when a actor is pressed or you can place it when created Event of a scene.
hyezapexamplefetchinterstitial
hyezapexampleshowinterstitial

Callbacks Interstitial in when updated event of the scene where the interstitial ad is shown
Heyzapbooleans