update: Json 解析添加 TryCatch
parent
a056a5c23d
commit
7bd9413a83
|
|
@ -1,5 +1,7 @@
|
|||
|
||||
|
||||
using System;
|
||||
|
||||
namespace Guru
|
||||
{
|
||||
using System.Text;
|
||||
|
|
@ -49,24 +51,31 @@ namespace Guru
|
|||
|
||||
protected override void RequestSuccessCallBack(string response)
|
||||
{
|
||||
ResponseData<OrderResponse> responseData = JsonUtility.FromJson<ResponseData<OrderResponse>>(response);
|
||||
if (responseData != null && responseData.data != null)
|
||||
try
|
||||
{
|
||||
double usdPrice = responseData.data.usdPrice;
|
||||
Analytics.Tch001IAPRev(usdPrice);
|
||||
Analytics.Tch02IAPRev(usdPrice);
|
||||
if (orderType == 0)
|
||||
ResponseData<OrderResponse> responseData = JsonUtility.FromJson<ResponseData<OrderResponse>>(response);
|
||||
if (responseData != null && responseData.data != null)
|
||||
{
|
||||
AdjustService.TrackIAPPurchase(usdPrice, productId);
|
||||
Analytics.IAPPurchase(usdPrice, productId);
|
||||
double usdPrice = responseData.data.usdPrice;
|
||||
Analytics.Tch001IAPRev(usdPrice);
|
||||
Analytics.Tch02IAPRev(usdPrice);
|
||||
if (orderType == 0)
|
||||
{
|
||||
AdjustService.TrackIAPPurchase(usdPrice, productId);
|
||||
Analytics.IAPPurchase(usdPrice, productId);
|
||||
}
|
||||
else if (orderType == 1)
|
||||
{
|
||||
AdjustService.TrackSubPurchase(usdPrice, productId);
|
||||
Analytics.SubPurchase(usdPrice, productId);
|
||||
}
|
||||
}
|
||||
else if (orderType == 1)
|
||||
{
|
||||
AdjustService.TrackSubPurchase(usdPrice, productId);
|
||||
Analytics.SubPurchase(usdPrice, productId);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Analytics.LogCrashlytics(ex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
using Guru.LitJson;
|
||||
using UnityEngine;
|
||||
|
|
@ -48,31 +49,37 @@ namespace Guru
|
|||
|
||||
protected override void RequestSuccessCallBack(string response)
|
||||
{
|
||||
ResponseData<OrderResponse> responseData = JsonUtility.FromJson<ResponseData<OrderResponse>>(response);
|
||||
if (responseData != null && responseData.data != null)
|
||||
try
|
||||
{
|
||||
// Analytics.Tch001IAPRev(responseData.data.usdPrice);
|
||||
double usdPrice = responseData.data.usdPrice;
|
||||
Analytics.Tch001IAPRev(usdPrice);
|
||||
Analytics.Tch02IAPRev(usdPrice);
|
||||
|
||||
string pid = "";
|
||||
|
||||
if (!string.IsNullOrEmpty(productId))
|
||||
ResponseData<OrderResponse> responseData = JsonUtility.FromJson<ResponseData<OrderResponse>>(response);
|
||||
if (responseData != null && responseData.data != null)
|
||||
{
|
||||
pid = productId;
|
||||
AdjustService.TrackIAPPurchase(usdPrice, productId); // 上报 IAP 支付事件
|
||||
Analytics.IAPPurchase(usdPrice, pid);
|
||||
}
|
||||
// Analytics.Tch001IAPRev(responseData.data.usdPrice);
|
||||
double usdPrice = responseData.data.usdPrice;
|
||||
Analytics.Tch001IAPRev(usdPrice);
|
||||
Analytics.Tch02IAPRev(usdPrice);
|
||||
|
||||
if (!string.IsNullOrEmpty(subscriptionId))
|
||||
{
|
||||
pid = subscriptionId;
|
||||
AdjustService.TrackSubPurchase(usdPrice, productId); // 上报 订阅 支付事件
|
||||
Analytics.SubPurchase(usdPrice, productId);
|
||||
string pid = "";
|
||||
|
||||
if (!string.IsNullOrEmpty(productId))
|
||||
{
|
||||
pid = productId;
|
||||
AdjustService.TrackIAPPurchase(usdPrice, productId); // 上报 IAP 支付事件
|
||||
Analytics.IAPPurchase(usdPrice, pid);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(subscriptionId))
|
||||
{
|
||||
pid = subscriptionId;
|
||||
AdjustService.TrackSubPurchase(usdPrice, productId); // 上报 订阅 支付事件
|
||||
Analytics.SubPurchase(usdPrice, productId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch (Exception ex)
|
||||
{
|
||||
Analytics.LogCrashlytics(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue