AppOpen ad moves Unity app to Background

99 views
Skip to first unread message

Yarden Raveh

unread,
Sep 8, 2024, 6:25:42 AMSep 8
to Google Mobile Ads SDK Developers
Hi,
I am trying to implement AppOpen ads in the loading screen of my Unity app (Cold Start), the ad is displayed just fine however by showing the ad the state of the app is updated to Background. We expected the app to stay in the Foreground. We are attempting  to show the AppOpen ad in the loading screen to allow the app to continue loading while the ad is displayed.

Unity Version : 2022.3.29f1.
GoogleMobileAds for Unity: 9.2.0

Tried the following:
  • make sure Application.runInBackhround is set to true
  • update unity to latest 2022 LTS
  • update dependency manager and packages to latest version
  • run admob in an empty Unity proejct

The issue persisted in all of the attempts above.

Mobile Ads SDK Forum Advisor

unread,
Sep 9, 2024, 8:10:52 AMSep 9
to yar...@muuula.com, google-adm...@googlegroups.com

Hi Yarden,

Thank you for contacting the Mobile Ads SDK support team. 

Let's deep dive a little more since your tryouts didn’t work to find out the root cause of the issue when and why the app is getting into the background state. Use the AppStateEventNotifier to listen to application foreground and background events. This class will raise the AppStateChanged event whenever the application foregrounds or backgrounds.

private void Awake()
{
    // Use the AppStateEventNotifier to listen to application open/close events.
    // This is used to launch the loaded ad when we open the app.
    AppStateEventNotifier.AppStateChanged += OnAppStateChanged;
}

Can you confirm whether the mentioned issue is occurring with the Google HelloWorld example project which is a minimal implementation of all ad formats? If yes, kindly share the below details privately for further investigation:

  • app ID
  • ad unit ID
  • Any particular device to test on
  • Steps to reproduce or video recording of the issue
  • Sample project reproducing the issue if possible.

You can provide the following details via reply privately to the author option or directly provide it to the link below.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vFucL:ref" (ADR-00267201)

Thanks,
 
Google Logo Mobile Ads SDK Team


Yarden Raveh

unread,
Sep 10, 2024, 9:48:02 AMSep 10
to Google Mobile Ads SDK Developers
Hi,
Thank you for the response. Yes we have tested the AppStateChanged event and the HelloWorld example, in both cases the issue persists. I have found a related Unity Issue https://issuetracker.unity3d.com/issues/android-onapplicationpause-is-triggered-when-an-activity-window-is-being-opened-or-closed
It seems the ad opens a new activity and that triggers OnPause and the AppStateChanged event. Is this correct? and if so what do you reccomend from your side?

Kind Regards,
      Yarden Raveh

Mobile Ads SDK Forum Advisor

unread,
Sep 10, 2024, 1:31:28 PMSep 10
to yar...@muuula.com, google-adm...@googlegroups.com
Hi Yarden Raveh,

Thank you for getting back to us.

The Unity issue URL that you have sent is an general issue from Unity on android devices but not specific to GMA SDK. However, I ran the app again and the mentioned issue is reproducible. Having said that I'll raise this concern to my team members and update you accordingly. Meanwhile your patience is highly appreciated.

Yarden Raveh

unread,
Sep 12, 2024, 8:38:02 AMSep 12
to Google Mobile Ads SDK Developers
Thank you,
Just please notice that the issue linked above does referto GMA specifically (read the content), also i will appreciate any update on the isse you can give.

Kind Regards,
     Yarden Raveh

Mobile Ads SDK Forum Advisor

unread,
Sep 12, 2024, 1:14:23 PMSep 12
to yar...@muuula.com, google-adm...@googlegroups.com
Hi Yarden Raveh,

As stated earlier, this concern is raised to the team members, It is currently being investigated. So I'll update you once I have an update. Meanwhile your patience is highly appreciated.

Mobile Ads SDK Forum Advisor

unread,
Sep 18, 2024, 8:04:23 AMSep 18
to yar...@muuula.com, google-adm...@googlegroups.com
Hi,

This behavior is dependent on Unity editor settings. There is a setting in "Edit → Project Settings → Player" and also this relevant documentation which mentions By default, this is set to false and the application pauses when it is in the background.
Thanks

Yarden Raveh

unread,
Sep 23, 2024, 8:46:56 AMSep 23
to Google Mobile Ads SDK Developers
Hi,
This setting does not exist in the Project Settings and if you will look at my original post you will see that we already tried to set it on runtime via code as per the documentation link you provided.

Mobile Ads SDK Forum Advisor

unread,
Sep 23, 2024, 3:32:01 PMSep 23
to yar...@muuula.com, google-adm...@googlegroups.com
Hi Yarden Raveh,

I will check with our team regarding this project settings and one of my team members will reach out to you once we have an update. 

Yarden Raveh

unread,
Sep 30, 2024, 9:53:16 AM (10 days ago) Sep 30
to Google Mobile Ads SDK Developers
Hi,
Is there any update? Where you able to replicate the issue with Application.runInBackground = true?

With Regards,
       Yarden Raveh

Mobile Ads SDK Forum Advisor

unread,
Sep 30, 2024, 11:15:35 AM (10 days ago) Sep 30
to yar...@muuula.com, google-adm...@googlegroups.com

Hi Yarden Raveh,

Our team is investigating your issue. One of our teammates will contact you once we have an update on this. Meanwhile your patiences is appreciated.

mai mohamed

unread,
Oct 9, 2024, 10:24:19 AM (17 hours ago) Oct 9
to Yarden Raveh, Google Mobile Ads SDK Developers

غير معروف


--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/3ae7aa30-de72-42c6-b3cd-62c1d9955575n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages