googleads-mobile-unity
googleads-mobile-unity copied to clipboard
App Open ads malfunction during testing in the Unity Editor
Step 1: Describe your environment
- Unity version: 2022.3.19f1
- Google Mobile Ads Unity plugin version: 8.7.0
- Platform: Unity Editor
- Platform OS version: macOS 14.2
Step 2: Describe the problem
When I attempt to display the App Open ad in the Editor, it briefly flashes and then immediately closes (disappears) by itself. After the ad closes, it fails to call the OnAdFullScreenContentClosed callback.
The code loading the App Open ad:
AppOpenAd.Load(appOpenAdUnitId, request, (ad, _) => {
var success = ad != null;
if (success) {
appOpenAd = ad;
}
});
The code showing the App Open ad:
appOpenAd.OnAdFullScreenContentOpened += () => {
onShown?.Invoke();
};
appOpenAd.OnAdFullScreenContentClosed += () => {
onClosed?.Invoke();
};
appOpenAd.Show();
I was not able to see any issue on the HelloWorld AppOpen Sample.
Please take a look at the sample code to make sure there is nothing else going on in your code which might cause the ad to close prematurely. Also try adding some log statements around OnAppStateChanged
as that could trigger the ad to show.
If you push a more complete sample I can take another look.