/// <summary> /// Starts the Heyzap SDK. Call this method as soon as possible in your app to ensure Heyzap has time to initialize before you want to show an ad. /// </summary> /// <param name="publisher_id">Your publisher ID. This can be found on your Heyzap dashboards - see https://developers.heyzap.com/docs/unity_sdk_setup_and_requirements for more information.</param> /// <param name="options">A bitmask of options you can pass to this call to change the way Heyzap will work.</param> public static void Start(string publisher_id, int options) { #if !UNITY_EDITOR #if UNITY_ANDROID HeyzapAdsAndroid.Start(publisher_id, options); #endif #if UNITY_IPHONE HeyzapAdsIOS.Start(publisher_id, options); #endif HeyzapAds.InitReceiver(); HZInterstitialAd.InitReceiver(); HZVideoAd.InitReceiver(); HZIncentivizedAd.InitReceiver(); HZBannerAd.InitReceiver(); #endif }
/// <summary> /// Starts the Heyzap SDK. Call this method as soon as possible in your app to ensure Heyzap has time to initialize before you want to show an ad. /// </summary> /// <param name="publisher_id">Your publisher ID. This can be found on your Heyzap dashboards - see https://developers.heyzap.com/docs/unity_sdk_setup_and_requirements for more information.</param> /// <param name="options">A bitmask of options you can pass to this call to change the way Heyzap will work.</param> public static void Start(string publisher_id, int options) { #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE) #if UNITY_ANDROID HeyzapAdsAndroid.Start(publisher_id, options); #elif UNITY_IPHONE HeyzapAdsIOS.Start(publisher_id, options); #endif #else UnityEngine.Debug.LogError("Call received to start the Heyzap SDK, but the SDK does not function in the editor. You must use a device/emulator to receive/test ads."); #endif HeyzapAds.InitReceiver(); HZInterstitialAd.InitReceiver(); HZVideoAd.InitReceiver(); HZIncentivizedAd.InitReceiver(); HZBannerAd.InitReceiver(); HZDemographics.InitReceiver(); }
//provided since JS can't use default parameters /// <summary> /// Fetches an ad for the default ad tag. /// </summary> public static void Fetch() { HZVideoAd.Fetch(null); }
protected static IEnumerator InvokeCallbackNextFrame(string state, string tag) { yield return(null); // wait a frame HZVideoAd.SetCallbackStateAndTag(state, tag); }
//provided since JS can't use default parameters /// <summary> /// Shows an ad with the default options. /// </summary> public static void Show() { HZVideoAd.ShowWithOptions(null); }
//provided since JS can't use default parameters /// <summary> /// Returns whether or not an ad is available for the default ad tag. /// </summary> /// <returns><c>true</c>, if an ad is available, <c>false</c> otherwise.</returns> public static bool IsAvailable() { return(HZVideoAd.IsAvailable(null)); }
public void SetCallback(string message) { string[] displayStateParams = message.Split(','); HZVideoAd.SetCallbackStateAndTag(displayStateParams[0], displayStateParams[1]); }
public static void fetch(string tag) { HZVideoAd.Fetch(tag); }
public static void InitReceiver(){ if (_instance == null) { GameObject receiverObject = new GameObject("HZVideoAd"); DontDestroyOnLoad(receiverObject); _instance = receiverObject.AddComponent<HZVideoAd>(); } }
public static void fetch() { HZVideoAd.Fetch(); }
public static void setDisplayListener(HZVideoAd.AdDisplayListener listener) { HZVideoAd.SetDisplayListener(listener); }
public static bool isAvailable(string tag) { return(HZVideoAd.IsAvailable(tag)); }
public static bool isAvailable() { return(HZVideoAd.IsAvailable()); }
public static void show() { HZVideoAd.Show(); }