Пример #1
0
    public MNRateUsPopup(string title, string message, string rateUs, string decline, string remind) : base(title, message)
    {
        AddAction(remind, () => {
            if (remindListener != null)
            {
                remindListener.Invoke();
            }
        });

        AddAction(decline, () => {
            if (declineListener != null)
            {
                declineListener.Invoke();
            }
        });

        AddAction(rateUs, () => {
                                                #if UNITY_ANDROID
            MNAndroidNative.RedirectStoreRatingPage(androidAppUrl);
                                                #elif UNITY_IOS
            MNIOSNative.RedirectToAppStoreRatingPage(appleId);
                                                #endif

            if (rateUsListener != null)
            {
                rateUsListener.Invoke();
            }
        });
    }
    //--------------------------------------
    //  GET/SET
    //--------------------------------------

    //--------------------------------------
    //  EVENTS
    //--------------------------------------

    public void onPopUpCallBack(string buttonIndex)
    {
        int index = System.Convert.ToInt16(buttonIndex);

        switch (index)
        {
        case 0:
            MNIOSNative.RedirectToAppStoreRatingPage(appleId);
            OnComplete(MNDialogResult.RATED);
            break;

        case 1:
            OnComplete(MNDialogResult.REMIND);
            break;

        case 2:
            OnComplete(MNDialogResult.DECLINED);
            break;
        }



        Destroy(gameObject);
    }