kwai初始化问题修复
This commit is contained in:
parent
b7f47c29b5
commit
0fea646a5c
|
@ -16,6 +16,7 @@ namespace WZ
|
||||||
if (string.IsNullOrEmpty(json))
|
if (string.IsNullOrEmpty(json))
|
||||||
{
|
{
|
||||||
LoggerUtils.Error("KwaiBiddingConfig JSON string is null or empty");
|
LoggerUtils.Error("KwaiBiddingConfig JSON string is null or empty");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isRv)
|
if (isRv)
|
||||||
|
@ -37,56 +38,32 @@ namespace WZ
|
||||||
|
|
||||||
public static bool GetKwaiRvFloorOpen()
|
public static bool GetKwaiRvFloorOpen()
|
||||||
{
|
{
|
||||||
if (_rvConfig == null)
|
return _rvConfig?.kwai_floor_open == 1;
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return _rvConfig.kwai_floor_open == 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int GetRvParallelRequests()
|
public static int GetRvParallelRequests()
|
||||||
{
|
{
|
||||||
if (_rvConfig == null)
|
return _rvConfig?.parallel_requests ?? 0;
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return _rvConfig.parallel_requests;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<FloorConfig> GetRvFloorConfigs()
|
public static List<FloorConfig> GetRvFloorConfigs()
|
||||||
{
|
{
|
||||||
if (_rvConfig == null)
|
return _rvConfig?.floors ?? null;
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return _rvConfig.floors;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool GetKwaiIvFloorOpen()
|
public static bool GetKwaiIvFloorOpen()
|
||||||
{
|
{
|
||||||
if (_ivConfig == null)
|
return _ivConfig?.kwai_floor_open == 1;
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return _ivConfig.kwai_floor_open == 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int GetIvParallelRequests()
|
public static int GetIvParallelRequests()
|
||||||
{
|
{
|
||||||
if (_ivConfig == null)
|
return _ivConfig?.parallel_requests ?? 0;
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return _ivConfig.parallel_requests;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<FloorConfig> GetIvFloorConfigs()
|
public static List<FloorConfig> GetIvFloorConfigs()
|
||||||
{
|
{
|
||||||
if (_ivConfig == null)
|
return _ivConfig?.floors ?? null;
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return _ivConfig.floors;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetKwaiAppId()
|
public static string GetKwaiAppId()
|
||||||
|
|
|
@ -38,7 +38,6 @@ namespace WZ
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (KwaiAdsConfigParser.GetKwaiRvFloorOpen())
|
if (KwaiAdsConfigParser.GetKwaiRvFloorOpen())
|
||||||
{
|
{
|
||||||
KwaiFloorRvManager.Instance.InitializeWithFloors();
|
KwaiFloorRvManager.Instance.InitializeWithFloors();
|
||||||
|
@ -60,7 +59,7 @@ namespace WZ
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
LoggerUtils.Debug("KwaiAdsManager RefreshAdsData" + _appId + " token:" + _token + " rewardAdUnitId:" + _rewardAdUnitId + " interstitialAdUnitId:" + _interstitialAdUnitId+ " init:" + _initialized);
|
||||||
if (string.IsNullOrEmpty(_appId) || string.IsNullOrEmpty(_token) || _initialized) return;
|
if (string.IsNullOrEmpty(_appId) || string.IsNullOrEmpty(_token) || _initialized) return;
|
||||||
var kwaiAdConfig = new KwaiAds.Scripts.Api.KwaiAdConfig.Builder()
|
var kwaiAdConfig = new KwaiAds.Scripts.Api.KwaiAdConfig.Builder()
|
||||||
.SetAppId(_appId)
|
.SetAppId(_appId)
|
||||||
|
@ -78,10 +77,12 @@ namespace WZ
|
||||||
{
|
{
|
||||||
_appId = AdConfigParser.GetKwaiAppId();
|
_appId = AdConfigParser.GetKwaiAppId();
|
||||||
_token = AdConfigParser.GetKwaiAppToken();
|
_token = AdConfigParser.GetKwaiAppToken();
|
||||||
|
|
||||||
_rewardAdUnitId = AdConfigParser.GetKwaiAdUnits(AdsType.Rewarded).FirstOrDefault();
|
_rewardAdUnitId = AdConfigParser.GetKwaiAdUnits(AdsType.Rewarded).FirstOrDefault();
|
||||||
_interstitialAdUnitId = AdConfigParser.GetKwaiAdUnits(AdsType.Interstitial).FirstOrDefault();
|
_interstitialAdUnitId = AdConfigParser.GetKwaiAdUnits(AdsType.Interstitial).FirstOrDefault();
|
||||||
KwaiFloorRvManager.Instance.LoadKwaiBiddingConfig();
|
if (KwaiAdsConfigParser.GetKwaiRvFloorOpen()) KwaiFloorRvManager.Instance.LoadKwaiBiddingConfig();
|
||||||
KwaiFloorIvManager.Instance.LoadKwaiBiddingConfig();
|
if (KwaiAdsConfigParser.GetKwaiIvFloorOpen()) KwaiFloorIvManager.Instance.LoadKwaiBiddingConfig();
|
||||||
|
LoggerUtils.Debug("KwaiAdsManager RefreshAdsData" + _appId + " token:" + _token + " rewardAdUnitId:" + _rewardAdUnitId + " interstitialAdUnitId:" + _interstitialAdUnitId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue