public IEnumerator Start() { yield return(new WaitUntil(() => TableDataLoadManager.instance.isLoadDone)); Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived; Firebase.Messaging.FirebaseMessaging.MessageReceived += OnMessageReceived; Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => { var dependencyStatus = task.Result; if (dependencyStatus == Firebase.DependencyStatus.Available) { // Create and hold a reference to your FirebaseApp, // where app is a Firebase.FirebaseApp property of your application class. app = Firebase.FirebaseApp.DefaultInstance; Debug.Log("파이어 베이스 앱 초기화 완료"); // Set a flag here to indicate whether Firebase is ready to use by your app. } else { Debug.LogError(System.String.Format("Could not resolve all Firebase dependencies: {0}", dependencyStatus)); // Firebase Unity SDK is not safe to use here. } }); #if UNITY_EDITOR #elif UNITY_ANDROID BackEnd.BackendReturnObject bro = BackEnd.Backend.Android.PutDeviceToken(); Debug.Log("뒤끝 푸시 : " + bro.GetMessage()); #endif }
private void UseCash(Store_Information p) { BackEnd.BackendReturnObject bro = BackEnd.Backend.TBC.UseTBC(p.UUID, ""); if (bro.IsSuccess()) { p.ProvideItems(); var s = bro.GetReturnValuetoJSON()["amountTBC"].ToString(); Game_Manager.Instance.backendManager.Wealth[WealthManager.WealthType.Cash] = System.Convert.ToInt32(s); WealthManager.Instance.DIsplayWealth(Game_Manager.Instance.backendManager.Wealth); } }
PurchaseProcessingResult IStoreListener.ProcessPurchase(PurchaseEventArgs e) { bool isSuccess = true; #if UNITY_ANDROID && !UNITY_EDITOR CrossPlatformValidator validator = new CrossPlatformValidator(GooglePlayTangle.Data(), AppleTangle.Data(), Application.identifier); try { IPurchaseReceipt[] result = validator.Validate(e.purchasedProduct.receipt); for (int i = 0; i < result.Length; i++) { Analytics.Transaction(result[i].productID, e.purchasedProduct.metadata.localizedPrice, e.purchasedProduct.metadata.isoCurrencyCode, result[i].transactionID, null); } } catch (IAPSecurityException) { isSuccess = false; } #elif UNITY_IPHONE #endif BackEnd.BackendReturnObject bro = null; if (isSuccess) { bool isTBCCarge = true; switch (e.purchasedProduct.definition.id) { case "car_5500": case "car_27500": isTBCCarge = false; break; default: isTBCCarge = true; break; } #if UNITY_ANDROID && !UNITY_EDITOR if (isTBCCarge) { bro = BackEnd.Backend.TBC.ChargeTBC(e.purchasedProduct.receipt, ""); } else { bro = BackEnd.Backend.Receipt.IsValidateGooglePurchase(e.purchasedProduct.receipt, ""); } if (bro.IsSuccess()) { } else { return(PurchaseProcessingResult.Pending); } //var asd = bro.GetReturnValuetoJSON()[0]; //var qwe = asd[0]; //값 뭐 들어오나 확인해야 한 DesignConstStorage.DoItList(); //txtLog.text = string.Format("{1}", e.purchasedProduct.receipt, bro.GetReturnValue()); //txtLog.text = string.Format("{0}", asd.ToString()); //txtLog.text = string.Format("{0} {1}", asd.ToString(), qwe.ToString()); //string[] qweqwe = new string[2]; //int qq = 0; //JObject obj = JObject.Parse(bro.GetReturnValue()); //Foreach로 각 테이블 이름 받아옴. //foreach (var a in obj) //{ // string qwoitnwbye = string.Format("{0} {1}", a.Key.ToString(), a.Value); // qweqwe[qq++] = qwoitnwbye; // txtLog.text = string.Format("{0} {1}", a.Key.ToString(), a.Value); // JArray array = JArray.Parse(a.Value.ToString()); // foreach (var s in array) // { // //txtLog.text = string.Format("{0} {1}", , s.ToString()); // qweqwe[qq] = a.Key.ToString(); // int weqg = // } //} //BackEnd.Param param = new BackEnd.Param(); //param.Add(bro.GetReturnValue()); //BackEnd.Backend.GameInfo.InsertLog("1", param); #elif UNITY_IPHONE #else //bro = BackEnd.Backend.TBC.ChargeTBC(e.purchasedProduct.receipt, ""); #endif //if (bro != null) //{ //} //여기서 현금 결제 아이템 제공한다. ProvideItems(e.purchasedProduct.definition.id); //Debug.Log("구매 완료"); // if (e.purchasedProduct.definition.id.Equals(sProductIds[0])) // WealthManager.Instance.IncomeWealth(WealthManager.WealthType.Cash, 100); //else if (e.purchasedProduct.definition.id.Equals(sProductIds[1])) // WealthManager.Instance.IncomeWealth(WealthManager.WealthType.Cash, 500); } else { //txtLog.text = "구매 실패 : 비정상 결제"; // Debug.Log(txtLog.text); //sInfo = null; } sInfo = null; return(PurchaseProcessingResult.Complete); }