public void CheckAndShowBannerIfNeed() { if (!InhouseSDK.getInstance().IsInGame) { showBannerAd(); } }
public override void ShowIntersitial() { if (_manager._didInit && !InhouseSDK.getInstance().getIsPro()) { Advertisement.Show(_config.SkippedKey); } }
public void CheckAndShowIntersitial(bool forceShow = false) { HDDebug.Log("ShowIntersitial: " + (_config.Ads.AdsType != null).ToString()); if (_didInit && !InhouseSDK.getInstance().getIsPro()) { int ratio = UnityEngine.Random.Range(0, 100); if (forceShow || ratio < _config.Ads.DisplayFrequencyOfInterstitial) { foreach (KeyValuePair <string, string> item in _config.Ads.AdsType) { if (item.Key == TAG_ADSTYPE_INTERSITIAL) { BaseAds ads = _ads [item.Value]; if (ads != null) { ads.ShowIntersitial(); } else { HDDebug.Log("AdsMgr: " + item.Key + " not supported"); } } } } } }
public void checkAndShowRemoveAd(Action <bool> callback = null) { if (_didInit) { if (!InhouseSDK.getInstance().getIsPro()) { InhouseSDK.Language content = _config.RemoveAds.Languages.getLanguage(InhouseSDK.getInstance().GetCurrentSystemLanguage()); if (content == null) { content = _config.RemoveAds.Languages.getLanguage("en"); } if (content != null) { string title = content.Title; string message = content.Message; string ok = content.OK; string cancel = content.Cancel; _callback = callback; InhouseSDK.getInstance().ShowPopup(title, message, ok, cancel, "", (string respone) => { if (respone == "0") { RemoveAds(callback); } }); } } } }
public void showIntersitialAd() { if (_didInit && !InhouseSDK.getInstance().getIsPro()) { AdmobManager.getInstance().ShowInterstitial(); } }
public override void HideBanner() { if (!_manager._didInit || InhouseSDK.getInstance().getIsPro()) { return; } AdmobManager.getInstance().HideBanner(); }
public void RemoveAds(Action <bool> callback) { if (_didInit && !InhouseSDK.getInstance().getIsPro()) { _callback = callback; InhouseSDK.getInstance().BuyProduct(_config.RemoveAds.ProductID, OnRemoveAdsSuccess, OnRemoveAdsFaild); } }
public override void ShowBanner() { if (!_manager._didInit || InhouseSDK.getInstance().getIsPro()) { return; } AdmobManager.getInstance().ShowBanner(_config.BannerId, AdsMgr.BannerPosition == AdBannerPosition.Bottom ? GoogleMobileAds.Api.AdPosition.Bottom : GoogleMobileAds.Api.AdPosition.Top); }
public override void ShowIntersitial() { Debug.Log("AdmobMgr: ShowIntersitial1"); if (_manager._didInit && !InhouseSDK.getInstance().getIsPro()) { Debug.Log("AdmobMgr: ShowIntersitial2"); AdmobManager.getInstance().ShowInterstitial(_config.IntersitialId, true); } }
void logEvent() { FirebaseAnalyticMgr fb = InhouseSDK.getInstance().GetManager <FirebaseAnalyticMgr> (); if (fb != null) { fb.LogEvent(InhouseSDK.FB_EVENT_ADSERVICE_CLICK); } }
public static InhouseSDK getInstance() { if (_instance == null) { _instance = new GameObject().AddComponent <InhouseSDK> (); _instance.gameObject.name = "InhouseSDKManager"; DontDestroyOnLoad(_instance.gameObject); Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None); } return(_instance); }
private void OnRemoveAdsSuccess(string message) { _config.IsBuyPro = true; InhouseSDK.getInstance().SaveConfigToLocal(); InhouseSDK.getInstance().GetManager <AdsMgr>().HideBanner(); if (_callback != null) { _callback(true); _callback = null; } }
public void showBannerAd() { if (_didInit && !InhouseSDK.getInstance().getIsPro()) { AdmobManager.getInstance().ShowBanner(_config.GoogleAds.BannerAdUnitID, BannerPosition); Debug.Log("Show banner"); } else { Debug.Log("Can not show banner"); } }
public void requestIntersitial() { if (_didInit && !InhouseSDK.getInstance().getIsPro() && _config.GoogleAds.UsingAdModInterstitial) { int ratio = UnityEngine.Random.Range(0, 100); if (ratio < _config.GoogleAds.DisplayFrequencyOfInterstitial) { Debug.Log("AdmobMgr: request intersitial"); AdmobManager.getInstance().RequestInterstitial(_config.GoogleAds.InterstitialAdUnitID); } } }
private void OnRestoreSuccess(string message) { _config.IsBuyPro = true; InhouseSDK.getInstance().SaveConfigToLocal(); InhouseSDK.getInstance().GetManager <AdsMgr>().HideBanner(); InhouseSDK.getInstance().ShowPopup("", "Restore purchase successfully", "OK", "", "", _ClosePopup); if (_callback != null) { _callback(true); _callback = null; } }
public void ReloadBanner() { Debug.Log("Is in game: " + InhouseSDK.getInstance().IsInGame.ToString()); if (InhouseSDK.getInstance().IsInGame) { if (_didInit && !InhouseSDK.getInstance().getIsPro()) { Debug.Log("Show banner"); AdmobManager.getInstance().ReloadBanner(_config.GoogleAds.BannerAdUnitID, BannerPosition); } else { Debug.Log("Can not show banner"); } } }
public override void InitWithConfig(Hashtable data) { base.InitWithConfig(data); if (data == null) { return; } data = (Hashtable)data["GameCenter"]; if (data == null) { return; } Dictionary <string, string> list = InhouseSDK.HashtableToDictionary <string, string> (data); _config.GameCenter.LeaderboardIds = list; _didInit = true; }
public void checkAndShowIntersitial() { if (!_config.GoogleAds.UsingAdModInterstitial) { if (_didInit && !InhouseSDK.getInstance().getIsPro()) { ShowSkipVideo(null); } return; } else { if (_didInit && !InhouseSDK.getInstance().getIsPro()) { AdmobManager.getInstance().ShowInterstitial(); checkAndRequestIntersitial(); } } }
public void checkAndRequestIntersitial() { if (!_config.GoogleAds.UsingAdModInterstitial) { return; } if (_didInit && !InhouseSDK.getInstance().getIsPro()) { int ratio = UnityEngine.Random.Range(0, 100); if (ratio < _config.GoogleAds.DisplayFrequencyOfInterstitial) { AdmobManager.getInstance().RequestInterstitial(_config.GoogleAds.InterstitialAdUnitID); } } else { Debug.Log("AdmobMgr: Dont request"); } }
public void ClosePopup() { _isshowing = false; // increase number display // #warning need to fix InhouseSDK.getInstance().GetManager <AdServiceMgr>().IncreaseNumDisplay(); Object[] objs = GameObject.FindObjectsOfType(typeof(GameObject)); BoxCollider targetMono = null; foreach (GameObject obj in objs) { targetMono = obj.GetComponent <BoxCollider>(); if (targetMono != null) { targetMono.enabled = true; } } }
public void HideBanner() { if (_didInit && !InhouseSDK.getInstance().getIsPro()) { foreach (KeyValuePair <string, string> item in _config.Ads.AdsType) { if (item.Key == TAG_ADSTYPE_BANER) { BaseAds ads = _ads [item.Value]; if (ads != null) { ads.HideBanner(); } else { HDDebug.Log("AdsMgr: " + item.Key + " not supported"); } } } } }
public void ShowPaidAlert() { if (_didInit) { int rated = PlayerPrefs.GetInt("paid", 0); if (_config.PaidAlert.Enable && rated == 0) { InhouseSDK.Language content = _config.PaidAlert.Languages.getLanguage(InhouseSDK.getInstance().GetCurrentSystemLanguage()); if (content != null) { float delayTime = _config.PaidAlert.Second; string title = (string)content.Title; string message = (string)content.Message; string ok = (string)content.OK; string cancel = (string)content.Cancel; InhouseSDK.getInstance().StartCoroutine(ShowMessageWithDelay(delayTime, title, message, ok, cancel, _config.PaidAlert.URL, PaidCall)); } } } }
public bool IsBannerShowing() { if (_didInit && !InhouseSDK.getInstance().getIsPro()) { foreach (KeyValuePair <string, string> item in _config.Ads.AdsType) { if (item.Key == TAG_ADSTYPE_BANER) { BaseAds ads = _ads [item.Value]; if (ads != null) { return(ads.IsBannerShowing()); } else { return(false); } } } } return(false); }
public void ShowRateAlertPopup() { if (_didInit) { int rated = PlayerPrefs.GetInt("rated", 0); if (rated == 0) { InhouseSDK.Language content = _config.RateAlert.Languages.getLanguage(InhouseSDK.getInstance().GetCurrentSystemLanguage()); if (content == null) { content = _config.RateAlert.Languages.getLanguage("en"); } if (content != null) { string title = content.Title; string message = content.Message; string ok = content.OK; string cancel = content.Cancel; InhouseSDK.getInstance().ShowPopup(title, message, ok, cancel, _config.RateAlert.URL, RateCallback); } } } }
public void ShowRateAlert() { if (_didInit) { int count_rate = PlayerPrefs.GetInt("count_rate", -1); int rated = PlayerPrefs.GetInt("rated", 0); if (count_rate == -1) { count_rate = 1; PlayerPrefs.SetInt("count_rate", count_rate); } Debug.Log("Rated = " + rated); Debug.Log("Count rate: " + count_rate); Debug.Log("Config rate: " + _config.RateAlert.NumberToDisplayRatingPopup); if (count_rate >= _config.RateAlert.NumberToDisplayRatingPopup && rated == 0) { Debug.Log("Languate A: " + (_config.RateAlert.Languages != null).ToString()); InhouseSDK.Language content = _config.RateAlert.Languages.getLanguage(InhouseSDK.getInstance().GetCurrentSystemLanguage()); Debug.Log("Languate B"); if (content != null) { string title = content.Title; string message = content.Message; string ok = content.OK; string cancel = content.Cancel; InhouseSDK.getInstance().ShowPopup(title, message, ok, cancel, _config.RateAlert.URL, RateCallback); } } else { PlayerPrefs.SetInt("count_rate", count_rate + 1); } PlayerPrefs.Save(); Debug.Log("Rate done"); } }
void Awake() { _soundMrg = FindObjectOfType <SoundManager> (); // string urlPlist = "https://www.dropbox.com/s/h01v3s1kdgep8pr/config.plist?dl=1"; InhouseSDK.getInstance().Initialize("https://www.dropbox.com/s/hu9lslj6lbz9len/config.plist?dl=1", true, typeof(AdsMgr), typeof(GameCenterMgr)); }
IEnumerator ShowMessageWithDelay(float delay, string title, string message, string ok, string cancel, string urk, InhouseSDK.InhouseCallback callback) { yield return(new WaitForSeconds(delay)); InhouseSDK.getInstance().ShowPopup(title, message, ok, cancel, urk, callback); }
public static string NLINKFILE() { return(InhouseSDK.getInstance().PLIST_ONLINE_URL); }
public LanguageV2 getLanguage() { return(getLanguage(InhouseSDK.getInstance().GetCurrentSystemLanguage())); }