fix: 为 iap_purchase 添加 sandbox 参数
--story=1020884 --user=yufei.hu 【中台】【BUG】补齐 iap_purchase 打点的 sandbox 参数 https://www.tapd.cn/33527076/s/1156167 Signed-off-by: huyufei <yufei.hu@castbox.fm>main
parent
4989926a47
commit
19a46fff1e
|
|
@ -659,12 +659,12 @@ namespace Guru
|
||||||
if (orderData.orderType == 1)
|
if (orderData.orderType == 1)
|
||||||
{
|
{
|
||||||
// sub_pruchase : Firebase + Guru + Adjust
|
// sub_pruchase : Firebase + Guru + Adjust
|
||||||
SubPurchase(usdPrice, productId, orderId, orderDate, productToken, receipt);
|
SubPurchase(usdPrice, productId, orderId, orderDate, productToken, receipt, isTest);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// iap_purchase : Firebase + Guru + Adjust
|
// iap_purchase : Firebase + Guru + Adjust
|
||||||
IAPPurchase(usdPrice, productId, orderId, orderDate, productToken, receipt);
|
IAPPurchase(usdPrice, productId, orderId, orderDate, productToken, receipt, isTest);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IAP Ret true : Firebase + Guru + Adjust
|
// IAP Ret true : Firebase + Guru + Adjust
|
||||||
|
|
@ -685,10 +685,11 @@ namespace Guru
|
||||||
/// <param name="orderDate"></param>
|
/// <param name="orderDate"></param>
|
||||||
/// <param name="purchaseToken"></param>
|
/// <param name="purchaseToken"></param>
|
||||||
/// <param name="receipt"></param>
|
/// <param name="receipt"></param>
|
||||||
|
/// <param name="isSandbox"></param>
|
||||||
public static void IAPPurchase(double value, string productId, string orderId, string orderDate,
|
public static void IAPPurchase(double value, string productId, string orderId, string orderDate,
|
||||||
string purchaseToken = "", string receipt = "")
|
string purchaseToken = "", string receipt = "", bool isSandbox = false)
|
||||||
{
|
{
|
||||||
IAPPurchaseReport(EventIAPPurchase, value, productId, orderId, "IAP", orderDate, purchaseToken, receipt);
|
IAPPurchaseReport(EventIAPPurchase, value, productId, orderId, "IAP", orderDate, purchaseToken, receipt, isSandbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -700,14 +701,15 @@ namespace Guru
|
||||||
/// <param name="orderDate"></param>
|
/// <param name="orderDate"></param>
|
||||||
/// <param name="purchaseToken"></param>
|
/// <param name="purchaseToken"></param>
|
||||||
/// <param name="receipt"></param>
|
/// <param name="receipt"></param>
|
||||||
|
/// <param name="isSandbox"></param>
|
||||||
public static void SubPurchase(double value, string productId, string orderId, string orderDate,
|
public static void SubPurchase(double value, string productId, string orderId, string orderDate,
|
||||||
string purchaseToken = "", string receipt = "")
|
string purchaseToken = "", string receipt = "", bool isSandbox = false)
|
||||||
{
|
{
|
||||||
IAPPurchaseReport(EventSubPurchase, value, productId, orderId, "SUB", orderDate, purchaseToken, receipt);
|
IAPPurchaseReport(EventSubPurchase, value, productId, orderId, "SUB", orderDate, purchaseToken, receipt, isSandbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void IAPPurchaseReport(string eventName, double value, string productId,
|
private static void IAPPurchaseReport(string eventName, double value, string productId,
|
||||||
string orderId, string orderType, string orderDate, string purchaseToken = "", string receipt = "")
|
string orderId, string orderType, string orderDate, string purchaseToken = "", string receipt = "", bool isSandbox = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
var dict = new Dictionary<string, dynamic>()
|
var dict = new Dictionary<string, dynamic>()
|
||||||
|
|
@ -718,9 +720,12 @@ namespace Guru
|
||||||
[ParameterProductId] = productId,
|
[ParameterProductId] = productId,
|
||||||
["order_id"] = orderId,
|
["order_id"] = orderId,
|
||||||
["order_type"] = orderType,
|
["order_type"] = orderType,
|
||||||
["trans_ts"] = orderDate
|
["trans_ts"] = orderDate,
|
||||||
|
["sandbox"] = isSandbox? "true": "false"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 上报Firebase + 自打点
|
// 上报Firebase + 自打点
|
||||||
LogEvent(eventName, dict, new EventSetting() { EnableFirebaseAnalytics = true });
|
LogEvent(eventName, dict, new EventSetting() { EnableFirebaseAnalytics = true });
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace Guru
|
namespace Guru
|
||||||
{
|
{
|
||||||
|
|
@ -8,6 +7,7 @@ namespace Guru
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using com.adjust.sdk;
|
using com.adjust.sdk;
|
||||||
using Facebook.Unity;
|
using Facebook.Unity;
|
||||||
|
using UnityEngine;
|
||||||
using Firebase.Analytics;
|
using Firebase.Analytics;
|
||||||
using Firebase.Crashlytics;
|
using Firebase.Crashlytics;
|
||||||
|
|
||||||
|
|
@ -197,7 +197,7 @@ namespace Guru
|
||||||
string paramStr = string.Join(",", extras);
|
string paramStr = string.Join(",", extras);
|
||||||
Log.I(TAG, $"eventName:{eventName}, params:{paramStr}");
|
Log.I(TAG, $"eventName:{eventName}, params:{paramStr}");
|
||||||
|
|
||||||
eventSetting ??= _defaultEventSetting;
|
if (eventSetting == null) eventSetting = _defaultEventSetting;
|
||||||
if (eventSetting.EnableFirebaseAnalytics)
|
if (eventSetting.EnableFirebaseAnalytics)
|
||||||
{
|
{
|
||||||
List<Parameter> parameters = new List<Parameter>();
|
List<Parameter> parameters = new List<Parameter>();
|
||||||
|
|
@ -219,7 +219,6 @@ namespace Guru
|
||||||
parameters.Add(new Parameter(kv.Key, decimal.ToDouble(decimalValue)));
|
parameters.Add(new Parameter(kv.Key, decimal.ToDouble(decimalValue)));
|
||||||
else
|
else
|
||||||
parameters.Add(new Parameter(kv.Key, kv.Value.ToString()));
|
parameters.Add(new Parameter(kv.Key, kv.Value.ToString()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FirebaseAnalytics.LogEvent(eventName, parameters.ToArray());
|
FirebaseAnalytics.LogEvent(eventName, parameters.ToArray());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue