question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interstitial OnAdClosed event not firing for iOS on Unity when "Optimize Initialization" / "Optimize ad loading" enabled

See original GitHub issue

[REQUIRED] Step 1: Describe your environment

  • Unity version: 2021.3.12f1
  • Google Mobile Ads Unity plugin version: 1.2.172 / 1.2.174
  • Platform: iOS
  • Platform OS version: All iOS Versions
  • Any specific devices issue occurs on: iPhone 6s
  • Mediation ad networks used, and their versions: N/A

[REQUIRED] Step 2: Describe the problem

When enabling “Optimize Initialization” and “Optimize ad loading” from the “Google Mobile Ads Settings” inspector panel, OnAdClosed is not fired after an interstitial ad is closed.

Note that OnAdClosed fires successfully for Android.

Initially I thought it might be an issue with OnAdClosed not being fired on the main (UI) thread, but after closer inspection it appears to not fire at all.

Note that you can get to the “Google Mobile Ads Settings” scene by going to “Assets” / “Google Mobile Ads” / “Settings”, then opening the “Inspector” tab.

Steps to reproduce:

  1. Create a new project.
  2. Select “Optimize Initialization” and “Optimize ad loading” on admob
  3. Create a interstitial that fires, and setup a callback to OnAdClosed
  4. Notice that it does not fire on iOS (does fire on Android)

Relevant Code:

        _interstitialAd = new InterstitialAd("-----AD_ID------");
        _interstitialAd.OnAdClosed += HandleRewardedInterstitialClosed;
        _interstitialAd.LoadAd(createAdRequest());
        _interstitialAd.Show();

        private void HandleRewardedInterstitialClosed(object sender, EventArgs args)
        {
            Logger.log("Called")
        }

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lucianochengcommented, Nov 15, 2022

Double checking my AndroidManifest.xml

Unclear why AndroidManifest.xml is relevant since this is an iOS issue? Issue does not appear on Android.

0reactions
lucianochengcommented, Mar 22, 2023

@NVentimiglia was this ever resolved?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interstitial ads not working on Android devices with Unity ...
Interstitial ads work perfectly on iOS devices, so the code isn't an issue. This is my initialization code: Code (CSharp):. void Awake() ...
Read more >
Interstitial ads | Unity
This guide explains how to integrate interstitial ads into a Unity app. ... Before loading ads, have your app initialize the Mobile Ads...
Read more >
Optimize initialization and ad loading (Beta) | Unity
This guide outlines the changes you need to make to enable these optimizations. Requirements. Complete the Get Started guide. Google Mobile Ads ......
Read more >
Interstitial Integration for Unity Plugin
The ironSource Unity Plugin fires several events to inform you of ad availability. ... function is fired, you will be able to load...
Read more >
Google AdMob ads were working in Unity - now they're not
I am working on an iOS app with Unity 2019.2.21f1. ... string appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found