Example #1
0
    //--------------------------------------
    //  GET/SET
    //--------------------------------------

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

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

        switch (index)
        {
        case 0:
            IOSNativeUtility.RedirectToAppStoreRatingPage();
            OnComplete(IOSDialogResult.RATED);
            dispatch(BaseEvent.COMPLETE, IOSDialogResult.RATED);
            break;

        case 1:
            OnComplete(IOSDialogResult.REMIND);
            dispatch(BaseEvent.COMPLETE, IOSDialogResult.REMIND);
            break;

        case 2:
            OnComplete(IOSDialogResult.DECLINED);
            dispatch(BaseEvent.COMPLETE, IOSDialogResult.DECLINED);
            break;
        }



        Destroy(gameObject);
    }
Example #2
0
    //--------------------------------------
    //  PUBLIC METHODS
    //--------------------------------------


    void OnGUI()
    {
        UpdateToStartPos();

        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Native Pop-ups", style);

        StartY += YLableStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Rate Pop-up with events"))
        {
            IOSRateUsPopUp rate = IOSRateUsPopUp.Create("Like this game?", "Please rate to support future updates!");
            rate.OnComplete += onRatePopUpClose;
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Dialog Pop-up"))
        {
            IOSDialog dialog = IOSDialog.Create("Dialog Title", "Dialog message");
            dialog.OnComplete += onDialogClose;
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Message Pop-up"))
        {
            IOSMessage msg = IOSMessage.Create("Message Title", "Message body");
            msg.OnComplete += onMessageClose;
        }


        StartX  = XStartPos;
        StartY += YButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Dismissed Pop-up"))
        {
            Invoke("dismissAlert", 2f);
            IOSMessage.Create("Hello", "I will die in 2 sec");
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Open App Store"))
        {
            IOSNativeUtility.RedirectToAppStoreRatingPage();
        }


        StartX  = XStartPos;
        StartY += YButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Show Preloader "))
        {
            IOSNativeUtility.ShowPreloader();
            Invoke("HidePreloader", 3f);
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Hide Preloader"))
        {
            HidePreloader();
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Get Locale"))
        {
            IOSNativeUtility.OnLocaleLoaded += GetLocale;
            IOSNativeUtility.Instance.GetLocale();
        }
    }
Example #3
0
//	void Start()
//	{
//		review_coins = PlayerPrefs.GetString("Review",review_coins);
//		reward_panel = PlayerPrefs.GetString("reward panel",reward_panel);
//
//		if(reward_panel == "not active" || review_coins == "not reviewed")
//		{
//			Debug.Log("player didnt write review yet");
//		}
//		else if (reward_panel == "was activate" || review_coins == "not reviewed")
//		{
//			ActivateRewardPanel();
//		}
//		else if (reward_panel == "was activate" || review_coins == "is reviewed")
//		{
//			Debug.Log("player was awarded already");
//		}
//	}

    public void RateMeOnAppStore()
    {
        IOSNativeUtility.RedirectToAppStoreRatingPage();;
    }