// Use this for initialization void Start() { string rateUrl = RateBox.GetStoreUrl(appStoreAppId, playMarketAppBundleId); //Debug settings are only allowed inside development environment #if (UNITY_EDITOR) if (clearOnStart) { RateBox.Instance.ClearStatistics(); } RateBox.Instance.DebugMode = logDebugMessages; #else RateBox.Instance.DebugMode = false; #endif var rejectButtonTrimmed = rejectButton.Trim(); RateBox.Instance.Init( rateUrl, new RateBoxConditions() { MinSessionCount = minSessionCount, MinCustomEventsCount = minCustomEventsCount, DelayAfterInstallInSeconds = Mathf.CeilToInt(delayAfterInstallInHours * 3600), DelayAfterLaunchInSeconds = Mathf.CeilToInt(delayAfterLaunchInHours * 3600), PostponeCooldownInSeconds = Mathf.CeilToInt(postponeCooldownInHours * 3600), RequireInternetConnection = requireInternetConnection }, new RateBoxTextSettings() { Title = title.Trim(), Message = message.Trim(), RateButtonTitle = rateButton.Trim(), PostponeButtonTitle = postponeButton.Trim(), RejectButtonTitle = rejectButtonTrimmed.Length > 0 ? rejectButtonTrimmed.Trim() : null } ); IAlertPlatformAdapter alertAdapter = null; if (customUIWindow != null) { customUIWindow.SetActive(false); alertAdapter = customUIWindow.GetComponent <IAlertPlatformAdapter>(); } RateBox.Instance.AlertAdapter = alertAdapter; }
public void Ready(Messenger msg) { RateBox.Instance.Init( RateBox.GetStoreUrl("1151798674", Application.identifier), new RateBoxConditions { MinSessionCount = 0, MinCustomEventsCount = 5, DelayAfterInstallInSeconds = 0, DelayAfterLaunchInSeconds = 0, PostponeCooldownInSeconds = 24 * 3600, RequireInternetConnection = true, }, null, new RateBoxSettings() { UseIOSReview = true } ); OnApplicationPause(false); }
/// <summary> /// Call <see cref="PaperPlaneTools.RateBox.Init"/> function /// </summary> void Start() { GameManager.SafeAddListener <AppRateMessage>(AppRateHandler); string[] texts = new string[] { LocaliseText.Get("Ratebox.FirstText"), //LocaliseText.Get ("Ratebox.SecondText"), //LocaliseText.Get ("Ratebox.ThirdText"), }; //#if UNITY_ANDROID //if ( Utils.AndroidSDKVersion () < 23 ) { // texts = new string[] { // LocaliseText.Get ("Ratebox.FirstTextNoEmoji"), // LocaliseText.Get ("Ratebox.SecondTextNoEmoji"), // LocaliseText.Get ("Ratebox.ThirdTextNoEmoji"), // }; //} //#endif int index = UnityEngine.Random.Range(0, texts.Length); string msg = texts [index]; title = LocaliseText.Get("GameFeedback.RateTitle"); string rateUrl = RateBox.GetStoreUrl(appStoreAppId, playMarketAppBundleId); //Debug settings are only allowed inside development environment #if (UNITY_EDITOR) if (clearOnStart) { RateBox.Instance.ClearStatistics(); } RateBox.Instance.DebugMode = logDebugMessages; #else RateBox.Instance.DebugMode = false; #endif var rejectButtonTrimmed = rejectButton.Trim(); RateBox.Instance.Init( rateUrl, new RateBoxConditions() { MinSessionCount = minSessionCount, MinCustomEventsCount = minCustomEventsCount, DelayAfterInstallInSeconds = Mathf.CeilToInt(delayAfterInstallInHours * 3600), DelayAfterLaunchInSeconds = Mathf.CeilToInt(delayAfterLaunchInHours * 3600), PostponeCooldownInSeconds = Mathf.CeilToInt(postponeCooldownInHours * 3600), RequireInternetConnection = requireInternetConnection }, new RateBoxTextSettings() { Title = title.Trim(), Message = msg.Trim(), RateButtonTitle = rateButton.Trim(), PostponeButtonTitle = postponeButton.Trim(), RejectButtonTitle = rejectButtonTrimmed.Length > 0 ? rejectButtonTrimmed.Trim() : null }, new RateBoxSettings() { UseIOSReview = useIOSReview } ); // Custom alertAdapter allows to display custom UI windows instead of native alerts IAlertPlatformAdapter alertAdapter = null; if (customUIWindow != null) { customUIWindow.SetActive(false); alertAdapter = customUIWindow.GetComponent <IAlertPlatformAdapter>(); } RateBox.Instance.AlertAdapter = alertAdapter; }