string GetBased64ReceiptData() { string base64ReceiptData = string.Empty; string receiptLocation = StoreKitBinding.getAppStoreReceiptLocation(); UserEditor.Getsingleton.EditLog("getAppStoreReceiptLocation : " + StoreKitBinding.getAppStoreReceiptLocation()); receiptLocation = receiptLocation.Replace("file://", string.Empty); //UserEditor.Getsingleton.EditLog ("getAppStoreReceiptLocation File : " + receiptLocation); if (!File.Exists(receiptLocation)) { return(base64ReceiptData); } byte[] receiptBytes = File.ReadAllBytes(receiptLocation); UserEditor.Getsingleton.EditLog("receiptBytes count: " + receiptBytes.Length); base64ReceiptData = System.Convert.ToBase64String(receiptBytes); //object receip = MiniJSON.Json.Deserialize (base64ReceiptData); //Utils.logObject (receip); UserEditor.Getsingleton.EditLog("base64ReceiptData : " + base64ReceiptData); return(base64ReceiptData); }
void productListReceivedEvent(List <StoreKitProduct> productList) { Debug.Log("productListReceivedEvent. total products received: " + productList.Count); // print the products to the console foreach (StoreKitProduct product in productList) { Debug.Log(product.ToString() + "\n"); } Debug.Log("total productsReceived: " + productList.Count); // Do something more useful with the products than printing them to the console foreach (StoreKitProduct product in productList) { if (product.productIdentifier == CurProduct.pid) { if (isBuying) //;// = true; { Debug.Log("FindProduct" + CurProduct.pid); StoreKitBinding.purchaseProduct(CurProduct.pid, 1); isBuying = false; } return; } Debug.Log(product.ToString() + "\n"); } BuyFail(IAPHelper.FailType.PRODUCT_NOT_EXSIT, ""); }
public void PurchaseReal(string productname) { SoundManager.Instance.PlaySound(8); switch (productname) { case "one.coin": StoreKitBinding.purchaseProduct("coin1", 1); break; case "three.coin": StoreKitBinding.purchaseProduct("coin2", 1); break; case "five.coin": StoreKitBinding.purchaseProduct("coin3", 1); break; case "nine.coin": StoreKitBinding.purchaseProduct("coin4", 1); break; case "intotheblack.vip": StoreKitBinding.purchaseProduct("VIP", 1); break; case "intotheblack.venus": StoreKitBinding.purchaseProduct("wingman", 1); break; default: break; } }
public void InitialiseStoreKit() { canMakePayments = StoreKitBinding.canMakePayments(); Debug.Log("StoreKit canMakePayments: " + canMakePayments); if (isFree) { var productIdentifiers = new string[] { "com.DMDEnterprise.kicktheballfree.100coins", "com.DMDEnterprise.kicktheballfree.250coins", "com.DMDEnterprise.kicktheballfree.500coins", "com.DMDEnterprise.kicktheballfree.1500coins", "com.DMDEnterprise.kicktheballfree.3000coins", "com.DMDEnterprise.kicktheballfree.5000coins" }; StoreKitBinding.requestProductData(productIdentifiers); } else { var productIdentifiers = new string[] { "com.immanitas.KickTheBall.100coins", "com.immanitas.KickTheBall.250coins", "com.immanitas.KickTheBall.500coins", "com.immanitas.KickTheBall.1500coins", "com.immanitas.KickTheBall.3000coins", "com.immanitas.KickTheBall.5000coins" }; StoreKitBinding.requestProductData(productIdentifiers); } }
/// <summary> /// 购买一个角色槽,可以多创建一个角色 /// </summary> public void BuyPlayerSlot(UIToggle toggle) { //Debug.Log(string.Format("===================={0},{1}", BtnGameManager.yt,BtnGameManager.yt[0]["userEmail"].YuanColumnText)); string userName = BtnManager.passID; string quDao = TableRead.strPageName; toggle.value = false; btnStartGame.SetActive(false); //StartCoroutine (BeginTimeOut(15,3,ConnectInRoom,() => InRoom.GetInRoomInstantiate().GetBuyLanWei(userName, quDao),null)); #if SDK_ZSYIOS // 正版iOS平台内购相关逻辑 int playerSlotCount = PlayerPrefs.GetInt("PlayerSlotCount", 2); if (playerSlotCount < 5) { StoreKitBinding.requestProductData("cszz.061"); StoreKitBinding.purchaseProduct("cszz.061", 1); } else { warnings.warningAllTime.Show("", StaticLoc.Loc.Get("info1013")); } #else //10月29号出封测包先注释掉 InRoom.GetInRoomInstantiate().GetBuyLanWei(userName, quDao); #endif }
public void purchaseProduct(string code, int quantity) { #if PURCHASE_USE_APPLE_ITUNES_PRIME31 StoreKitBinding.purchaseProduct(code, quantity); #elif PURCHASE_USE_AMAZON_PRIME31 //AmazonIAP.initiatePurchaseRequest(GamePacks.currentGameBundle + "." + code); AmazonIAP.initiatePurchaseRequest(code); #elif PURCHASE_USE_GOOGLE_PLAY_PRIME31 GoogleIAB.purchaseProduct(code); #elif PURCHASE_USE_UNITY productManager.PurchaseProduct(code); #else // Web/PC purchaseProcessCompleted = true; ProductNetworkRecord data = ProductNetworkRecord.Create( code, "Product Purchase", "Product purchased:" + code, true, "TODO", "TODO", code, 1, ProductNetworkType.typeThirdParty, ProductNetworkStoreType.typeAmazon, ProductNetworkConsumableType.consumable); BroadcastProductNetworksSuccess(data); #endif }
public void RequestProductData() { // array of product ID's from iTunesConnect. MUST match exactly what you have there! var productIdentifiers = new string[] { "eu.machten.Bee.extralives", "eu.machten.Bee.removeads", "eu.machten.Bee.10extralives" }; StoreKitBinding.requestProductData(productIdentifiers); }
/// <summary> /// restore already purchased user's transactions for non consumable iaps. /// For Android we use the received list for detecting previous purchases /// </summary> public static void RestoreTransactions() { #if UNITY_IPHONE StoreKitBinding.restoreCompletedTransactions(); #elif UNITY_ANDROID if (prods == null) { RestoreFailed("Restoring transactions failed. Please try again."); return; } for (int i = 0; i < prods.Count; i++) { string id = GetIAPIdentifier(prods[i].productId); if (!DBManager.isPurchased(id)) { DBManager.SetToPurchased(id); } } RestoreSucceeded(); #endif //update ShopManager GUI items if (ShopManager.GetInstance()) { ShopManager.SetItemState(); } }
static StoreKitManager() { AbstractManager.initialize(typeof(StoreKitManager)); // we ignore the results of this call because our only purpose is to trigger the creation of the required listener on the native side for transaction processing. StoreKitBinding.canMakePayments(); }
void OnReceiptVerificationComplete() { Debug.Log("OnReceiptVerificationComplete"); KongregateAPI kongregate = KongregateAPI.GetAPI(); // we keep a list of transactions here so that we don't run into race conditions Dictionary <string, object> stillInVerification = new Dictionary <string, object> (); foreach (var transactionId in mTransactionsInVerification.Keys) { string status = kongregate.Mtx.ReceiptVerificationStatus(transactionId); if (status != KongregateAPI.RECEIPT_VERIFICATION_STATUS_PROCESSING) { Debug.Log("Verification for " + transactionId + " is " + status); #if UNITY_IPHONE if (status == KongregateAPI.RECEIPT_VERIFICATION_STATUS_VALID) { StoreKitTransaction transaction = (StoreKitTransaction)mTransactionsInVerification[transactionId]; KongregateAPI.GetAPI().Analytics.FinishPurchase(KongregateAPI.PURCHASE_SUCCESS, transactionId, getPurchaseFields()); // Below is an alternative iOS FinishPurchase() call. This version may be used if your plugin // does not make the transaction Id available or finishes the transaction before passing control // back to Unity. FinishPurchase() is preferred because purchase details may be pulled directly from // the transaction. // KongregateAPI.GetAPI().Analytics.FinishPurchaseWithProductId(KongregateAPI.PURCHASE_SUCCESS, // transaction.productIdentifier, transaction.base64EncodedTransactionReceipt, getPurchaseFields()); } else if (status == KongregateAPI.RECEIPT_VERIFICATION_STATUS_INVALID) { KongregateAPI.GetAPI().Analytics.FinishPurchase(KongregateAPI.PURCHASE_RECEIPT_FAIL, transactionId, getPurchaseFields()); } // call to finish the transaction regardless of it we are valid or not StoreKitBinding.finishPendingTransaction(transactionId); #elif UNITY_ANDROID GooglePurchase transaction = (GooglePurchase)mTransactionsInVerification [transactionId]; if (status == KongregateAPI.RECEIPT_VERIFICATION_STATUS_VALID) { KongregateAPI.GetAPI().Analytics.FinishPurchase(KongregateAPI.PURCHASE_SUCCESS, transaction.originalJson, getPurchaseFields(), transaction.signature); } else if (status == KongregateAPI.RECEIPT_VERIFICATION_STATUS_INVALID) { KongregateAPI.GetAPI().Analytics.FinishPurchase(KongregateAPI.PURCHASE_RECEIPT_FAIL, transaction.originalJson, getPurchaseFields()); } // call to finish transaction regardless of it we are valid or not GoogleIAB.consumeProduct(transaction.productId); #endif mPurchaseReady = true; } else { Debug.Log("Still waiting on verification for " + transactionId); stillInVerification [transactionId] = mTransactionsInVerification [transactionId]; } } mTransactionsInVerification = stillInVerification; }
public void purchaseProduct(string code, int quantity) { #if PURCHASE_USE_APPLE_ITUNES StoreKitBinding.purchaseProduct(code, quantity); #elif PURCHASE_USE_AMAZON //AmazonIAP.initiatePurchaseRequest(GamePacks.currentGameBundle + "." + code); AmazonIAP.initiatePurchaseRequest(code); #elif PURCHASE_USE_GOOGLE_PLAY GoogleIAB.purchaseProduct(code); #else // Web/PC purchaseProcessCompleted = true; ProductPurchaseRecord data = ProductPurchaseRecord.Create( code, "Product Purchase", "Product purchased:" + code, true, "TODO", "TODO", code, 1, ProductPurchaseType.typeThirdParty, ProductStoreType.typeAmazon); BroadcastProductPurchaseSuccess(data); #endif }
// _////////////////////////////////////////////////_ _____ Action _____ 상품 리스트 가져오기 _____ public void ProductRequest() { Ag.LogIntenseWord("Product Request "); var productIdentifiers = new string[] { "com.appsgraphy.kvsskakao.cash0030_test", "com.appsgraphy.kvsskakao.cash0050_test", "com.appsgraphy.kvsskakao.cash0100_test", "com.appsgraphy.kvsskakao.cash0330_test", "com.appsgraphy.kvsskakao.cash0600_test", "com.appsgraphy.kvsskakao.cash1300_test", "com.appsgraphy.kvsskakao.popupstore01_test", "com.appsgraphy.kvsskakao.popupstore02_test", "com.appsgraphy.kvsskakao.popupstore03_test", "com.appsgraphy.kvsskakao.popupstore04_test", "com.appsgraphy.kvsskakao.popupstore05_test", "com.appsgraphy.kvsskakao.popupstore06_test", "com.appsgraphy.kvsskakao.popupstore07_test", "com.appsgraphy.kvsskakao.popupstore08_test" // "com.appsgraphy.psykickbattlekakao.cash0500", // "com.appsgraphy.psykickbattlekakao.cash1000", // "com.appsgraphy.psykickbattlekakao.cash1000", // "com.appsgraphy.psykickbattlekakao.cash1000" }; StoreKitBinding.requestProductData(productIdentifiers); }
public void purchaseProduct(string product) { #if UNITY_ANDROID GoogleIAB.purchaseProduct(product); #elif UNITY_IPHONE StoreKitBinding.purchaseProduct(product, 1); #else /* string url = UI.Instance.getURL(product); * FB.Canvas.Pay(url, "purchaseitem", 1, null, null, null, null, null, delegate(FBResult response) { * object resp = Json.Deserialize(response.Text); * Dictionary<string, object> infoItem = resp as Dictionary<string, object>; * if (infoItem != null) {//HACKKKAKAKAKKAKKA * //if (product == "com.bitoon.classicgolf.punadogemas") { //joyero * // //purchaseHardCurrency(product, "facebook", LoadXmlData.baseUrl + "/golfws/rest/market/exchange", "", "eyJwYXltZW50X2lkIjo0NDE0ODg0ODI2NDgwMTUsImFtb3VudCI6IjEwLjAwIiwiY3VycmVuY3kiOiJFVVIiLCJxdWFudGl0eSI6IjEiLCJzdGF0dXMiOiJjb21wbGV0ZWQiLCJzaWduZWRfcmVxdWVzdCI6Imx2Zkg3Smt2ajY3MjJPMTVVRE9KNkU5UjdpNlFNczRTajJLUVRQdU9JYVEuZXlKaGJHZHZjbWwwYUcwaU9pSklUVUZETFZOSVFUSTFOaUlzSW1GdGIzVnVkQ0k2SWpFd0xqQXdJaXdpWTNWeWNtVnVZM2tpT2lKRlZWSWlMQ0pwYzNOMVpXUmZZWFFpT2pFek9UZ3lOVEV5T0RBc0luQmhlVzFsYm5SZmFXUWlPalEwTVRRNE9EUTRNalkwT0RBeE5Td2ljWFZoYm5ScGRIa2lPaUl4SWl3aWMzUmhkSFZ6SWpvaVkyOXRjR3hsZEdWa0luMCJ9"); * //} else if (product == "com.bitoon.classicgolf.bolsagemas") { //saco * // //purchaseHardCurrency(product, "facebook", LoadXmlData.baseUrl + "/golfws/rest/market/exchange", "", "eyJwYXltZW50X2lkIjo0NDE0ODg0ODkzMTQ2ODEsImFtb3VudCI6IjI1LjAwIiwiY3VycmVuY3kiOiJFVVIiLCJxdWFudGl0eSI6IjEiLCJzdGF0dXMiOiJjb21wbGV0ZWQiLCJzaWduZWRfcmVxdWVzdCI6IjZyMW8yX1IxQ1pOdHlHeUdvZXdGYjlKbTZ3WUxxV3FIajYzRWl1SHlBLW8uZXlKaGJHZHZjbWwwYUcwaU9pSklUVUZETFZOSVFUSTFOaUlzSW1GdGIzVnVkQ0k2SWpJMUxqQXdJaXdpWTNWeWNtVnVZM2tpT2lKRlZWSWlMQ0pwYzNOMVpXUmZZWFFpT2pFek9UZ3lOVEV6TkRZc0luQmhlVzFsYm5SZmFXUWlPalEwTVRRNE9EUTRPVE14TkRZNE1Td2ljWFZoYm5ScGRIa2lPaUl4SWl3aWMzUmhkSFZ6SWpvaVkyOXRjR3hsZEdWa0luMCJ9"); * //} else if (product == "com.bitoon.classicgolf.joyerogemas") {//cofre * // //purchaseHardCurrency(product, "facebook", LoadXmlData.baseUrl + "/golfws/rest/market/exchange", "", "eyJwYXltZW50X2lkIjo0NDE0ODg0OTI2NDgwMTQsImFtb3VudCI6IjUwLjAwIiwiY3VycmVuY3kiOiJFVVIiLCJxdWFudGl0eSI6IjEiLCJzdGF0dXMiOiJjb21wbGV0ZWQiLCJzaWduZWRfcmVxdWVzdCI6Ill3eEJTM2p2WWlrVjdQbVhJemM5STluSUZoMklwaWw1Z3p4Y0UwNUNJTEUuZXlKaGJHZHZjbWwwYUcwaU9pSklUVUZETFZOSVFUSTFOaUlzSW1GdGIzVnVkQ0k2SWpVd0xqQXdJaXdpWTNWeWNtVnVZM2tpT2lKRlZWSWlMQ0pwYzNOMVpXUmZZWFFpT2pFek9UZ3lOVEUwTWpJc0luQmhlVzFsYm5SZmFXUWlPalEwTVRRNE9EUTVNalkwT0RBeE5Dd2ljWFZoYm5ScGRIa2lPaUl4SWl3aWMzUmhkSFZ6SWpvaVkyOXRjR3hsZEdWa0luMCJ9"); * //} else if (product == "com.bitoon.classicgolf.sacogemas") { // camion * // //purchaseHardCurrency(product, "facebook", LoadXmlData.baseUrl + "/golfws/rest/market/exchange", "", "eyJwYXltZW50X2lkIjo0NDE0ODg1MzkzMTQ2NzYsImFtb3VudCI6IjEwMC4wMCIsImN1cnJlbmN5IjoiRVVSIiwicXVhbnRpdHkiOiIxIiwic3RhdHVzIjoiY29tcGxldGVkIiwic2lnbmVkX3JlcXVlc3QiOiJWUWR6eXBKMnBETGoyU0lBZ0NoaGd5NThwTUtFdW9IeWVFOW52cTROcjkwLmV5SmhiR2R2Y21sMGFHMGlPaUpJVFVGRExWTklRVEkxTmlJc0ltRnRiM1Z1ZENJNklqRXdNQzR3TUNJc0ltTjFjbkpsYm1ONUlqb2lSVlZTSWl3aWFYTnpkV1ZrWDJGMElqb3hNems0TWpVeU16UXpMQ0p3WVhsdFpXNTBYMmxrSWpvME5ERTBPRGcxTXprek1UUTJOellzSW5GMVlXNTBhWFI1SWpvaU1TSXNJbk4wWVhSMWN5STZJbU52YlhCc1pYUmxaQ0o5In0="); * //} else if (product == "com.bitoon.classicgolf.cofregemas") { //000000 * // //purchaseHardCurrency(product, "facebook", LoadXmlData.baseUrl + "/golfws/rest/market/exchange", "", "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"); * //} else ; * ////purchaseHardCurrency(product, "facebook", LoadXmlData.baseUrl + "/golfws/rest/market/exchange", "",Convert.ToBase64String(Encoding.UTF8.GetBytes(response.Text))); * } * }); */ #endif }
public void PurchaseItem(ButtonEventArgs args) { if (!CoreUtility.Me.ShowInternetConnection()) { return; } #if (UNITY_IOS && !STOREKIT) || (UNITY_ANDROID && !GOOGLEIAB) PopupMessages.Me.InAppNotIntegratedMessage(); return; #endif string coststring; int index; int.TryParse(args.data, out index); pID = InAppInfo[index].ID; isRestore = false; isRestoreItemSuccess = false; coststring = isProductReceived && isLocalStoreCost ? InAppInfo[index].CostStringLocaleBase : "$" + InAppInfo[index].CostUSD; MyDebug.Log("InAppManager::PurchaseItem => " + pID + ", " + index + ", " + InAppInfo[index].DisplayName + ", " + coststring); PopupMessages.Me.InAppProcessMessage(InAppInfo[index].DisplayName, coststring); #if UNITY_EDITOR PurchaseSuccessful(pID, "UnityTest_" + System.DateTime.Now.ToOADate()); return; #endif #region iOS Methods #if UNITY_IOS && !UNITY_EDITOR && STOREKIT StoreKitBinding.purchaseProduct(pID, 1); #endif #endregion #region Android => Google Play Mathods #if UNITY_ANDROID && !UNITY_EDITOR && !AMAZONSTORE && GOOGLEIAB GoogleIAB.queryInventory(inappids); #endif #endregion #region Android => Amazon Store Methods #if UNITY_ANDROID && !UNITY_EDITOR && AMAZONSTORE #if UNDERGROUND pID = pID.Replace("supercell.", "supercell.underground."); #endif if (unavailableSkus.Contains(pID)) { ItemUnavailable(pID); return; } // Construct object passed to operation as input SkuInput request = new SkuInput(); request.Sku = pID; // Call synchronous operation with input object RequestOutput response = iapService.Purchase(request); #endif #endregion }
// when billing is supported on the device, // this method requests IAP product data from Google/Apple private void RequestProductData() { #if UNITY_IPHONE StoreKitBinding.requestProductData(ids); #elif UNITY_ANDROID GoogleIAB.queryInventory(ids); #endif }
void callback_Compelete_puchaseIOS() { // loading UI true Loadmanager.instance.LoadingUI(true); //소모 처 리를 한다 StoreKitBinding.finishPendingTransaction(transactionProduct.transactionIdentifier); }
public static void buyItem(string itemID) { #if UNITY_ANDROID GoogleIAB.purchaseProduct(itemID); #elif UNITY_IPHONE StoreKitBinding.purchaseProduct(itemID, 1); #endif }
protected override void Purchase(MarketLot lot) { Debug.Log("IOSBilling. Purchase lot:" + lot); if (_canMakePayments) { StoreKitBinding.purchaseProduct(lot.ProductIOSIdentifier, 1); } }
void Start() { StoreKitBinding.requestProductData(productList); StoreKitManager.productListReceivedEvent += allProducts => { Debug.Log("received total products: " + allProducts.Count); _products = allProducts; }; }
// iOS Only. Restores all previous transactions. This is used when a user gets a new device and they need to restore their old purchases. // DO NOT call this on every launch. It will prompt the user for their password. Each transaction that is restored will have // the completion handler called for it public static void restoreCompletedTransactions(Action <string> completionHandler) { _purchaseCompletionAction = null; _purchaseRestorationAction = completionHandler; #if UNITY_IPHONE StoreKitBinding.restoreCompletedTransactions(); #endif }
/// <summary> /// purchase non-consumable product based on its product id. /// Our delegates then fire the appropriate succeeded/fail event. /// Additionally, non-consumables are being saved to the database /// </summary> public static void PurchaseNonconsumableProduct(string productId) { productId = GetIAPObject(productId).GetIdentifier(); #if UNITY_ANDROID GoogleIAB.purchaseProduct(productId, "nonconsume"); #elif UNITY_IPHONE StoreKitBinding.purchaseProduct(productId, 1); #endif }
protected override void PlatformRequestProductList(string[] products) { #if UNITY_IPHONE StoreKitManager.productListReceivedEvent -= OnProductListReceived; StoreKitManager.productListReceivedEvent += OnProductListReceived; StoreKitBinding.requestProductData(products); #endif }
// Accepts two arrays of product identifiers (one for iOS one for Android). All of the products you have for sale should be requested in one call. public static void requestProductData(string[] iosProductIdentifiers, string[] androidSkus, Action <List <IAPProduct> > completionHandler) { _productListReceivedAction = completionHandler; #if UNITY_ANDROID GoogleIAB.queryInventory(androidSkus); #elif UNITY_IPHONE StoreKitBinding.requestProductData(iosProductIdentifiers); #endif }
// // #region "iOS Events Handelers" #if UNITY_IOS && STOREKIT void RequestProduct() { if (isProductReceived) { CancelInvoke("RequestProduct"); return; } MyDebug.Log("Requesting product for the iOS"); StoreKitBinding.requestProductData(inappids); }
// Purchases the given product and quantity. completionHandler provides if the purchase succeeded public static void purchaseNonconsumableProduct(string productId, Action <bool> completionHandler) { _purchaseCompletionAction = completionHandler; #if UNITY_ANDROID GoogleIAB.purchaseProduct(productId, NON_CONSUMABLE_PAYLOAD); #elif UNITY_IPHONE StoreKitBinding.purchaseProduct(productId, 1); #endif }
public static void getItems() { string[] _idItems = new string[] { BillingItemsIDs.teeth_01, BillingItemsIDs.teeth_02, BillingItemsIDs.teeth_03, BillingItemsIDs.teeth_04 }; #if UNITY_ANDROID GoogleIAB.queryInventory(_idItems); #elif UNITY_IPHONE StoreKitBinding.requestProductData(_idItems); #endif }
// _////////////////////////////////////////////////_ _____ Action _____ 구 매 _____ public void PurchaseProduct(string pProductID) { Ag.LogStartWithStr(3, "Purchase Product >>> " + pProductID + " From Apple Count : " + ProdNumFromAppl); AgStt.IntendedPause = true; // 구매 진행 시작. Node close 방지. ReceiptOfIAP = ""; //ProductID = "com.appsgraphy.psykickbattlekakao." + pProductID; // cash0500 .. cash0030.. ProductID = pProductID; StoreKitBinding.purchaseProduct(productIdentifier: ProductID, quantity: 1); Ag.LogString(" Sent ... " + ProductID); }
public void productPurchaseAwaitingConfirmation(string json) { if (productPurchaseAwaitingConfirmationEvent != null) { productPurchaseAwaitingConfirmationEvent(StoreKitTransaction.transactionFromJson(json)); } if (autoConfirmTransactions) { StoreKitBinding.finishPendingTransactions(); } }
void myMakePurchaseMethod(UpsightPurchase purchase) { if (purchase != null) { # if UNITY_IPHONE if (StoreKitBinding.canMakePayments()) { StoreKitBinding.purchaseProduct(purchase.productIdentifier, purchase.quantity); } # endif # if UNITY_ANDROID
public void BuyProduct(IAP iap) { IAPUnit mIap = mInAppProducts.Find(f => (f.mIap == iap)); #if UNITY_ANDROID GoogleIAB.purchaseProduct(mIap.IAP_Id); #endif #if UNITY_IOS StoreKitBinding.purchaseProduct(mIap.IAP_Id, 1); #endif }