Show Rate Popup With Callback

Description

When all conditions from Settings Window are met the rate popup is shown. If not this method does nothing.

Declaration

public static void ShowRatePopupWithCallback(UnityAction<PopupOptions, string> popupClosed = null)

Parameters

Example

using Gley.RateGame;
public class Test : MonoBehaviour
{
    public void ShowRatePopup()
    {
        Gley.RateGame.API.ShowRatePopupWithCallback(PopupClosed);
    }

    private void PopupClosed(PopupOptions result, string message)
    {
        switch (result)
        {
            case PopupOptions.Never:
                Debug.Log("Never button was press from in-game popup");
                break;
            case PopupOptions.Rated:
                Debug.Log("Send/Yes button was press from in-game popup");
                break;
            case PopupOptions.NotNow:
                Debug.Log("Later button was press from in-game popup");
                break;
            case PopupOptions.NativeFailed:
                Debug.Log($"Native popup failed to display. Reason {message}");
                break;
            case PopupOptions.NativeSuccess:
                Debug.Log("Native popup displayed");
                break;
        }
    }
}

Last updated