コード例 #1
0
        /// <summary>
        /// Show a rate dialog without checking any restrictions.
        /// Designed to show a rate dialog from game settings menu.
        /// Doesn't affect postpone cooldown, even if user press postponeButtonTilte button.
        /// However, if the user press rateButtonTitle or rejectButtonTitle buttons the dialog will not be displayed again after calling Show function.
        /// Disclaimer: <see cref="PaperPlaneTools.RateBox.DefaultTextSettings"/> will be totally ignored.
        /// </summary>
        /// <param name="title">Title of the dialog</param>
        /// <param name="message">Message </param>
        /// <param name="rateButtonTitle">Rate button title. For example: "Rate"</param>
        /// <param name="postponeButtonTilte">Postpone button title. For example: "Later"</param>
        /// <param name="rejectButtonTitle">Reject button title. If null, third button is not shown. For example: "Never" for 3-buttons dialog, or null for 2-buttons dialog</param>
        public void ForceShow(string title, string message, string rateButtonTitle, string postponeButtonTilte, string rejectButtonTitle = null)
        {
            Alert alert = new Alert(title, message)
                          .SetPositiveButton(rateButtonTitle, () => {
                if (!Debug.isDebugBuild)
                {
                    Flurry.Flurry.Instance.LogEvent("AppRate_Dialog_Rate");
                    Fabric.Answers.Answers.LogCustom("AppRate_Dialog_Rate");
                }

                GoToRateUrl();
            })
                          .SetNeutralButton(postponeButtonTilte)
                          .AddOptions(new AlertIOSOptions()
            {
                PreferableButton = Alert.ButtonType.Positive
            });

            if (rejectButtonTitle != null)
            {
                alert.SetNegativeButton(rejectButtonTitle, () => {
                    if (!Debug.isDebugBuild)
                    {
                        Flurry.Flurry.Instance.LogEvent("AppRate_Dialog_Reject");
                        Fabric.Answers.Answers.LogCustom("AppRate_Dialog_Reject");
                    }

                    Statistics.DialogIsRejected = true;
                    SaveStatistics();
                });
            }
            alert.SetAdapter(AlertAdapter);
            alert.Show();
        }
コード例 #2
0
ファイル: RateBox.cs プロジェクト: bigstupidx/SongBookForKids
        /// <summary>
        /// Show a rate dialog without checking any restrictions.
        /// Designed to show a rate dialog from game settings menu.
        /// Doesn't affect postpone cooldown, even if user press postponeButtonTilte button.
        /// However, if the user press rateButtonTitle or rejectButtonTitle buttons the dialog will not be displayed again after calling Show function.
        /// Disclaimer: <see cref="PaperPlaneTools.RateBox.DefaultTextSettings"/> will be totally ignored.
        /// </summary>
        /// <param name="title">Title of the dialog</param>
        /// <param name="message">Message </param>
        /// <param name="rateButtonTitle">Rate button title. For example: "Rate"</param>
        /// <param name="postponeButtonTilte">Postpone button title. For example: "Later"</param>
        /// <param name="rejectButtonTitle">Reject button title. If null, third button is not shown. For example: "Never" for 3-buttons dialog, or null for 2-buttons dialog</param>
        public void ForceShow(string title, string message, string rateButtonTitle, string postponeButtonTilte, string rejectButtonTitle = null)
        {
                        #if (UNITY_IPHONE && !UNITY_EDITOR)
            if (Settings.UseIOSReview && _reviewControllerIsAvailable())
            {
                _reviewControllerShow();
                return;
            }
                        #endif

            Alert alert = new Alert(title, message)
                          .SetPositiveButton(rateButtonTitle, () => {
                GoToRateUrl();
            })
                          .SetNeutralButton(postponeButtonTilte)
                          .AddOptions(new AlertIOSOptions()
            {
                PreferableButton = Alert.ButtonType.Positive
            });

            if (rejectButtonTitle != null)
            {
                alert.SetNegativeButton(rejectButtonTitle, () => {
                    Statistics.DialogIsRejected = true;
                    SaveStatistics();
                });
            }
            alert.SetAdapter(AlertAdapter);
            alert.Show();
        }
コード例 #3
0
        /// <summary>
        /// Show a rate dialog without checking any restrictions.
        /// Designed to show a rate dialog from game settings menu.
        /// Doesn't affect postpone cooldown, even if user press postponeButtonTilte button.
        /// However, if the user press rateButtonTitle or rejectButtonTitle buttons the dialog will not be displayed again after calling Show function.
        /// Disclaimer: <see cref="PaperPlaneTools.RateBox.DefaultTextSettings"/> will be totally ignored.
        /// </summary>
        /// <param name="title">Title of the dialog</param>
        /// <param name="message">Message </param>
        /// <param name="rateButtonTitle">Rate button title. For example: "Rate"</param>
        /// <param name="postponeButtonTilte">Postpone button title. For example: "Later"</param>
        /// <param name="rejectButtonTitle">Reject button title. If null, third button is not shown. For example: "Never" for 3-buttons dialog, or null for 2-buttons dialog</param>
        public void ForceShow(string title, string message, string rateButtonTitle, string postponeButtonTilte, string rejectButtonTitle = null)
        {
            Alert alert = new Alert(title, message)
                          .SetPositiveButton(rateButtonTitle, () => {
                GoToRateUrl();
            })
                          .SetNeutralButton(postponeButtonTilte)
                          .AddOptions(new AlertIOSOptions()
            {
                PreferableButton = Alert.ButtonType.Positive
            });

            if (rejectButtonTitle != null)
            {
                alert.SetNegativeButton(rejectButtonTitle, () => {
                    Statistics.DialogIsRejected = true;
                    SaveStatistics();
                });
            }
            alert.SetAdapter(AlertAdapter);
            alert.Show();
        }