void purchaseSuccessfulEvent(StoreKitTransaction transaction) { if (transaction.productIdentifier == Constants.PRODUCT_ID) { HZBannerAd.hide(); Main.Instance.isNoAdsPurchased = true; PlayerPrefs.SetBool(Constants.KEY_NOADS, Main.Instance.isNoAdsPurchased); PlayerPrefs.Flush(); if (Main.Instance.isNoAdsPurchased) { if (noAddButtonHome != null) { noAddButtonHome.interactable = false; } } if (Main.Instance.isNoAdsPurchased) { if (noAddButtonGameOver != null) { noAddButtonGameOver.interactable = false; } } } }
//------------------------------------------------------------ // Init. //------------------------------------------------------------ public void Init(AdSettings settings) { #if EM_HEYZAP if (isInitialized) { Debug.Log("Heyzap client is already initialized. Ignoring this call."); return; } // Store a reference to the global settings. globalAdSettings = settings; // Start Heyzap with no automatic fetching since we'll handle ad loading. HeyzapAds.Start(globalAdSettings.HeyzapPublisherId, HeyzapAds.FLAG_DISABLE_AUTOMATIC_FETCHING); // Add callback handlers HZBannerAd.SetDisplayListener(BannerAdCallback); HZInterstitialAd.SetDisplayListener(InterstitialAdCallback); HZIncentivizedAd.SetDisplayListener(RewardedAdCallback); isInitialized = true; Debug.Log("Heyzap client has been initialized."); #else Debug.LogError(NO_SDK_MESSAGE); #endif }
/// <summary> /// Show Heyzap banner /// </summary> /// <param name="position"> can be TOP of BOTTOM</param> /// <param name="bannerType"> it is not used in Heyzap, this param is used just in Admob implementation</param> public void ShowBanner(BannerPosition position, BannerType bannerType, UnityAction <bool, BannerPosition, BannerType> DisplayResult) { bannerUsed = true; this.position = position; this.bannerType = bannerType; this.DisplayResult = DisplayResult; if (IsBannerAvailable()) { HZBannerShowOptions showOptions = new HZBannerShowOptions(); if (position == BannerPosition.TOP) { showOptions.Position = HZBannerShowOptions.POSITION_TOP; } else if (position == BannerPosition.BOTTOM) { showOptions.Position = HZBannerShowOptions.POSITION_BOTTOM; } if (debug) { Debug.Log(this + " Show Banner"); ScreenWriter.Write(this + " Show Banner"); } HZBannerAd.ShowWithOptions(showOptions); } }
void purchaseSuccessfulEvent(StoreKitTransaction transaction) { if (transaction.productIdentifier == Constants.PRODUCT_ID) { // Debug.Log("Product purchased"); HZBannerAd.Hide(); Main.Instance.isNoads = true; PlayerPrefs.SetBool(Constants.NO_ADS, Main.Instance.isNoads); PlayerPrefs.Flush(); if (isRestoring) { CreateAlertForRestore("Purchase Restored", "Ads removed", "Ok"); } // if(Main.Instance.isNoads) // { // if(noAddButtonHome != null) // { // noAddButtonHome.interactable = false; // } // } // } }
protected override void InternalInit() { #if EM_HEYZAP // Store a reference to the global settings. mGlobalAdSettings = EM_Settings.Advertising.Heyzap; // Set GPDR consent (if any) *before* starting the SDK // https://developers.heyzap.com/docs/unity_sdk_setup_and_requirements var consent = GetApplicableDataPrivacyConsent(); ApplyDataPrivacyConsent(consent); // Start Heyzap with no automatic fetching since we'll handle ad loading. HeyzapAds.Start(mGlobalAdSettings.PublisherId, HeyzapAds.FLAG_DISABLE_AUTOMATIC_FETCHING); // Add callback handlers HZBannerAd.SetDisplayListener(BannerAdCallback); HZInterstitialAd.SetDisplayListener(InterstitialAdCallback); HZIncentivizedAd.SetDisplayListener(RewardedAdCallback); HeyzapAds.SetNetworkCallbackListener(NetworkCallbackListener); mIsInitialized = true; Debug.Log("Heyzap client has been initialized."); #else Debug.LogError(NO_SDK_MESSAGE); #endif }
public void ShowBannerAd() { HZBannerShowOptions showOptions = new HZBannerShowOptions(); showOptions.Position = HZBannerShowOptions.POSITION_TOP; HZBannerAd.ShowWithOptions(showOptions); }
private void ShowBanner() { HZBannerShowOptions showOptions = new HZBannerShowOptions(); showOptions.Position = HZBannerShowOptions.POSITION_BOTTOM; HZBannerAd.ShowWithOptions(showOptions); }
public void DestroyButton() { if (this.SelectedAdType == AdType.Banner) { this.console.Append("Destroying Banner"); HZBannerAd.Destroy(); } }
public void HideButton() { if (this.SelectedAdType == AdType.Banner) { this.console.Append("Hiding Banner"); HZBannerAd.Hide(); } }
public void DestroyBannerAd() { #if EM_HEYZAP HZBannerAd.Destroy(); #else Debug.LogError(NO_SDK_MESSAGE); #endif }
// Use this for initialization void Start() { HeyzapAds.Start("9a5b94190642abf2b815c547052624d3", HeyzapAds.FLAG_NO_OPTIONS); HZBannerShowOptions showOptions = new HZBannerShowOptions(); showOptions.Position = HZBannerShowOptions.POSITION_TOP; HZBannerAd.ShowWithOptions(showOptions); }
public void HideBannerAd() { #if EM_HEYZAP HZBannerAd.Hide(); #else Debug.LogError(NO_SDK_MESSAGE); #endif }
protected override void CreateEventListeners() { #if API_ADS_HEYZAP HZBannerAd.SetDisplayListener(OnBannerStateUpdate); HZInterstitialAd.SetDisplayListener(OnInterstitialStateUpdate); HZVideoAd.SetDisplayListener(OnInterstitialStateUpdate); HZIncentivizedAd.SetDisplayListener(OnIncentivizedStateUpdate); #endif }
public static void initReceiver() { if (_instance == null) { GameObject receiverObject = new GameObject("HZBannerAd"); DontDestroyOnLoad(receiverObject); _instance = receiverObject.AddComponent <HZBannerAd>(); } }
void ShowAdBanner() { HZBannerShowOptions showOptions = new HZBannerShowOptions(); showOptions.Position = HZBannerShowOptions.POSITION_BOTTOM; showOptions.SelectedAdMobSize = HZBannerShowOptions.AdMobSize.SMART_BANNER; showOptions.Tag = "Banner"; HZBannerAd.ShowWithOptions(showOptions); }
public void Tutorial() { Main.Instance.StopBGMusic(); Main.Instance.PlayButtonSound(); HZBannerAd.Hide(); // tutorialPanel.gameObject.SetActive(true); // homePanel.gameObject.SetActive(false); Application.LoadLevelAsync("Tutorial"); }
protected override void RemoveEventListeners() { #if API_ADS_HEYZAP HZBannerAd.SetDisplayListener(null); HZInterstitialAd.SetDisplayListener(null); HZVideoAd.SetDisplayListener(null); HZIncentivizedAd.SetDisplayListener(null); #endif }
//------------------------------------------------------------ // Banner Ads. //------------------------------------------------------------ public void ShowBannerAd(BannerAdPosition position, BannerAdSize size) { #if EM_HEYZAP HZBannerShowOptions showOptions = new HZBannerShowOptions(); showOptions.Position = position.ToHeyzapAdPosition(); HZBannerAd.ShowWithOptions(showOptions); #else Debug.LogError(NO_SDK_MESSAGE); #endif }
public void OnGameRulesClicked() { if (GameData.Instance.isMusicON != 0) { SoundManager.instance.PlaySingle(menuClip); } HZBannerAd.Hide(); Debug.Log("AI button Clicked"); rulesObject.SetActive(true); }
//------------------------------------------------------------ // Banner Ads. //------------------------------------------------------------ protected override void InternalShowBannerAd(AdPlacement placement, BannerAdPosition position, BannerAdSize __) { #if EM_HEYZAP HZBannerShowOptions showOptions = new HZBannerShowOptions { Position = ToHeyzapAdPosition(position), Tag = ToHeyzapAdTag(placement) }; HZBannerAd.ShowWithOptions(showOptions); #endif }
public void HideBanner() { #if API_ADS_HEYZAP HZBannerAd.Hide(); HZBannerAd.Destroy(); #endif if (BannerRemoved != null) { BannerRemoved(); } _bannerDisplayed = false; }
public void ShowMarket() { googleAnalytics.LogScreen(new AppViewHitBuilder() .SetScreenName("Extras Screen")); if (GameData.Instance.isMusicON != 0) { SoundManager.instance.PlaySingle(menuClip); } HZBannerAd.Hide(); SceneManager.LoadScene("MarketScene"); }
public void CloseIapPanel() { Main.Instance.PlayButtonClickSound(); isRestoring = false; if (gameOverPanel.gameObject.activeSelf) { if (!Main.Instance.isNoAdsPurchased) { HZBannerAd.show(HZBannerAd.POSITION_TOP); } } inAppPanel.gameObject.SetActive(false); }
public void ShowIapPanel() { Main.Instance.PlayButtonClickSound(); if (gameOverPanel.gameObject.activeSelf) { if (!Main.Instance.isNoAdsPurchased) { HZBannerAd.hide(); } } isRestoring = false; inAppPanel.gameObject.SetActive(true); }
public void StoreClicked() { Main.Instance.PlayButtonClickSound(); if (GameData.isComingFromGameOverStore) { HZBannerAd.hide(); if (BackGroundManager.Instance != null) { BackGroundManager.Instance.transform.position = Vector3.zero; } } Application.LoadLevel(2); }
public void AIPlayersClicked() { googleAnalytics.LogScreen(new AppViewHitBuilder() .SetScreenName("AI Players Screen")); if (GameData.Instance.isMusicON != 0) { SoundManager.instance.PlaySingle(menuClip); } Debug.Log("AI button Clicked"); HZBannerAd.Hide(); playersObject.SetActive(true); }
public void ShowBannerAd(string _position) { if (adsRemoved) { Toaster.ShowDebugToast("Not showing banner ad because ads are removed"); return; } HZBannerShowOptions showOptions = new HZBannerShowOptions(); showOptions.Position = _position; HZBannerAd.ShowWithOptions(showOptions); Toaster.ShowDebugToast("Showing banner ad"); }
public void ToggleBanner() { if (!bannerShowing) { HZBannerShowOptions showOptions = new HZBannerShowOptions(); showOptions.Position = HZBannerShowOptions.POSITION_BOTTOM; HZBannerAd.ShowWithOptions(showOptions); bannerShowing = true; } else { HZBannerAd.Hide(); HZBannerAd.Destroy(); bannerShowing = false; } }
public void OnGameRulesOkClicked() { if (GameData.Instance.isMusicON != 0) { SoundManager.instance.PlaySingle(menuClip); } if (GameData.Instance.noAd != 99) { HZBannerShowOptions showOptions = new HZBannerShowOptions(); showOptions.Position = HZBannerShowOptions.POSITION_BOTTOM; HZBannerAd.ShowWithOptions(showOptions); } rulesObject.SetActive(false); }
public void ShowButton() { string tag = this.adTag(); HZShowOptions showOptions = new HZShowOptions(); showOptions.Tag = tag; HZIncentivizedShowOptions incentivizedOptions = new HZIncentivizedShowOptions(); incentivizedOptions.Tag = tag; incentivizedOptions.IncentivizedInfo = "test app incentivized info!"; HZBannerShowOptions bannerOptions = new HZBannerShowOptions(); bannerOptions.Tag = tag; bannerOptions.Position = this.bannerPosition; HZOfferWallShowOptions offerwallOptions = new HZOfferWallShowOptions(); offerwallOptions.ShouldCloseAfterFirstClick = offerwallCloseOnFirstClickToggle.isOn; offerwallOptions.Tag = tag; this.console.Append("Showing " + this.SelectedAdType.ToString() + " with tag: " + tag); switch (this.SelectedAdType) { case AdType.Interstitial: HZInterstitialAd.ShowWithOptions(showOptions); break; case AdType.Video: HZVideoAd.ShowWithOptions(showOptions); break; case AdType.Incentivized: HZIncentivizedAd.ShowWithOptions(incentivizedOptions); break; case AdType.Banner: HZBannerAd.ShowWithOptions(bannerOptions); break; case AdType.Offerwall: HZOfferWallAd.ShowWithOptions(offerwallOptions); break; } }
public static void initReceiver() { if (_instance == null) { GameObject receiverObject = new GameObject("HZBannerAd"); DontDestroyOnLoad(receiverObject); _instance = receiverObject.AddComponent<HZBannerAd>(); } }