banner ad always displays top left on Android

I have the banner set to BannerPosition.BOTTOM_CENTER;

Works fine on iOS and in the Unity Editor

On Android it displays top left. Tested on various versions of android and devices, always comes in top left.

Advertisment 4.3

8819560--1200472--Screen Shot 2023-02-20 at 15.33.02.png

Could you attach your code snippet that shows the banner? I will try to reproduce it with your code.

sure, it's the standard sample banner code.

using UnityEngine;
using UnityEngine.Advertisements;

public class BannerAd : MonoBehaviour
{
    [SerializeField] BannerPosition _bannerPosition = BannerPosition.BOTTOM_CENTER;

    [SerializeField] string _androidAdUnitId = "xxx";
    [SerializeField] string _iOSAdUnitId = "xxx";
    string _adUnitId = null; // This will remain null for unsupported platforms.

    void Start()
    {
        // Get the Ad Unit ID for the current platform:
        _adUnitId = (Application.platform == RuntimePlatform.IPhonePlayer)
            ? _iOSAdUnitId
            : _androidAdUnitId;

        Advertisement.Banner.SetPosition(_bannerPosition);
    }

How did you call Banner.Load() and Banner.Show()?
Does Show() call after complete Load()?
https://docs.unity.com/ads/en/manual/ImplementingBannerAdsUnity#Script_implementation


yes


Could you share your script file? I still can't understand how you implemented it.

1 Like

Hi, thanks for following this up it's really appreciated.

I'm just using the stock example banner script here:

https://docs.unity.com/ads/en/manual/ImplementingBannerAdsUnity

Same issue here.

If you are using Unity Ads SDK 4.3, please try to update to the latest SDK.
We've confirmed there's a banner bug on Android which is pretty similar to this thread. It should have been solved in 4.4.

4.4 apps are rejected when submitting through xcode to the appstore.

currently I am building with 4.3 for ios and 4.4 for android.

If you need to downgrade Ads SDK, please use 4.2.1 instead to avoid the banner position issue.

I never heard of the rejection issue with Unity Ads SDK 4.4, at the moment, I don't think it was caused by Ads SDK. Could you email us the details and file a ticket for the rejection issue since getting off-topic?
unityads-support@unity3d.com

[quote=“Yasuyuki”, post:11, topic: 909780]
If you need to downgrade Ads SDK, please use 4.2.1 instead to avoid the banner position issue.

I never heard of the rejection issue with Unity Ads SDK 4.4, at the moment, I don’t think it was caused by Ads SDK. Could you email us the details and file a ticket for the rejection issue since getting off-topic?
unityads-support@unity3d.com
[/quote]

@Yasuyuki I’ll try 4.2, thanks!

I tried in an empty project with unity ads 4.4 and get same error when submitting to the appstore through xcode. I’m happy to send the project over. Others are facing the same problem: https://discussions.unity.com/t/909919

I have the exact opposite, I build on PC, Android works find at bottom center.
When I build iOS, it appears at Top Left.

@enhawk @Yasuyuki

I am using Unity Ads 4.4.1, as far as getting the upload error, I resolved that. Today.

Target Unity iPhone > Build Settings: Always Embed Swift Libraries : SET to YES
Target Unity.Framework > Build Settings: Always Embed Swift Libraries : SET to NO

Otherwise you get a duplicate set of swift libraries in your XCarchives located in:
Programs>Appname>Frameworks>UnityFramework.Framework>Frameworks (swift libraries here cause the error)

I am having the issue on 4.4, but on iOS is my error, android works fine and sets banner to Bottom Center.
Do I need to downgrade to 4.2 ?

Please make sure if calling Banner.SetPosition() before Banner.Load(), otherwise I guess the banner will appear at the top left corner.

this still happens.

This caused me a lot of headache. We caught it in another thread in this forum. Pretty annoying that it needs to be set every time you build from Unity. I hope a fix for this appears soon

Thanks that's a fix at least. Here is what we detected so far

Latest IPad pro - appears on bottom center as assigned
iphone latest appears on bottom center
ipad mini - appears on bottom center
ipad mini old, appears at top left
Old ipad airs, appears at top left
iphone 5,6 appears at top left

So this seems to be an issue with older iphone OS's.