googleads / googleads-mobile-unity

Official Unity Plugin for the Google Mobile Ads SDK
https://developers.google.com/admob/unity
Apache License 2.0
1.37k stars 1.08k forks source link

OnAdClosed is being delayed after a Video Interstitial is closed #2029

Closed Mecze closed 1 year ago

Mecze commented 2 years ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

In order to reproduce it:

  1. Download sample project from this GitHub
  2. Open it using with (I guess) any Unity version
  3. Import 6.1.2 Admob
  4. Switch to android
  5. Enter a valid AppID and a AdUnitID for the interstitial with video ads enabled.
  6. Force Resolve
  7. Build and install on a device
  8. Logcat the device
  9. Request, wait, and show the ad.
  10. 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: image (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.

Mecze commented 2 years ago

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.

DineshNeupane commented 2 years ago

same issue

Mecze commented 2 years ago

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.

mhctseu commented 1 year ago

Same issue here. We are using: Unity 2020.3.38 Google Ads Mobile Unity 7.2.0.

kunny commented 1 year ago

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.

aceloq commented 1 year ago

@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.

brockw commented 7 months ago

I'm seeing this too