Ejemplo n.º 1
0
 void OnDestroy()
 {
     if (debug)
     {
         Debug.Log("[GamedoniaStoreInAppPurchases] StopInAppBilling");
     }
     GamedoniaStore.StopInAppBilling();
 }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
        public void ProductsRequested(string response)
        {
            if (debug)
            {
                Debug.Log("[GamedoniaStoreInAppPurchases] ProductsRequested: " + response);
            }
            if (response != null)
            {
                GamedoniaStore.ProductsRequested(response);
            }

            OnRequestResponse();
        }
Ejemplo n.º 4
0
        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
        }