AppLovin / AppLovin-MAX-Unity-Plugin

127 stars 35 forks source link

UpdateBannerPosition does not update X position if initially created at BannerPosition.BottomCenter #429

Open v-ramanouskaya opened 1 month ago

v-ramanouskaya commented 1 month ago

MAX Plugin Version

6.5.0

Unity Version

2022.3.34f1

Device/Platform Info

all devices

Current Behavior

If the banner initially created with a pivot for positioning MaxSdk.CreateBanner(adUnitId,BannerAdUnitId,MaxSdkBase.BannerPosition.BottomCenter); following MaxSdk.UpdateBannerPosition(adUnitId, bannerXPosition, bannerYPosition); does not update X position, and always sets the banner at the left corner of the screen.

Expected Behavior

MaxSdk.UpdateBannerPosition(adUnitId, bannerXPosition, bannerYPosition); updates both x and y position correctly

How to Reproduce

Follow the steps in the description

Reproducible in the demo app?

Not Tested

Additional Info

No response

santoshbagadi commented 1 month ago

@v-ramanouskaya BottomCenter and TopCenter positions set the banner to full width, which could be causing the issue. Can you try using the CreateBanner(string adUnitIdentifier, float x, float y) API when creating the banner to avoid this issue.

We'll include a fix to update to default width when banner position is updated in a later release.

v-ramanouskaya commented 1 month ago

@v-ramanouskaya BottomCenter and TopCenter positions set the banner to full width, which could be causing the issue. Can you try using the CreateBanner(string adUnitIdentifier, float x, float y) API when creating the banner to avoid this issue.

We'll include a fix to update to default width when banner position is updated in a later release.

Thank you for your reply. We are using remote config to set up our banner position (switch between custom position and pre-defined pivot position), so If the banner was initially created using the pivot, we can not switch it to using custom position correctly.

Another thing, is if we try to Re-create the banner (Destroy -> Create Banner) when the new config received, the Ads seem to not Load, since we stop receiving OnAdLoadedEvent callback.

JonathanLiuApp commented 1 month ago

Hi @v-ramanouskaya I wasn't able to reproduce your issue.

I followed the steps and did

        MaxSdk.CreateBanner(BANNER_AD_UNIT_ID, MaxSdkBase.BannerPosition.BottomCenter);
        MaxSdk.UpdateBannerPosition(adUnitId, 300, 0)

and was able to successfully update the banner position.

I did notice that in your description you used MaxSdk.CreateBanner(adUnitId,BannerAdUnitId,MaxSdkBase.BannerPosition.BottomCenter); Could you check and make sure you are calling CreateBanner with only two arguments when you are creating a banner with a pivot? Using three arguments creates a banner with a set x and y position.

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 30 days with no activity.