Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect banner position #471

Open
coffee-lady opened this issue Jan 23, 2025 · 1 comment
Open

Incorrect banner position #471

coffee-lady opened this issue Jan 23, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@coffee-lady
Copy link

MAX Plugin Version

13.0.1

Unity Version

2022.3.45f1

Device/Platform Info

iPad

Current Behavior

We're experiencing wrong banner custom positioning (with (x,y) coords) on iPad devices.

Expected Behavior

No response

How to Reproduce

We're using API for banner positioning with (x,y) coordinates:

void IProviderAdBannerInternal.SetPosition(string adUnit, Vector2 position)
{
    float screenDensity = MaxSdkUtils.GetScreenDensity();

    position /= screenDensity;

    MaxSdk.UpdateBannerPosition(adUnit, position.x, position.y);

    Log(adUnit,
        $"UpdateBannerPosition {position.ToString()} {screenDensity.ToString(CultureInfo.InvariantCulture)}");
}

This code works fine on Android phones, tablets and on iPhone devices, but there's wrong positioning on iPad:

Image

Banner has wrong position at x axis. In logs we see that position has been set correctly:

UpdateBannerPosition (0.00, 1048.93) 2

And on banner show we log the result of MaxSDK's method MaxSdk.GetBannerLayout(adUnit):
layout (x:0.00, y:1073.00, width:1165.00, height:90.00)
which is correct too. But visually this is false. Also if we try to position banner at (0,0) it's wrong too, banner has the same wrong offset at x.

Please check this behavior.

Reproducible in the demo app?

Not Tested

Additional Info

No response

@coffee-lady coffee-lady added the bug Something isn't working label Jan 23, 2025
@JonathanLiuApp
Copy link
Contributor

Hi @coffee-lady, some banner ads don't stretch the full width of the screen, so could you try either setting a fixed width for your banner, or changing your banner background to black? If you change the background color, even if the ad doesn't stretch the full width the background will show you the positioning of the banner. You can do these with MaxSdk.SetBannerBackgroundColor and MaxSdk.SetBannerWidth.

Here is the documentation for more details:
https://developers.applovin.com/en/max/unity/ad-formats/banner-and-mrec-ads/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants