Skip to content

Reward Fullscreen View not showing when on iOS 15 and above. #4

@CharlyPico

Description

@CharlyPico

Hi there,

Just added the functionality to my App, the only thing is that it appears like the Reward Ad won't show up when using:

func makeUIViewController(context: Context) -> UIViewController
{

    let view = UIViewController()
    
    DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(1)) {
        self.showAd(from: view)
    }
    
    return view
}

Change this code to:

func makeUIViewController(context: Context) -> UIViewController
{

    let view = UIViewController()
    
    DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(1)) {
        self.showAd(from: (UIApplication.shared.windows.first?.rootViewController)!)
    }
    
    return view
}

Thanks for taking the time on doing this project about Google Ads on SwiftUI!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions