AppLovin / AppLovin-MAX-Unity-Plugin

129 stars 35 forks source link

App-Lovin Max Banner Resolution Issue after closing the interstitial ad. #362

Closed goharjaved closed 2 months ago

goharjaved commented 7 months ago

MAX Plugin Version

6.4.3

Unity Version

2021.3.35

Device/Platform Info

IOS 17.3

Current Behavior

I am facing applovin banner placement issue on IOS. When we close the interstitial ad the banner jump to the centre of the screen. I have tried all the solutions but unable to fix this issue. It looks that IOS screen canvas snap to some pixels down.

Expected Behavior

No response

How to Reproduce

-Install the Demo App -Show Banner Ad

Additional Info

https://github.com/AppLovin/AppLovin-MAX-Unity-Plugin/assets/79394070/8d0058ee-6245-4a9a-bd3c-d84f6f7cb1af

santoshbagadi commented 7 months ago

Hi @goharjaved , this is a known issue and we are working on a fix for this. If you wish to test the fix for us right now, you can do so by replacing this line in Assets/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.m file to the following

UILayoutGuide *layoutGuide = superview.window ? superview.window.safeAreaLayoutGuide : superview.safeAreaLayoutGuide;
goharjaved commented 7 months ago

Hi @santoshbagadi , thanks for the solution.

YeonjoonJung commented 7 months ago

Hi, we have almost same problem. The game screen resolution is changed after watching video ad. I tried @santoshbagadi your suggestion by replacing that code, but it didn't work. What we've found is that 'applovin's ad occurs the resolution problem, but admob's ad has no problem.

santoshbagadi commented 7 months ago

@YeonjoonJung we are working on more robust fix that would fix the issue for our ads. We'll update here once we have the fix released.

maximilianbuck commented 6 months ago

Hi @YeonjoonJung In version 6.4.4 of our Unity plugin we added a potential fix. It's behind a setting though so you have to enable it like this: MaxSdk.SetExtraParameter("pisw", "true");

soqman commented 6 months ago

i tryed to use MaxSdk.SetExtraParameter("pisw", "true");

it doesn't help

maximilianbuck commented 6 months ago

@soqman could you please share a device log of as session where you reproduce the issue with our verbose logging enabled?

maximilianbuck commented 6 months ago

@soqman that looks to be a Unity log, sorry if it wasn't clear but I'm looking for the native device log, ie from Console or Xcode. Could you share that as well?

soqman commented 6 months ago

Console.txt

6.4.4

maximilianbuck commented 6 months ago

@soqman we found an issue with the fix and will have to make an update to our SDK. I will circle back when that gets released. Just fyi that log that doesn't have any information from our native logging, if I had to guess our SDKs verbose logging is not enabled.

soqman commented 6 months ago

I don't have xcode handy and have had some difficulties. I apologize for that. I'm pretty sure Verbose Logging is enabled in the config file. However, I have not called it through xcode. If there is a difference, it would be worth clarifying what the checkbox is for. I would appreciate any suggestions on how to avoid this bug in the current version.

maximilianbuck commented 6 months ago

Unfortunately there is no local way to get around this at this time. We'll need the next SDK release to address the issue.

alexwonton commented 6 months ago

I am facing the same issue with version 6.5.2. It seems like I cannot even press the cross button to close the ads.

May I know if there is any update on this topic?

IMG_8961

maximilianbuck commented 6 months ago

@alexwonton I assume you're using the extra parameter? The bug with ads not being closeable should've been fixed with Unity Plugin 6.5.0. I just tried reproducing any issue with version 6.5.2 of our Plugin in our demo app but wasn't able to see any issue. I was able to close all the ads without issues and the safe area (and thus banner and UI position) was not affected. Could you try to reproduce this with our demo app and share the project with us if it does? If it doesn't reproduce could you share a device log with our verbose logging enabled?

alexwonton commented 6 months ago

