예제 #1
0
        void purchaseSucceededEvent(GooglePurchase purchase)
        {
            Debug.Log("purchaseSucceededEvent: " + purchase);

            DataManagerAlarm.Instance.purchased_list.Add(purchase.productId);
            GameMain.Instance.Purchase(purchase.productId);
        }
예제 #2
0
 public void queryInventorySucceeded(string json)
 {
     if (queryInventorySucceededEvent != null)
     {
         var dict = json.dictionaryFromJson();
         queryInventorySucceededEvent(GooglePurchase.fromList(dict["purchases"] as List <object>), GoogleSkuInfo.fromList(dict["skus"] as List <object>));
     }
 }
예제 #3
0
 public void queryInventorySucceeded(string json)
 {
     if (queryInventorySucceededEvent != null)
     {
         Dictionary <string, object> dictionary = JsonExtensions.dictionaryFromJson(json);
         queryInventorySucceededEvent(GooglePurchase.fromList(dictionary["purchases"] as List <object>), GoogleSkuInfo.fromList(dictionary["skus"] as List <object>));
     }
 }
예제 #4
0
        void purchaseSucceededEvent(GooglePurchase purchase)
        {
            Debug.Log("purchaseSucceededEvent: " + purchase);

            if (purchase.productId == "teleport_up_no_ads")
            {
                Debug.Log("Purchased!");
                PlayerPrefs.SetInt("NoAds", 1);
            }
        }
 void consumePurchaseSucceededEvent(GooglePurchase purchase)
 {
     Debug.Log("consumePurchaseSucceededEvent: " + purchase);
 }
 void purchaseSucceededEvent(GooglePurchase purchase)
 {
     Debug.Log("purchaseSucceededEvent: " + purchase);
 }
		void consumePurchaseSucceededEvent( GooglePurchase purchase )
		{
			Debug.Log( "consumePurchaseSucceededEvent: " + purchase );
		}
		void purchaseSucceededEvent( GooglePurchase purchase )
		{
			Debug.Log( "purchaseSucceededEvent: " + purchase );
		}
예제 #9
0
 // online verification request (Android version)
 // here we build the POST request to our external server,
 // that will forward the request to Google's servers
 private void MakeRequest(GooglePurchase prod)
 {
     Dictionary<string, string> dic = new Dictionary<string, string>();
     dic.Add("store", "Android");
     dic.Add("pid", prod.productId);
     dic.Add("tid", prod.orderId);
     dic.Add("rec", prod.purchaseToken);
     IAPObject obj = GetIAPObject(prod.productId);
     if (obj != null && obj.type == IAPType.subscription)
         dic.Add("type", "subs");
     StartCoroutine(WaitForRequest(dic));
 }
예제 #10
0
 // fired after a successful consumption (see PurchaseVerified()).
 // Method that fires the purchase succeeded action
 private void ConsumeSucceeded(GooglePurchase prod)
 {
     purchaseSucceededEvent(GetIAPIdentifier(prod.productId));
 }
예제 #11
0
        // fired when a purchase succeeds, Android version.
        // Optionally: verify new product transaction online
        private void PurchaseSucceeded(GooglePurchase prod)
        {
            string id = GetIAPIdentifier(prod.productId);

            if ((verificationType == VerificationType.onPurchase || verificationType == VerificationType.both)
                && !string.IsNullOrEmpty(serverUrl))
            {
                MakeRequest(prod);
                return;
            }

            PurchaseVerified(id);
        }