googleads / googleads-mobile-unity

Official Unity Plugin for the Google Mobile Ads SDK
https://developers.google.com/admob/unity
Apache License 2.0
1.36k stars 1.08k forks source link

On iOS when you rotate the device, the banner does not hold the anchor #1874

Closed Francesco-FL closed 1 year ago

Francesco-FL commented 2 years ago

I have a small android tablet, and when I test the banner ad (banner anchored at the bottom) (smart banner (I know they are no longer supported, but maybe the same error occurs with the others so I report it)): I open the android tablet in landscape, the banner is loaded, then I rotate the device bringing it to Portrait and the banner rotates and is positioned (rightly) at the bottom (with the difference that a part of the banner is cut due to the size, but the positioning it's correct)

Then I ran the same test with an iPad Air. I open the iPad in landscape, the banner anchored at the bottom is loaded and shown, then I rotate the device to make it Portrait and the banner is not positioned at the bottom, but is in the middle of the screen, when it should anchor at the bottom.

Relevant Code:

// TODO(you): code here to reproduce the problem bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Bottom);

Str4tos commented 2 years ago

Hello. I have the same issue with default banner sizes and iPhones. Use Sample application with AdPosition.Bottom.

image

Francesco-FL commented 2 years ago

I add that in general (therefore also on Android), rotation of the device is badly managed.

If you call an adaptive banner (for example) in landscape and turn the phone to portrait, the banner is cut. For interstitials, if you call an interstitial in portrait and turn the phone to landscape, when you open the interstitial instead of being in landscape, it opens to you in portrait (so the user has to rotate the phone again to read it)

abcjjy commented 2 years ago

This is related to a bug of Unity on iOS 15.

https://forum.unity.com/threads/unity-safearea-is-inconsistent-between-different-starting-rotations.1173764

Banner placement depends on safe area of the UnityView, which is affected by the bug.

Francesco-FL commented 2 years ago

If this is the bug you are referring to (https://issuetracker.unity3d.com/issues/ios-15-screen-dot-safearea-dot-width-returns-incorrect-value-when-devices-orientation-is- switched-to-landscape-mode) should be fixed.

I have implemented different ads depending on portrait-landscape so at the moment I am not able to test if the bug of the banner is solved.

But the interstitial bug I mentioned in the second post I think has to do with the plugin, I don't think it has to do with this Unity bug (like abcjjy said specifying the banner) and it should be fixed. Do I open another different bug or has it already been taken into consideration?

abcjjy commented 2 years ago

Unity has fixed the safeArea issue for 2019 and above.

You need to reload interstitial after orientation changed.

Francesco-FL commented 2 years ago

Shouldn't the plugin do it automatically?

kunny commented 1 year ago

Since there were no recent activities for this issue, we are therefore reluctantly going to close this bug for now.

If you are still experiencing the problem, please file a new issue with the same description, what happens and system / network tracing / Charles logs.

All system setups can be slightly different, so it's always better to open new issues and reference the related ones. Thanks for your contribution.