OnAdClosed is being delayed after a Video Interstitial is closed
[REQUIRED] Step 1: Describe your environment
- Unity version: 2020.3.15f2
- Google Mobile Ads Unity plugin version: 6.1.2
- Platform: Android
- Platform OS version: any
- Any specific devices issue occurs on: it happened in several of our test devices, like Xiaomi Redmi Note 8 Pro(Redmi)
- Mediation ad networks used, and their versions: we do have mediations on our project, but I have reproduce it with no mediations.
[REQUIRED] Step 2: Describe the problem
Steps to reproduce:
- Upon closing an Interstitial, there's an awkward delay (0.5≈2 seconds) since the control is back to Unity and the event OnAdClosed is fired.
- It happens with Video Interstitials. I cannot reproduce it with Static Interstitials.
- I'm talking by feeling here, since i have not put a time counter on it, but it looks that the delay is longer the longer the video inside the ad is.
- The greater offender here is an ad that displays a full video from youtube (3+ minutes) of a song (I attach an image below) that provokes delays of 1+ seconds.
- By chance, I got the same video as a Rewarded Video on the Rewarded AdUnitID, and this "delay" did not occur on the Rewarded Video, the OnAdClosed and OnUserEarnedReward were fired Instantly. So it only happens on Video Interstitials.
- This is really bad for us, because this incurrs on bad behaviour enforced by google. And google punish us for using google.
In order to reproduce it:
- Download sample project from this GitHub
- Open it using with (I guess) any Unity version
- Import 6.1.2 Admob
- Switch to android
- Enter a valid AppID and a AdUnitID for the interstitial with video ads enabled.
- Force Resolve
- Build and install on a device
- Logcat the device
- Request, wait, and show the ad.
- Upon closing the interstitial you will notice a delay between the ad being closed and OnAdClosed being fired in Logcat. It only happens if a video ad was served. Static ads works mostly fine.
Note: I have a attached a project below for simplicity where it DOES happens.
##What happened? How can we make the problem occur? ##This could be a description, log/console output, etc.
The only log I could find relevant is this one:
W Activity: Slow Operation: Activity com.HelloDarkness.MyOldFriend/com.google.android.gms.ads.AdActivity onDestroy took 298ms
That says mostly nothing.
Here's a screenshot of the video ad I mentioned above:
(Clicking "More Info" on that screenshot takes me to the youtube video of that musician)
##Please share a downloadable sample project that reproduces the bug, if ##available. This greatly helps us to diagnose and fix the issue faster.
Here! (Unity version: 2020.3.15f2) https://drive.google.com/file/d/1CsrWyt_LfTKshfAfntcAtVYQpGWEarPw/view?usp=sharing
Relevant Code:
No relevant code here. This is reproduceable with no code, just using the sample from this github.
As a Workaround we are using Unity's "OnApplicationPause" to know when we get back from an Interstitial.
In our case we have wrappers for every Admob Ad Format (one for Banner, one for Interstitials... etc), and its the Interstitial wrapper who handle this and launches our "OnAdClosed" equivalent event when OnApplicationPause triggers (under certain conditions). As our games depends on these wrappers events and not Admob events directly it works like a charm.
Hope this helps.
same issue
Bump... Any new on this front?
We are still using our workaround: Launch our own "adclosed" event when "OnApplicationPause" and ignore admob's adclosed event.
Same issue here. We are using: Unity 2020.3.38 Google Ads Mobile Unity 7.2.0.
Since there were no recent activities for this issue, we are therefore reluctantly going to close this bug for now.
If you are still experiencing the problem, please file a new issue with the same description, what happens and system / network tracing / Charles logs.
All system setups can be slightly different, so it's always better to open new issues and reference the related ones. Thanks for your contribution.
@kunny
I have that same issue on Google Ads Mobile Unity 7.4.1 and Unity Editor 2020.3.46f1.
Occurs only in interstitials. It works fine in test ads and using admob test ad units. Occurs only real ads. I'm using Admob mediation and other ad services are fine. It only happens with Admob video interstitial Ads. This issue doesn't happen on all devices. Some devices have issue. For example, the Xiaomi Redmi Note 6 Pro device has a delay of about 2 seconds. I've seen a delay of up to 5 seconds on some low hardware devices.
This is an annoying issue.I hope it will be solved soon.
I'm seeing this too