탐색 - 배너 광고 추가

This commit is contained in:
Yu Sung 2023-09-16 01:11:50 +09:00
parent 6e9aaa0c8a
commit 4c9e78f960
3 changed files with 14 additions and 1 deletions

View File

@ -23,3 +23,4 @@ let LIVE_NOW_ALL_LIST_BANNER_AD_UNIT_ID = "ca-app-pub-3940256099942544/293473571
let CREATOR_CHANNEL_BANNER_AD_UNIT_ID = "ca-app-pub-3940256099942544/2934735716"
let MESSAGE_BANNER_AD_UNIT_ID = "ca-app-pub-3940256099942544/2934735716"
let LIVE_ROOM_BANNER_AD_UNIT_ID = "ca-app-pub-3940256099942544/2934735716"
let EXPLORER_BANNER_AD_UNIT_ID = "ca-app-pub-3940256099942544/2934735716"

View File

@ -7,6 +7,7 @@
import SwiftUI
import Kingfisher
import GoogleMobileAds
struct ExplorerView: View {
@ -83,7 +84,8 @@ struct ExplorerView: View {
} else {
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 26.7) {
ForEach(viewModel.explorerSections, id: \.self) { section in
ForEach(0..<viewModel.explorerSections.count, id: \.self) { index in
let section = viewModel.explorerSections[index]
VStack(alignment: .leading, spacing: 13.3) {
if let coloredTitle = section.coloredTitle, let color = section.color {
let titleArray = section.title.components(separatedBy: coloredTitle)
@ -144,6 +146,15 @@ struct ExplorerView: View {
}
}
.frame(width: screenSize().width - 26.7, alignment: .leading)
if index == 1 {
BannerAdView(adUnitId: EXPLORER_BANNER_AD_UNIT_ID)
.frame(
width: screenSize().width,
height: GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(screenSize().width).size.height
)
.padding(.top, 26.7)
}
}
}
}

View File

@ -23,3 +23,4 @@ let LIVE_NOW_ALL_LIST_BANNER_AD_UNIT_ID = "ca-app-pub-1299501215847962/244612302
let CREATOR_CHANNEL_BANNER_AD_UNIT_ID = "ca-app-pub-1299501215847962/3614614905"
let MESSAGE_BANNER_AD_UNIT_ID = "ca-app-pub-1299501215847962/6432349937"
let LIVE_ROOM_BANNER_AD_UNIT_ID = "ca-app-pub-1299501215847962/1111778485"
let EXPLORER_BANNER_AD_UNIT_ID = "ca-app-pub-1299501215847962/9823185638"