示例#1
0
        //--------------------------------------
        //  AN_iConsumeResponseListener
        //--------------------------------------

        public void OnConsumeResponse(SA_iResult billingResult, string purchaseToken)
        {
            if (billingResult.IsSucceeded)
            {
                //Let's updated our UI again
                BuildProductsUI();
            }
            else
            {
                AN_BillingClientSample.ShowErrorMessage(billingResult.Error);
            }
        }
示例#2
0
        private void Start()
        {
            if (m_BillingClientSample == null)
            {
                m_BillingClientSample = new AN_BillingClientSample();
            }

            m_ConnectButton.onClick.AddListener(() =>
            {
                m_BillingClientSample.Connect();
            });

            m_QuerySkuDetailsButton.onClick.AddListener(() => { BuildProductsUI(); });

            //In this example we will rebuild whole UI when any product purchase state is changed.
            //But you can implement more advanced login and skip QuerySkuDetailsAsync step if you already done it earlier.
            m_BillingClientSample.OnStoreStateUpdated += BuildProductsUI;
        }