update: 完善初始化流程, 修复报空带来的异常
parent
ffff79d012
commit
064edbd180
|
|
@ -65,13 +65,18 @@ namespace Guru
|
|||
if (_hasConsentCalled) return;
|
||||
_hasConsentCalled = true;
|
||||
|
||||
bool enableCountryCheck = _appServicesConfig.DMACountryCheck();
|
||||
string dmaMapRule = _appServicesConfig.DMAMapRule();
|
||||
bool enableCountryCheck = false;
|
||||
string dmaMapRule = "";
|
||||
if (_appServicesConfig != null && _appServicesConfig.parameters != null)
|
||||
{
|
||||
enableCountryCheck = _appServicesConfig.DMACountryCheck();
|
||||
dmaMapRule = _appServicesConfig.DMAMapRule();
|
||||
}
|
||||
|
||||
#if UNITY_IOS
|
||||
InitAttStatus(); // Consent 启动前记录 ATT 初始值
|
||||
#endif
|
||||
Debug.Log($"{Tag} --- StartConsentFlow ---");
|
||||
Debug.Log($"{Tag} --- Call:StartConsentFlow ---");
|
||||
GuruConsent.StartConsent(OnGuruConsentOver, dmaMapRule:dmaMapRule, enableCountryCheck:enableCountryCheck);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -156,15 +156,17 @@ namespace Guru
|
|||
RemoteConfigManager.Init(BuildDefaultRemoteData(_initConfig.DefaultRemoteData));
|
||||
RemoteConfigManager.OnFetchCompleted += OnFetchRemoteCallback;
|
||||
|
||||
// 延迟执行 SDK 回调
|
||||
Delay(0, () =>
|
||||
{
|
||||
LogI($"--- SDK Init Complete -> Callback: { (_onCompleteCallback == null ? "Null" : "NotNull") } ---");
|
||||
_onCompleteCallback?.Invoke(true);
|
||||
});
|
||||
|
||||
LogI($"--- Apply online services config ---");
|
||||
// 根据上次的云控配置来初始化参数
|
||||
SetupServicesConfig();
|
||||
|
||||
|
||||
LogI($"--- SDK Init Complete -> Callback: { (_onCompleteCallback == null ? "Null" : "NotNull") } ---");
|
||||
_onCompleteCallback?.Invoke(true);
|
||||
|
||||
|
||||
var sp = DateTime.Now.ToUniversalTime() - _initTime;
|
||||
LogSDKInitTime(sp.TotalSeconds);
|
||||
}
|
||||
|
|
@ -261,9 +263,6 @@ namespace Guru
|
|||
_appServicesConfig.app_settings.ios_store);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//---------------------------------
|
||||
}, ex =>
|
||||
{
|
||||
|
|
@ -312,7 +311,6 @@ namespace Guru
|
|||
{
|
||||
Debug.LogError($"--- ERROR on StartAppleReviewFlow: {ex.Message}");
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -322,7 +320,7 @@ namespace Guru
|
|||
// StartConsentFlow();
|
||||
Try(() =>
|
||||
{
|
||||
LogI($"--- StartConsentFlow ---");
|
||||
LogI($"--- #1. StartConsentFlow ---");
|
||||
StartConsentFlow();
|
||||
}, ex =>
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue