import SwiftUI
import AppTrackingTransparency
import StoreKit
struct RootView: View {
AppStorage("showingOnboarding") private var showingOnboarding = true
State var adsManager = AdsManager()
State private var selectionItem = 0
@Environment(.requestReview) private var requestReview
var body: some View {
TabView(selection: $selectionItem){
MainView(selectionTabItem: $selectionItem)
.tabItem {
Label("Başlangıç", systemImage: "house")
.environment(.symbolVariants, selectionItem == 0 ? .fill : .none)
}
.tag(0)
ResultView(selectionTabItem: $selectionItem)
.tabItem {
Label("Hesaplamalar", systemImage: "arrow.counterclockwise.circle")
.environment(\.symbolVariants, selectionItem == 1 ? .fill : .none)
}
.tag(1)
}
.fullScreenCover(isPresented: $showingOnboarding, content: {
OnboardingView.init()
.edgesIgnoringSafeArea(.all)
.onDisappear{
showingOnboarding = false
ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in })
}
})
.onAppear{
adsManager.increaseBannerAdCounter()
}
.tint(.main)
}
}
@Environment(.requestReview) private var requestReview when showing admob banner ad with SwiftUI If I define the ad is not loading and Invalid Request. Cannot determine request type. Is your ad unit id correct? I get an error. It gets fixed when I remove it.