googleads / googleads-mobile-ios-examples

googleads-mobile-ios
Apache License 2.0
962 stars 808 forks source link

requestReview admob problem #403

Closed fatihdurmaz closed 8 months ago

fatihdurmaz commented 8 months ago

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.

malandr2 commented 8 months ago

Hey @fatihdurmaz, please see https://github.com/googleads/swift-package-manager-google-mobile-ads/issues/60 as a next step.