update: 更新 Crashlytics 上报接口

main
胡宇飞 2024-08-11 15:03:13 +08:00
parent b0670ccafc
commit 643bb23939
2 changed files with 9 additions and 7 deletions

View File

@ -1152,7 +1152,7 @@ namespace Guru
CrashlyticsAgent.Log(message); CrashlyticsAgent.Log(message);
} }
public static void CrashException(string message) public static void CrashLogException(string message)
{ {
if (!IsFirebaseReady) return; if (!IsFirebaseReady) return;
CrashlyticsAgent.LogException(message); CrashlyticsAgent.LogException(message);
@ -1164,7 +1164,7 @@ namespace Guru
CrashlyticsAgent.LogException(ex); CrashlyticsAgent.LogException(ex);
} }
public static void CrashCustomKeys(string key, string value) public static void CrashSetCustomKeys(string key, string value)
{ {
if (!IsFirebaseReady) return; if (!IsFirebaseReady) return;
CrashlyticsAgent.SetCustomKey(key, value); CrashlyticsAgent.SetCustomKey(key, value);

View File

@ -290,7 +290,7 @@ namespace Guru
LogI($"#4.3 --- Start IAP ---"); LogI($"#4.3 --- Start IAP ---");
if (_initConfig.GoogleKeys == null || _initConfig.AppleRootCerts == null) if (_initConfig.GoogleKeys == null || _initConfig.AppleRootCerts == null)
{ {
LogException("[IAP] GoogleKeys is null when using IAPService! Integration failed. App will Exit"); LogEx("[IAP] GoogleKeys is null when using IAPService! Integration failed. App will Exit");
} }
@ -400,7 +400,7 @@ namespace Guru
} }
catch (Exception ex) catch (Exception ex)
{ {
LogException(ex); LogEx(ex);
// ignored // ignored
onException?.Invoke(ex); onException?.Invoke(ex);
} }
@ -459,12 +459,12 @@ namespace Guru
} }
private static void LogException(string message) private static void LogEx(string message)
{ {
LogException( new Exception($"{Tag} {message}")); LogEx( new Exception($"{Tag} {message}"));
} }
private static void LogException(Exception e) private static void LogEx(Exception e)
{ {
Debug.LogException(e); Debug.LogException(e);
} }
@ -745,6 +745,8 @@ namespace Guru
// 自打点设置用户 ID // 自打点设置用户 ID
Analytics.SetUid(UID); Analytics.SetUid(UID);
// Crashlytics 设置 uid
CrashlyticsAgent.SetUserId(UID);
// 上报所有的事件 // 上报所有的事件
Analytics.ShouldFlushGuruEvents(); Analytics.ShouldFlushGuruEvents();
} }