Giter Club home page Giter Club logo

Comments (5)

NVentimiglia avatar NVentimiglia commented on July 17, 2024

@abear247 did you need to modify out samples to get it to work right? If so, let me know which ones and I can get the change done.

from googleads-mobile-ios-examples.

abear247 avatar abear247 commented on July 17, 2024

@NVentimiglia This appears to be a direct problem with google ads itself. We estimate that we are not seeing ads ~50% of the time because of this bug. It's pretty easy to recreate using the openURL but it's not the only way to trigger it.

If I just add this view


struct BrokenView: View {
    @State private var showAnotherView = false
    // comment this next line out and the ad will load, keep it in and it will not.  This behaviour of being unable to find the presented view controller happens with other environment vars, and even in instances without it.
    @Environment(\.openURL) var openURL
    
    var body: some View {
        NavigationView {
            Button {
                showAnotherView = true
            } label: {
                Text("tap on this")
            }
        }.sheet(isPresented: $showAnotherView, content: {
            InterstitialContentView(navigationTitle:  "broken")
        })
    }
}

and use it in the extension

extension MenuItem {
  @ViewBuilder
  private func viewForType() -> some View {
    switch self {
    case .banner:
      BannerContentView(navigationTitle: self.rawValue)
    case .interstitial:
        BrokenView()
    case .native:
      NativeContentView(navigationTitle: self.rawValue)
    case .rewarded:
      RewardedContentView(navigationTitle: self.rawValue)
    case .rewardedInterstitial:
      RewardedInterstitialContentView(navigationTitle: self.rawValue)
    }
  }
}

The ad will never show on the simulator, on devices its a 50/50 chance.

from googleads-mobile-ios-examples.

NVentimiglia avatar NVentimiglia commented on July 17, 2024

@abear247

I am still confused at to what the issue is. None of our samples include the line @Environment(\.openURL) var openURL as far as I can see.

from googleads-mobile-ios-examples.

abear247 avatar abear247 commented on July 17, 2024

Yeah they don't, they only cover the most basic scenarios. The google ads framework starts to break once used beyond these simple contexts.

from googleads-mobile-ios-examples.

malandr2 avatar malandr2 commented on July 17, 2024

Hi @abear247, thanks for flagging. This issue appears to not be directly related to our samples but a general issue. For our iOS engineers to take a closer look at this can you create a thread in the AdMob Developers Forum for it to be triaged appropriately. You can link this GitHub issue when you create the thread.

Closing this issue out. Thanks!

from googleads-mobile-ios-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.