private static void HandleOnInitComplete(WP8_InAppsInitResult result)
    {
        if (result.IsFailed)
        {
            return;
        }


        _IsInited = true;

        WP8InAppPurchasesManager.OnInitComplete -= HandleOnInitComplete;

        foreach (WP8ProductTemplate product in WP8InAppPurchasesManager.instance.products)
        {
            if (product.Type == WP8PurchaseProductType.Durable)
            {
                if (product.isPurchased)
                {
                    //The Durable product was purchased, we should check here
                    //if the content is unlocked for our Durable product.

                    Debug.Log("Product " + product.Name + " is purchased");
                }
            }
        }

        WP8Dialog.Create("market Initted", "Total products avaliable: " + WP8InAppPurchasesManager.instance.products.Count);
    }
Esempio n. 2
0
    private static void HandleOnInitComplete(WP8_InAppsInitResult result)
    {
        if (result.IsFailed)
        {
            _status = "[Billing Init] Status" + result.IsSucceeded;

            return;
        }


        _IsInited = true;

        WP8InAppPurchasesManager.OnInitComplete -= HandleOnInitComplete;

        StringBuilder builder = new StringBuilder();

        foreach (WP8ProductTemplate product in WP8InAppPurchasesManager.Instance.Products)
        {
            if (product.Type == WP8PurchaseProductType.Durable)
            {
                if (product.IsPurchased)
                {
                    //The Durable product was purchased, we should check here
                    //if the content is unlocked for our Durable product.

                    Debug.Log("Product " + product.Name + " is purchased");
                }
            }

            builder.AppendLine(string.Format("[PRODUCT] {0} {1} {2} {3}", product.ProductId, product.Name, product.Type.ToString(), product.Price));
        }
        _status = builder.ToString();

        WP8Dialog.Create("market Initted", "Total products avaliable: " + WP8InAppPurchasesManager.Instance.Products.Count);
    }
 private static void HandleOnPurchaseFinished(WP8PurchseResponce responce)
 {
     if (responce.IsSuccses)
     {
         //Unlock logic for product with id recponce.productId should be here
         WP8Dialog.Create("Purchase Succse", "Product: " + responce.productId);
     }
     else
     {
         //Purchase fail logic for product with id recponce.productId should be here
         WP8Dialog.Create("Purchase Failed", "Product: " + responce.productId);
     }
 }
    private static void OnInitComplete()
    {
        _IsInited = true;

        WP8InAppPurchasesManager.instance.removeEventListener(WP8InAppPurchasesManager.INITIALIZED, OnInitComplete);

        foreach (WP8ProductTemplate product in WP8InAppPurchasesManager.instance.products)
        {
            if (product.Type == WP8PurchaseProductType.Durable)
            {
                if (product.isPurchased)
                {
                    //The Durable product was purchased, we should check here
                    //if the content is unlocked for our Durable product.

                    Debug.Log("Product " + product.Name + " is purchased");
                }
            }
        }

        WP8Dialog.Create("market Initted", "Total products avaliable: " + WP8InAppPurchasesManager.instance.products.Count);
    }
Esempio n. 5
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------

    //--------------------------------------
    //  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 PopUp with events"))
        {
            WP8RateUsPopUp rate = WP8RateUsPopUp.Create("Like this game?", "Please rate to support future updates!");
            rate.addEventListener(BaseEvent.COMPLETE, onRatePopUpClose);
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Dialog PopUp"))
        {
            WP8Dialog dialog = WP8Dialog.Create("Dialog Titile", "Dialog message");
            dialog.addEventListener(BaseEvent.COMPLETE, onDialogClose);
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Message PopUp"))
        {
            WP8Message msg = WP8Message.Create("Message Titile", "Message message");
            msg.addEventListener(BaseEvent.COMPLETE, onMessageClose);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Show Preloader"))
        {
            WP8NativeUtils.ShowPreloader();
            Invoke("HidePreloader", 2f);
        }
    }