@maximilianbuck, thanks for your quick response. I think you are right. After I remove everything and reload the package, the issue is now gone. Thank you very much anyway :)

khambadkone commented 4 months ago

We mediate AppLovin through LevelPlay (IronSource) and are facing this problem.

Screenshot 2024-07-09 at 9 01 36 AM

We use Level Play mediation (v8.0.0) and have updated to the Applovin UnityAdapter 4.3.50.0. Added the following line before initialising IronSource MaxSdk.SetExtraParameter("pisw","true");

But we still face this issue.

  1. Why does this problem happen ?
  2. Is there a fix for users who mediate the AppLovin SDK?
dkasenko commented 4 months ago

Same

maximilianbuck commented 4 months ago

@khambadkone Assuming you're using the MAX Unity plugin to call MaxSdk.SetExtraParameter("pisw","true"); that won't modify the setting on the SDK instance that LevelPlay ends up using (unless you initialize our SDK through the plugin it actually won't do anything at all). You could potentially modify their open source adapter to call this on the settings object during the init process: [_appLovinSDK.settings setExtraParameterForKey: @"pisw" value: @"true"];

Or implement a wrapper in which you call the following native code (after ironSource initializes):

_appLovinSDK = [ALSdk sharedWithKey:@"Your AppLovin SDK Key here"];
[_appLovinSDK.settings setExtraParameterForKey: @"pisw" value: @"true"];

As for why this happens, it's essentially a bug in Apple's SKProductViewController which always tries to present in portrait mode. In landscape apps, it tries to force the orientation to be portrait, causing the safe areas insets to switch to portrait mode insets even though theSKProductViewController looks like it's presenting in landscape.

fmoyano commented 3 months ago

Any news on this? We're using Unity 2021.3.41f1, with Plugin Version 6.6.1 (latest so far) and it's still happening.

maximilianbuck commented 3 months ago

Hi @fmoyano, Have you tried enabling the setting by calling MaxSdk.SetExtraParameter("pisw", "true");?

fmoyano commented 3 months ago

Hi @fmoyano, Have you tried enabling the setting by calling MaxSdk.SetExtraParameter("pisw", "true");?

Not really. From the messages above I assumed this didn't work. I mean these messages:

i tryed to use MaxSdk.SetExtraParameter("pisw", "true");

it doesn't help

And after that, you said this:

@soqman we found an issue with the fix and will have to make an update to our SDK. I will circle back when that gets released. Just fyi that log that doesn't have any information from our native logging, if I had to guess our SDKs verbose logging is not enabled.

... and this:

Unfortunately there is no local way to get around this at this time. We'll need the next SDK release to address the issue.

So from all this (and the fact the issue is still open) I assumed it was clear this didn't help, but maybe I misunderstood?

maximilianbuck commented 3 months ago

@fmoyano The relevant SDK release was 6.5.0 so it should work on 6.6.1

fmoyano commented 3 months ago

@fmoyano The relevant SDK release was 6.5.0 so it should work on 6.6.1

Ok, got it, thanks. So should I call this before MaxSdk.InitializeSdk() or once the sdk has been initialized?

maximilianbuck commented 3 months ago

It just needs to be set before you show the ad. So after initialization is fine.

mkud commented 2 months ago

Can you tell me the mechanism of action of this setting?

Why didn't you make it enabled by default? Are there any side effects?

maximilianbuck commented 2 months ago

@mkud It presents the Store page in a separate window which does have the side effect of showing it in portrait regardless of device orientation.

Lorenzo45 commented 1 month ago

@fmoyano @mkud can you confirm the issue is resolved after calling MaxSdk.SetExtraParameter("pisw", "true"); on plugin version 6.5.0+?

fmoyano commented 1 month ago

@fmoyano @mkud can you confirm the issue is resolved after calling MaxSdk.SetExtraParameter("pisw", "true"); on plugin version 6.5.0+?

Yes, using that call fixed the issue for us.