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 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 }