feat: 广告位管理第三方广告相关优化—客户端 https://jira.shanqu.cc/browse/GHZS-4959

This commit is contained in:
叶子维
2024-03-25 15:35:40 +08:00
parent dac1f207f2
commit 68931b5d9c
2 changed files with 10 additions and 5 deletions

View File

@ -192,7 +192,8 @@ object AdDelegateHelper {
/**
* 热启动是否需要显示开屏广告
*/
private fun shouldShowStartUpAdWhenHotLaunch() = mSplashAd?.displayRule?.hotStartSplashAd?.type == AD_TYPE_SDK
private fun shouldShowStartUpAdWhenHotLaunch() =
mSplashAd?.displayRule?.hotStartSplashAd?.type == AD_TYPE_SDK && mSplashAd?.hotStartThirdPartyAd != null
/**
* 是否需要显示下载管理广告
@ -386,8 +387,10 @@ object AdDelegateHelper {
}
}
val thirdPartyAd = if (isHotLaunch) mSplashAd?.hotStartThirdPartyAd else mSplashAd?.thirdPartyAd
// 第三方广告的数据为空,按加载失败处理
if (mSplashAd == null || mSplashAd?.thirdPartyAd == null) {
if (mSplashAd == null || thirdPartyAd == null) {
sdkSplashCallback.invoke(false)
return
}
@ -398,14 +401,14 @@ object AdDelegateHelper {
((mSplashAd?.displayRule?.timeout ?: 3.5F) * 1000).toInt()
}
if (mSplashAd?.thirdPartyAd?.sourceName == AD_SDK_BEIZI) {
if (thirdPartyAd.sourceName == AD_SDK_BEIZI) {
sdkStartAdContainer.visibility = View.VISIBLE
requestBeiziSplashAd(sdkStartAdContainer, adsViewGroup, adViewWidthInPx, adViewHeightInPx, timeout.toLong(), sdkSplashCallback)
} else if (mSplashAd?.thirdPartyAd?.sourceName == AD_SDK_CSJ) {
} else if (thirdPartyAd.sourceName == AD_SDK_CSJ) {
sdkStartAdContainer.visibility = View.VISIBLE
requestCsjSplashAd(
activity,
mSplashAd?.thirdPartyAd?.slotId ?: "unknown",
thirdPartyAd.slotId,
adViewWidthInPx,
adViewHeightInPx,
adViewWidthInDp,

View File

@ -13,6 +13,8 @@ class AdConfig(
val displayRule: DisplayRule,
@SerializedName("third_party_ads")
val thirdPartyAd: ThirdPartyAd? = null,
@SerializedName("third_party_ads_1")
val hotStartThirdPartyAd: ThirdPartyAd? = null, // 热启动开屏广告
@SerializedName("owner_ads")
val ownerAd: OwnerAdEntity? = null,
) {