获取到在线参数后刷新广告数据
This commit is contained in:
parent
b3580fa380
commit
6e3974c78f
|
@ -17,7 +17,6 @@ namespace WZ
|
|||
string ClientName { get; }
|
||||
|
||||
PlatformType Platfrom { get; }
|
||||
|
||||
void RefreshAdsData();
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -27,14 +27,13 @@ namespace WZ
|
|||
private Action<bool,double> _rvCloseCallback = null;
|
||||
private Action<double> _ivCloseCallback = null;
|
||||
private Action _rvShowFailedCallback = null;
|
||||
private bool _initialized = false;
|
||||
private float _rvStartLoadTime = 0;
|
||||
private float _ivStartLoadTime = 0;
|
||||
private float _nvStartLoadTime = 0;
|
||||
private float _bvStartLoadTime = 0;
|
||||
private float _spStartLoadTime = 0;
|
||||
|
||||
public bool _splashLoaded = false;
|
||||
public bool _initialized { get; private set; } = false;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
|
|
|
@ -43,7 +43,6 @@ namespace WZ
|
|||
foreach (var network in _adNetworks)
|
||||
{
|
||||
LoggerUtils.Debug("init ads sdk network:"+network.ToString());
|
||||
network.RefreshAdsData();
|
||||
network.Initialize();
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +51,9 @@ namespace WZ
|
|||
{
|
||||
foreach (var network in _adNetworks)
|
||||
{
|
||||
LoggerUtils.Debug("init ads sdk network:"+network.ToString());
|
||||
network.RefreshAdsData();
|
||||
network.Initialize();
|
||||
}
|
||||
}
|
||||
#region 激励视频广告
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace WZ
|
|||
private List<string> _interstitialAdUnits = new List<string>();
|
||||
private List<string> _rewardedAdUnits = new List<string>();
|
||||
public string _bigo_app_id;
|
||||
private bool _initialized;
|
||||
public bool _initialized { get; private set; } = false;
|
||||
private string _rvPos;
|
||||
private string _IvPos;
|
||||
private Action<bool,double> _rvCloseCallback = null;
|
||||
|
@ -28,8 +28,8 @@ namespace WZ
|
|||
|
||||
public void Initialize()
|
||||
{
|
||||
|
||||
if (string.IsNullOrEmpty(_bigo_app_id)) return;
|
||||
LoggerUtils.Debug("[Bigo] sdk init start"+_bigo_app_id+" rvid:"+_rewardedAdUnits+" ivid:"+_interstitialAdUnits);
|
||||
if (string.IsNullOrEmpty(_bigo_app_id)|| _initialized) return;
|
||||
BigoAdSdk.OnInitFinish += () =>
|
||||
{
|
||||
LoggerUtils.Debug($"[Bigo] sdk init success");
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace WZ
|
|||
{
|
||||
_retryCounters[adUnitId] = 0;
|
||||
_adRevenueCache[adUnitId] = GetAdRevenue(rewardedAd);
|
||||
LoggerUtils.Debug($"[Bigo] Rewarded-[Load]: {adUnitId} successfully");
|
||||
LoggerUtils.Debug($"[Bigo] Rewarded-[Load]: {adUnitId} successfully revenue:"+GetAdRevenue(rewardedAd));
|
||||
AdsKeyEvents.Instance.LogAdFPUEvents(AdsType.Rewarded);
|
||||
onAdLoaded?.Invoke(adUnitId);
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace WZ
|
|||
LoggerUtils.Debug($"[kwai] InterstitialAdLoadListener#OnAdLoadSuccess , trackId:{trackId}, price:{price}");
|
||||
AdsKeyEvents.Instance.LogAdFPUEvents(AdsType.Interstitial);
|
||||
KwaiAdsManager.Instance._interRetryAttempt = 0;
|
||||
KwaiAdsManager.Instance._interstitiaAdRevenue = DataUtils.StringToDouble(price);
|
||||
KwaiAdsManager.Instance._interstitiaAdRevenue = DataUtils.StringToDouble(price)/1000;
|
||||
AdsActionEvents.TrackAdLoaded(KwaiAdsManager.Instance.Platfrom,
|
||||
KwaiAdsManager.Instance.ClientName,
|
||||
trackId,
|
||||
|
|
|
@ -29,12 +29,14 @@ namespace WZ
|
|||
public float _rvStartLoadTime = 0;
|
||||
public float _ivStartLoadTime = 0;
|
||||
public string ClientName => "Kwai";
|
||||
|
||||
public PlatformType Platfrom => PlatformType.Kwai;
|
||||
|
||||
public bool _initialized { get; private set; } = false;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_appId) || string.IsNullOrEmpty(_token)) return;
|
||||
LoggerUtils.Debug("KwaiAdsManager Initialize start" + _appId + " token:" + _token + " rewardAdUnitId:" + _rewardAdUnitId + " interstitialAdUnitId:" + _interstitialAdUnitId);
|
||||
if (string.IsNullOrEmpty(_appId) || string.IsNullOrEmpty(_token)|| _initialized) return;
|
||||
var kwaiAdConfig = new KwaiAds.Scripts.Api.KwaiAdConfig.Builder()
|
||||
.SetAppId(_appId)
|
||||
.SetToken(_token)
|
||||
|
@ -42,6 +44,7 @@ namespace WZ
|
|||
.Build();
|
||||
|
||||
KwaiAds.Scripts.Api.KwaiAdsSdk.Initialize(kwaiAdConfig, new InitResultCallbackImpl());
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
public void RefreshAdsData()
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace WZ
|
|||
LoggerUtils.Debug($"[kwai] RewardAdLoadListener#OnAdLoadSuccess , trackId:{trackId}, price:{price}");
|
||||
AdsKeyEvents.Instance.LogAdFPUEvents(AdsType.Rewarded);
|
||||
KwaiAdsManager.Instance._rewardRetryAttempt = 0;
|
||||
KwaiAdsManager.Instance._rewardAdRevenue = DataUtils.StringToDouble(price);
|
||||
KwaiAdsManager.Instance._rewardAdRevenue = DataUtils.StringToDouble(price)/1000;
|
||||
AdsActionEvents.TrackAdLoaded(KwaiAdsManager.Instance.Platfrom,
|
||||
KwaiAdsManager.Instance.ClientName,
|
||||
trackId,
|
||||
|
|
|
@ -26,11 +26,11 @@ namespace WZ
|
|||
private Action<bool,double> _rvCloseCallback = null;
|
||||
private Action<double> _ivCloseCallback = null;
|
||||
private Action _rvShowFailedCallback = null;
|
||||
|
||||
public bool _initialized { get; private set; } = false;
|
||||
public void Initialize()
|
||||
{
|
||||
|
||||
if (string.IsNullOrEmpty(_max_app_key)) return;
|
||||
if (string.IsNullOrEmpty(_max_app_key) || _initialized) return;
|
||||
LoggerUtils.Debug("[Max] init max");
|
||||
// 关闭反转debug面板
|
||||
MaxSdk.SetCreativeDebuggerEnabled(false);
|
||||
|
@ -48,6 +48,7 @@ namespace WZ
|
|||
MaxSdk.InitializeSdk();
|
||||
LoadRewarded();
|
||||
LoadInterstitial();
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
public void RefreshAdsData()
|
||||
|
|
|
@ -22,17 +22,19 @@ namespace WZ
|
|||
private Action<bool,double> _rvCloseCallback = null;
|
||||
private Action<double> _ivCloseCallback = null;
|
||||
private Action _rvShowFailedCallback = null;
|
||||
|
||||
public bool _initialized { get; private set; } = false;
|
||||
public void Initialize()
|
||||
{
|
||||
|
||||
LoggerUtils.Debug("[Tpn] 初始化 Tpn 广告 SDK appid:" + _topon_app_id + " appkey:" + _topon_app_key + " ivId:" + _topon_interstitial_units + " rvId:" + _topon_rewarded_units);
|
||||
if(_initialized )return;
|
||||
if (!string.IsNullOrEmpty(_topon_app_id) && !string.IsNullOrEmpty(_topon_app_key))
|
||||
{
|
||||
ATSDKAPI.initSDK(_topon_app_id, _topon_app_key);
|
||||
ATSDKAPI.setLogDebug(false);
|
||||
InitRewarded();
|
||||
InitInterstitial();
|
||||
_initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace WZ
|
|||
AdjustTrackEvent.Instance.UpdateEventToken();
|
||||
AdsKeyEvents.Instance.InitData();
|
||||
// 获取广告位信息
|
||||
AdConfigParser.Parse(GetRemoteConfigString("ad_config"));
|
||||
AdConfigParser.Parse(GetRemoteConfigString("ad_bid_set"));
|
||||
// 刷新广告位信息
|
||||
AdsSDKManager.Instance.RefreshAdsData();
|
||||
//AB测试分组参数
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 85071a22d9da24115bb224b21e4eab67
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
<dependencies>
|
||||
<androidPackages>
|
||||
<repositories>
|
||||
<repository>https://jfrog.anythinktech.com/artifactory/debugger</repository>
|
||||
</repositories>
|
||||
<androidPackage spec="com.thinkup.sdk:debugger-ui:1.1.1"/>
|
||||
</androidPackages>
|
||||
</dependencies>
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3656986a4732b4fc8a4b297462f61cf0
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue