通过在线参数控制是由topon初始化kwai还是自初始化
This commit is contained in:
parent
aeec8953f6
commit
f57d9f8b7a
|
@ -27,9 +27,9 @@ namespace WZ
|
|||
|
||||
private void InitializeAdNetworks()
|
||||
{
|
||||
_adNetworks.Add(TpnAdsManager.Instance);
|
||||
_adNetworks.Add(AdmobAdsManager.Instance);
|
||||
_adNetworks.Add(BigoAdsManager.Instance);
|
||||
_adNetworks.Add(TpnAdsManager.Instance);
|
||||
_adNetworks.Add(MaxAdsManager.Instance);
|
||||
_adNetworks.Add(KwaiAdsManager.Instance);
|
||||
foreach (var network in _adNetworks)
|
||||
|
|
|
@ -38,8 +38,6 @@ namespace WZ
|
|||
|
||||
public void Initialize()
|
||||
{
|
||||
LoggerUtils.Debug("KwaiAdsManager Initialize start" + _appId + " token:" + _token + " rewardAdUnitId:" + _rewardAdUnitId + " interstitialAdUnitId:" + _interstitialAdUnitId);
|
||||
if (string.IsNullOrEmpty(_appId) || string.IsNullOrEmpty(_token) || _initialized) return;
|
||||
|
||||
if (KwaiAdsConfigParser.GetKwaiRvFloorOpen())
|
||||
{
|
||||
|
@ -51,6 +49,19 @@ namespace WZ
|
|||
KwaiFloorIvManager.Instance.InitializeWithFloors();
|
||||
}
|
||||
|
||||
var useToponKwai = RushSDKManager.Instance.GetRemoteConfigStr("use_topon_kwai","1").Equals("1");
|
||||
LoggerUtils.Debug("KwaiAdsManager Initialize start" + _appId + " token:" + _token + " rewardAdUnitId:" + _rewardAdUnitId + " interstitialAdUnitId:" + _interstitialAdUnitId+ " useToponKwai:" + useToponKwai);
|
||||
|
||||
if (useToponKwai)
|
||||
{
|
||||
_initialized = true;
|
||||
LoadInterstitial();
|
||||
LoadRewarded();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (string.IsNullOrEmpty(_appId) || string.IsNullOrEmpty(_token) || _initialized) return;
|
||||
var kwaiAdConfig = new KwaiAds.Scripts.Api.KwaiAdConfig.Builder()
|
||||
.SetAppId(_appId)
|
||||
.SetToken(_token)
|
||||
|
@ -58,9 +69,9 @@ namespace WZ
|
|||
.Build();
|
||||
|
||||
KwaiAds.Scripts.Api.KwaiAdsSdk.Initialize(kwaiAdConfig, new InitResultCallbackImpl());
|
||||
|
||||
_initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void RefreshAdsData()
|
||||
|
@ -77,19 +88,20 @@ namespace WZ
|
|||
#region 激励广告
|
||||
public void LoadRewarded()
|
||||
{
|
||||
AdsActionEvents.TrackAdStartLoad(Platfrom, AdsType.Rewarded);
|
||||
if (!KwaiAdsConfigParser.GetKwaiRvFloorOpen())
|
||||
{
|
||||
LoadRewardedStandard();
|
||||
return;
|
||||
}
|
||||
|
||||
AdsActionEvents.TrackAdStartLoad(Platfrom, AdsType.Rewarded);
|
||||
KwaiFloorRvManager.Instance.LoadRewardedWithFloors();
|
||||
}
|
||||
|
||||
public void LoadRewardedStandard()
|
||||
{
|
||||
LoggerUtils.Debug("kwai load rewarded standard"+_rewardAdUnitId);
|
||||
if (string.IsNullOrEmpty(_rewardAdUnitId)) return;
|
||||
AdsActionEvents.TrackAdStartLoad(Platfrom, AdsType.Rewarded);
|
||||
if (_rewardAdController != null)
|
||||
{
|
||||
_rewardAdController.Destroy();
|
||||
|
@ -151,18 +163,21 @@ namespace WZ
|
|||
#region 插屏
|
||||
public void LoadInterstitial()
|
||||
{
|
||||
AdsActionEvents.TrackAdStartLoad(Platfrom, AdsType.Interstitial);
|
||||
|
||||
if (!KwaiAdsConfigParser.GetKwaiIvFloorOpen())
|
||||
{
|
||||
LoadInterstitialStandard();
|
||||
return;
|
||||
}
|
||||
AdsActionEvents.TrackAdStartLoad(Platfrom, AdsType.Interstitial);
|
||||
KwaiFloorIvManager.Instance.LoadInterstitialWithFloors();
|
||||
}
|
||||
|
||||
private void LoadInterstitialStandard()
|
||||
{
|
||||
LoggerUtils.Debug("kwai load interstitial standard:"+_interstitialAdUnitId);
|
||||
if (string.IsNullOrEmpty(_interstitialAdUnitId)) return;
|
||||
AdsActionEvents.TrackAdStartLoad(Platfrom, AdsType.Interstitial);
|
||||
if (_interstitialAdController != null)
|
||||
{
|
||||
_interstitialAdController.Destroy();
|
||||
|
|
|
@ -21,7 +21,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
|
||||
public static string GetSDKVersion()
|
||||
{
|
||||
return "1.0.4.4";
|
||||
return "1.0.4.5";
|
||||
}
|
||||
protected override void Initialized()
|
||||
{
|
||||
|
|
|
@ -17,16 +17,20 @@ public class Test : MonoBehaviour
|
|||
private void Start()
|
||||
{
|
||||
|
||||
|
||||
RushSDKManager.Instance.InitializeSdk(()=> { },true);
|
||||
}
|
||||
|
||||
public void OnShowAd()
|
||||
{
|
||||
|
||||
RushSDKManager.Instance.ShowRewardAd("test",(s,st)=>
|
||||
{
|
||||
LoggerUtils.Debug("onreward show callback revenue:"+st);
|
||||
});
|
||||
}
|
||||
|
||||
public void OnShowInterstitial()
|
||||
{
|
||||
|
||||
RushSDKManager.Instance.ShowBanner(BannerType.Collapsible,BannerAlignType.CenterBottom);
|
||||
// KwaiAdsManager.Instance.OnInterstitialCallback();
|
||||
// var small = gameObject.transform.Find("NativeAd-small").GetComponent<RectTransform>();
|
||||
|
@ -73,7 +77,7 @@ public class Test : MonoBehaviour
|
|||
public void ToponDebug()
|
||||
{
|
||||
// ATSDKAPI.showDebuggerUI();
|
||||
RushSDKManager.Instance.HideBanner(BannerType.Standard);
|
||||
|
||||
}
|
||||
|
||||
public void MaxDebug()
|
||||
|
@ -84,28 +88,31 @@ public class Test : MonoBehaviour
|
|||
|
||||
public void Native1Show()
|
||||
{
|
||||
var adUnitId = StaticValue.AdmobSmallNativeId;
|
||||
var nativeAdPosition = NativeAdPosition.Create(new NativeTemplateStyle
|
||||
{
|
||||
TemplateId = NativeTemplateId.Small
|
||||
}, small);
|
||||
Debug.Log($"luojian admob native ad ({adUnitId}) start show {small} medium {medium} X:{nativeAdPosition.X} Y:{nativeAdPosition.Y} Height :{nativeAdPosition.Height} Width:{nativeAdPosition.Width} Screen.dpi = {3.5}");
|
||||
if (AdsSDKManager.Instance.IsNativeAdReady(adUnitId))
|
||||
{
|
||||
AdsSDKManager.Instance.ShowNativeAd("test", adUnitId, nativeAdPosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"luojian admob native ad ({adUnitId}) start show fail,not ready.");
|
||||
}
|
||||
RushSDKManager.Instance.HideBanner(BannerType.Collapsible);
|
||||
// var adUnitId = StaticValue.AdmobSmallNativeId;
|
||||
// var nativeAdPosition = NativeAdPosition.Create(new NativeTemplateStyle
|
||||
// {
|
||||
// TemplateId = NativeTemplateId.Small
|
||||
// }, small);
|
||||
// Debug.Log($"luojian admob native ad ({adUnitId}) start show {small} medium {medium} X:{nativeAdPosition.X} Y:{nativeAdPosition.Y} Height :{nativeAdPosition.Height} Width:{nativeAdPosition.Width} Screen.dpi = {3.5}");
|
||||
// if (AdsSDKManager.Instance.IsNativeAdReady(adUnitId))
|
||||
// {
|
||||
// AdsSDKManager.Instance.ShowNativeAd("test", adUnitId, nativeAdPosition);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Debug.LogWarning($"luojian admob native ad ({adUnitId}) start show fail,not ready.");
|
||||
// }
|
||||
}
|
||||
|
||||
public void Native1Hide()
|
||||
{
|
||||
var adUnitId = StaticValue.AdmobSmallNativeId;
|
||||
AdsSDKManager.Instance.RemoveNativeAd(adUnitId);
|
||||
RushSDKManager.Instance.HideBanner(BannerType.Standard);
|
||||
// var adUnitId = StaticValue.AdmobSmallNativeId;
|
||||
// AdsSDKManager.Instance.RemoveNativeAd(adUnitId);
|
||||
}
|
||||
|
||||
|
||||
public void Native2Show()
|
||||
{
|
||||
var adUnitId = StaticValue.AdmobNativeId;
|
||||
|
|
|
@ -1,3 +1,17 @@
|
|||
# Version 1.0.4.5 2025.9.29
|
||||
|
||||
## Bugs
|
||||
|
||||
- None
|
||||
|
||||
## Known issues
|
||||
|
||||
- None
|
||||
|
||||
## Changelog
|
||||
|
||||
- 通过在线参数控制是否初始化kwai广告,可由topon初始化
|
||||
|
||||
# Version 1.0.4.4 2025.9.28
|
||||
|
||||
## Bugs
|
||||
|
|
Loading…
Reference in New Issue