fix: 修复 Facebook 的递归调用BUG. 卡支付

Signed-off-by: huyufei <yufei.hu@castbox.fm>
deeplink
胡宇飞 2024-05-17 19:19:39 +08:00
parent 1862517c0f
commit 3033c42c03
3 changed files with 10 additions and 14 deletions

View File

@ -469,24 +469,18 @@ namespace Guru
/// <param name="platfrom"></param> /// <param name="platfrom"></param>
public static void FBPurchase(float revenue, string currency, string type, string platfrom) public static void FBPurchase(float revenue, string currency, string type, string platfrom)
{ {
FBService.LogPurchase(revenue, currency, new Dictionary<string, object>() var data = new Dictionary<string, object>()
{ {
{ AppEventParameterName.Currency, USD }, { AppEventParameterName.Currency, USD },
{ AppEventParameterName.ContentType, type }, { AppEventParameterName.ContentType, type },
{ ParameterAdPlatform, platfrom}, { ParameterAdPlatform, platfrom },
}); };
FBService.LogPurchase(revenue, currency, data);
} }
/// <summary>
/// Facebook 支付上报
/// </summary>
/// <param name="value"></param>
/// <param name="currency"></param>
/// <param name="type"></param>
/// <param name="platfrom"></param>
public static void FBPurchase(double value, string currency, string type, string platfrom)
=> FBPurchase(value, currency, type, platfrom);
public static void FBPurchase(double revenue, string currency, string type, string platfrom)
=> FBPurchase((float)revenue, currency, type, platfrom);
/// <summary> /// <summary>
/// Google ARO买量点 /// Google ARO买量点
/// </summary> /// </summary>

View File

@ -14,6 +14,7 @@ namespace Guru
var request = new UnityWebRequest(RequestURL, "POST"); var request = new UnityWebRequest(RequestURL, "POST");
//request.uploadHandler = new UploadHandlerRaw(); //request.uploadHandler = new UploadHandlerRaw();
request.downloadHandler = new DownloadHandlerBuffer(); request.downloadHandler = new DownloadHandlerBuffer();
Debug.Log($"[SDK] --- RefreshFirebaseTokenRequest :: contentTYpe: {IPMConfig.Header_Value_ContentType} AppID: {IPMConfig.IPM_X_APP_ID} UID: {IPMConfig.IPM_UID} AccessToken: {IPMConfig.IPM_TOKEN}");
request.SetRequestHeader(IPMConfig.Header_Param_ContentType, IPMConfig.Header_Value_ContentType); request.SetRequestHeader(IPMConfig.Header_Param_ContentType, IPMConfig.Header_Value_ContentType);
request.SetRequestHeader(IPMConfig.Header_Param_APPID, IPMConfig.IPM_X_APP_ID); request.SetRequestHeader(IPMConfig.Header_Param_APPID, IPMConfig.IPM_X_APP_ID);
request.SetRequestHeader(IPMConfig.Header_Param_UID, IPMConfig.IPM_UID); request.SetRequestHeader(IPMConfig.Header_Param_UID, IPMConfig.IPM_UID);

View File

@ -613,6 +613,7 @@ namespace Guru
Analytics.LogCrashlytics(new Exception(msg)); Analytics.LogCrashlytics(new Exception(msg));
} }
LogI($"{Tag} --- Call OnBuyEnd [{productName}] :: {OnBuyEnd}");
OnBuyEnd?.Invoke(productName, success); OnBuyEnd?.Invoke(productName, success);
OnPurchaseOver(success, productName); // 支付成功处理逻辑 OnPurchaseOver(success, productName); // 支付成功处理逻辑
ClearCurPurchasingProduct(); // 清除购买缓存 ClearCurPurchasingProduct(); // 清除购买缓存
@ -881,7 +882,7 @@ namespace Guru
/// <param name="value"></param> /// <param name="value"></param>
public static void SetIsIAPUser(bool value = true) public static void SetIsIAPUser(bool value = true)
{ {
if (Instance != null && Instance._model != null) if (Instance != null && Instance._model != null && value)
{ {
Instance._model.SetIsIapUser(value); // 用户属性 Instance._model.SetIsIapUser(value); // 用户属性
} }