have some iOS apps that implements a banner ad using UIKit. I implement the “GADBannerViewDelegate” protocol to listen for ad loading events and errors.
Occasionally, when opening the app, returning to the Home Screen on iOS, then returning to the app after some time has passed (possibly enough time for the app to be “suspended” by the OS), the ad banner is blank.
After some view hierarchy debugging, I’ve noticed that the banner ad view utilizes a WKWebView to render the ad from a URL. When the ad is blank, it appears that this WKWebView’s “url” property is “nil”. Additionally, the GADBannerViewDelegate’s error method is not called, so I don’t know when this has occurred to recover from it.
I think this is a bug as it seems to have started happening recently, maybe within the last few months. I have been using Google Mobile Ads in my iOS apps for over 10 years. Any help would be appreciated.
Thanks!
I am unable to replicate this issue in the Google Sample Project. In the event that you are using your own Id, could you share it with us for further investigation? As you are able to load the ads and are receiving a test label in the banner view, it suggests that there is no issue with the SDK. Ads are loading without any problems. Since these are test ads, it is possible that this issue could be occurring due to the unavailability of ads.
Mobile Ads SDK Team |
Hello,
As mentioned, the only change I have made to the example project is adding the latest version of the Google Mobile Ads SDK via Swift Package Manager (11.3.0). The ad unit ID and other IDs come directly from the project.
This issue only surfaces on an actual device after some time has passed, enough that the OS puts the app into a “suspended” state. Maybe 30 mins or so, or an hour, depending on usage of the device and other apps (seems somewhat consistent overnight if you open the app just before bed). While it can be challenging to reproduce on demand, as there’s no way to force the “suspended” state, it happens frequently enough with my own apps that I noticed the issue based on normal usage patterns (opening the apps at regular intervals throughout the day).
Thank you,
Kurt
Hi Kurt,
I ran the latest version of the Google Mobile Ads SDK via Swift Package Manager (11.3.0) and able to load ads successfully through simulator. Subsequently, I suspended the app for a duration of 30 mins. Upon reopening the app, I was able to successfully load ads within the simulator.
Kindly share your sample project which replicate the issue.
If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, kindly provide requested information to us via reply to author option or using the steps below:
1. Navigate to
2. Fill out all fields, and attach your file(s).
3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.
|