void OnDestroy() { if (debug) { Debug.Log("[GamedoniaStoreInAppPurchases] StopInAppBilling"); } GamedoniaStore.StopInAppBilling(); }
public void ProductPurchased(string response) { if (debug) { Debug.Log("[GamedoniaStoreInAppPurchases] ProductPurchased: " + response); } if (response != null) { GamedoniaStore.ProductPurchased(response); } if (GamedoniaStore.purchaseResponse != null && GamedoniaStore.purchaseResponse.success) { #if UNITY_EDITOR OnPurchaseResponse(); #elif UNITY_IPHONE Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters["deviceId"] = GamedoniaDevices.device.deviceId; parameters["receipt"] = GamedoniaStore.purchaseResponse.receipt; GamedoniaStore.VerifyPurchase(parameters, delegate(bool success) { if (!success) { GamedoniaStore.purchaseResponse.success = false; GamedoniaStore.purchaseResponse.status = "error"; GamedoniaStore.purchaseResponse.message = "purchase verification failed"; } OnPurchaseResponse(); } ); #elif UNITY_ANDROID Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters["deviceId"] = GamedoniaDevices.device.deviceId; parameters["receipt"] = GamedoniaStore.purchaseResponse.receipt; GamedoniaStore.VerifyPurchase(parameters, delegate(bool success) { if (!success) { GamedoniaStore.purchaseResponse.success = false; GamedoniaStore.purchaseResponse.status = "error"; GamedoniaStore.purchaseResponse.message = "purchase verification failed"; } OnPurchaseResponse(); } ); #endif } else { OnPurchaseResponse(); } }
public void ProductsRequested(string response) { if (debug) { Debug.Log("[GamedoniaStoreInAppPurchases] ProductsRequested: " + response); } if (response != null) { GamedoniaStore.ProductsRequested(response); } OnRequestResponse(); }
void OnLogin(bool success) { statusMsg = ""; if (success) { printToConsole("Session started successfully. uid: " + GamedoniaUsers.me._id); //Requesting products GamedoniaStore.RequestProducts(productsList, productsList.Length); } else { errorMsg = Gamedonia.getLastError().ToString(); Debug.Log(errorMsg); } }
void Awake() { GDService service = new GDService(); service.ProfileEvent += new ProfilerEventHandler(Profile); GamedoniaDevices.services.Add(service); #if UNITY_EDITOR #elif UNITY_ANDROID if (debug) { Debug.Log("[GamedoniaStoreInAppPurchases] StartInAppBilling"); } GamedoniaStore.StartInAppBilling(androidPublickey); #endif }
private void purchaseGas() { if (!Application.isEditor) { if (gasProgress < 1) { statusMsg = "Purchasing GAS..."; GamedoniaStore.BuyProduct("gas"); } else { printToConsole("Already full of gas!, drive to spent some"); } } else { printToConsole("Purchase is disabled in Editor mode!!"); } }
public void RequestProducts() { GamedoniaStore.RequestProducts(products_list, products_list.Length); }
public void BuyProduct() { //GamedoniaStore.RequestProducts(consumable_products, consumable_products.Length); GamedoniaStore.BuyProduct("m_lives"); }