update: 调整SDK执行时序

main
胡宇飞 2024-08-08 20:54:55 +08:00
parent 3062467e84
commit a063c4866d
1 changed files with 13 additions and 11 deletions

View File

@ -319,7 +319,7 @@ namespace Guru
// StartAppleReviewFlow(); // 直接显示 ATT 弹窗, 跳过 Consent 流程 // StartAppleReviewFlow(); // 直接显示 ATT 弹窗, 跳过 Consent 流程
Try(() => Try(() =>
{ {
LogI($"#4.5.0 --- StartAppleReviewFlow ---"); LogI($"#4.5 --- StartAppleReviewFlow ---");
StartAppleReviewFlow(); // 直接显示 ATT 弹窗, 跳过 Consent 流程 StartAppleReviewFlow(); // 直接显示 ATT 弹窗, 跳过 Consent 流程
}, ex => }, ex =>
{ {
@ -331,26 +331,28 @@ namespace Guru
//----------- Set Consent ---------------- //----------- Set Consent ----------------
if (!InitConfig.UseCustomConsent && !appleReview) if (!InitConfig.UseCustomConsent && !appleReview)
{ {
// LogI($"--- #3 Start Consent Flow ---"); LogI($"#4.6 --- Start Consent Flow ---");
// StartConsentFlow();
Try(StartConsentFlow, ex => Try(StartConsentFlow, ex =>
{ {
Debug.LogError($"--- ERROR on StartConsentFlow: {ex.Message}"); Debug.LogError($"--- ERROR on StartConsentFlow: {ex.Message}");
}); });
} }
IsServiceReady = true; LogI($"#5.0 --- sync sdk time ---");
LogSDKInitTime((DateTime.Now.ToUniversalTime() - _initTime).TotalSeconds);
// 中台服务初始化结束
Callbacks.SDK.InvokeOnGuruServiceReady();
#if UNITY_ANDROID #if UNITY_ANDROID
LogI($"#5.1 --- Android StartAndroidDebugCmds---");
// Android 命令行调试 // Android 命令行调试
StartAndroidDebugCmds(); StartAndroidDebugCmds();
#endif #endif
LogI($"#5 --- sync sdk time ---");
LogSDKInitTime((DateTime.Now.ToUniversalTime() - _initTime).TotalSeconds); IsServiceReady = true;
// 中台服务初始化结束
Callbacks.SDK.InvokeOnGuruServiceReady();
} }
/// <summary> /// <summary>
@ -425,17 +427,17 @@ namespace Guru
private void OnBLevelChanged(int bLevel) private void OnBLevelChanged(int bLevel)
{ {
Debug.Log($"[ANU][SDK] --- OnBLevelChanged: {bLevel}");
Analytics.SetBLevel(bLevel); Analytics.SetBLevel(bLevel);
} }
private void OnBPlayChanged(int bPlay) private void OnBPlayChanged(int bPlay)
{ {
Debug.Log($"[ANU][SDK] --- OnBPlayChanged: {bPlay}");
Analytics.SetBPlay(bPlay); Analytics.SetBPlay(bPlay);
} }
#endregion #endregion
#region Logging #region Logging