From 3033c42c0327695e1f0a1fcaa86043cb424c0515 Mon Sep 17 00:00:00 2001 From: huyufei Date: Fri, 17 May 2024 19:19:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Facebook=20?= =?UTF-8?q?=E7=9A=84=E9=80=92=E5=BD=92=E8=B0=83=E7=94=A8BUG.=20=E5=8D=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huyufei --- .../Analytics/Analytics.TemplateDefine.cs | 20 +++++++------------ .../Requests/RefreshFirebaseTokenRequest.cs | 1 + .../GuruIAP/Runtime/Code/IAPServiceBase.cs | 3 ++- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Runtime/GuruCore/Runtime/Analytics/Analytics.TemplateDefine.cs b/Runtime/GuruCore/Runtime/Analytics/Analytics.TemplateDefine.cs index 8cbec11..9f11fae 100644 --- a/Runtime/GuruCore/Runtime/Analytics/Analytics.TemplateDefine.cs +++ b/Runtime/GuruCore/Runtime/Analytics/Analytics.TemplateDefine.cs @@ -469,24 +469,18 @@ namespace Guru /// public static void FBPurchase(float revenue, string currency, string type, string platfrom) { - FBService.LogPurchase(revenue, currency, new Dictionary() + var data = new Dictionary() { { AppEventParameterName.Currency, USD }, { AppEventParameterName.ContentType, type }, - { ParameterAdPlatform, platfrom}, - }); + { ParameterAdPlatform, platfrom }, + }; + FBService.LogPurchase(revenue, currency, data); } - - /// - /// Facebook 支付上报 - /// - /// - /// - /// - /// - 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); + /// /// Google ARO买量点 /// diff --git a/Runtime/GuruCore/Runtime/IPM/Scripts/Requests/RefreshFirebaseTokenRequest.cs b/Runtime/GuruCore/Runtime/IPM/Scripts/Requests/RefreshFirebaseTokenRequest.cs index d750745..ce31327 100644 --- a/Runtime/GuruCore/Runtime/IPM/Scripts/Requests/RefreshFirebaseTokenRequest.cs +++ b/Runtime/GuruCore/Runtime/IPM/Scripts/Requests/RefreshFirebaseTokenRequest.cs @@ -14,6 +14,7 @@ namespace Guru var request = new UnityWebRequest(RequestURL, "POST"); //request.uploadHandler = new UploadHandlerRaw(); 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_APPID, IPMConfig.IPM_X_APP_ID); request.SetRequestHeader(IPMConfig.Header_Param_UID, IPMConfig.IPM_UID); diff --git a/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs b/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs index 91aa81c..fe0e266 100644 --- a/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs +++ b/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs @@ -613,6 +613,7 @@ namespace Guru Analytics.LogCrashlytics(new Exception(msg)); } + LogI($"{Tag} --- Call OnBuyEnd [{productName}] :: {OnBuyEnd}"); OnBuyEnd?.Invoke(productName, success); OnPurchaseOver(success, productName); // 支付成功处理逻辑 ClearCurPurchasingProduct(); // 清除购买缓存 @@ -881,7 +882,7 @@ namespace Guru /// public static void SetIsIAPUser(bool value = true) { - if (Instance != null && Instance._model != null) + if (Instance != null && Instance._model != null && value) { Instance._model.SetIsIapUser(value); // 用户属性 }