The banner ad works fine displaying at the top of of the screen as long as I don’t interact with it. However, after tapping the ad, if it is the kind that brings up an overlay of another app to download, I will return to the game to see that the banner has been displaced and appears to have moved towards the center of the screen:
The ad will not reset itself back to the top of the screen unless I send the app to background and go back into it, which is obviously a problem.
This is happening on LevelPlay Unity Plugin 8.0.0 with Unity 2022.3.19, and happens with Google Ads. It also happens only on iOS, Android is ok. Has anybody seen such a thing or any insight to why this might happen? Thanks a lot.
hey @mish775
We actually just logged a bug internally for something similar to this. It might have something to do with Apple’s webview. If admob is the only network this happens to, could you please reach out to your Google AM and see if they can disable storekit preview on their banner ad unit?
This might have something to do with the “safe area” (or at least the way the app interacts with it) changing between when the app is playing normally and when an overlay from tapping an ad pops up.
I did find a solution that eliminated the problem completely for me. After building the project, I go into /Classes/UnityAppController.mm, find the function applicationDidBecomeActive, and at the beginning of that function just add this line of code: application.keyWindow.rootViewController.view.insetsLayoutMarginsFromSafeArea = false;. According to Apple docs, this statement should prevent the layout margins from updating automatically to reflect the safe area, so I would think this works because any changes the ad overlay made to mess up the margins will now not affect the application view.
If anyone else has the above issue, give it a try! However definitely not a workaround that should have to be done. @cnguyen_unitylevelplay if you want any more info about the bug or my solution above that might help the people addressing the bug let me know.