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

OnClose event won't trigger on iOS device #3088

Closed MAypDeca closed 8 months ago

MAypDeca commented 9 months ago

We have been using GoogleAdmob SDK version 6.0.0 until now, but after we upgraded to the latest version (8.5.1), we observed that in iOS devices (not in the editor or debug builds, which is used test prefab for Admob), OnClose event wouldn't trigger, In Android side everything working properly, and all events are triggered correctly but on iOS OnClose event will not invoke.

I tried to enable SetiOSAppPauseOnBackground so the behavior gets the same as Android as the documents mentioned, but it was ineffective.

In the log section, no error or any kind of warning/info log is shown for this issue.

NVentimiglia commented 8 months ago

Hi @MAypDeca

What ad format are you trying out? Can you provide some sample code?

MAypDeca commented 8 months ago

Hello @NVentimiglia, sorry for the long delay, We mostly use Rewarded ads. For sample codes, I will try to provide them. But the overall process is that in the code, we would wait until the OnClose event is called, and in that we set some boolean also, we are using MobileAdsEventExecutor.ExecuteInUpdate to handle the main thread for unity.

kaninhot004 commented 8 months ago

@MAypDeca If you had function that destroy Reward Ad in ShowReward callback just delay it. (Mine was solved by move destroy Reward Ad to OnFullScreenClose + Delay before destroy.)

MAypDeca commented 8 months ago

Thank you @kaninhot004. Good call actually we are removing the Reward Ad in the callback of it. I will try it and see if it works.