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