AppLovin / AppLovin-MAX-Unity-Plugin

130 stars 35 forks source link

Cannot disable Terms Flow For Android #256

Closed kocburak closed 1 year ago

kocburak commented 1 year ago

MAX Plugin Version

5.9.0 and 5.10.0

Unity Version

2021.3.20

Device/Platform Info

Android

Current Behavior

Privacy policy is always shown on android regardless of which platform is choosen on Applovin settings.

Expected Behavior

When the "Enable Terms Flow" platform is iOS, Android should not show any popup unless "All" or "Android" selected.

How to Reproduce

Enable Terms Flow Enter a valid URL to "Privacy Policy URL" Select Platform as iOS. Make a Android build using Android SDK API 33. Open App on mobile.

Additional Info

Since Applovin Unity SDK v5.9.0 Privacy policy is always shown on android regardless of what I choose on Applovin settings. I tried "ios", "Android", "All" but Privacy policy is shown in all of them. This bug also exists on v5.10.0. We are using v5.8.3 to avoid it but it is absurd the popup is always shown. I want to show it with my own UI.

No response

santoshbagadi commented 1 year ago

Additional context here: https://github.com/AppLovin/AppLovin-MAX-SDK-Android/discussions/508

kocburak commented 1 year ago

btw, The popup displayed on demo app and the popup displayed on my app are different somehow.

I didn't fully tested but what it seems on demo app when i change the platform of terms flow it effects immediately on next build. But on my app, I had to clean build when ever i changed to "ios" (to disable android flow) it does not take effect. I have to to clean build it. If I change it to "Android" or "Both" even once in a build then it stucks enabled on android.

My App: image

Demo App: image

santoshbagadi commented 1 year ago

We show a native Android alert. So, if you are using old Android support libraries, you may see the older alert dialog.

As for needing to do a clean build, it seems like Unity may be caching the builds, which is causing the issue. We'll look into adding a note to the Integration Manager that changing the setting requires a clean build.

kocburak commented 1 year ago

Yeah it seems Facebook SDK adds support library. It explains the different UI. But why is it not just invalides the cache when a data changes ? I believe it might be about preproccessing script on Applovin SDK

kocburak commented 1 year ago

I didn't test it but I suspect AppLovinPreProcessAndroid.cs is the culprit. On line 137 it checks whether the flow be added or not than it creates applovin_settings.json in src/main/res/raw. If you make a build while Android or All selected, it creates the file. But when the platform changes to IOS it still persists. Again, this is just a speculation. I have not test this hypothesis.

santoshbagadi commented 1 year ago

We'll look into removing the applovin_settings.json when the setting is disabled for Android to ensure that it works for incremental builds. We'll update here when we have a new version of the plugin with the fix.

connectinno commented 1 year ago

We're facing the same issue with the Unity version 2021.3.2 and the latest version of Applovin (5.10.1.)

What is your suggestion to prevent this issue? Clear the incremental build cache for android builds?

kocburak commented 1 year ago

As long as you don't change the value it should be fine. Start a Clean Build with which ever setting you want it to be. Other incremental build should be fine.

babak-ss commented 1 year ago

I also had the same issue but I was able to make it work with a Clean Build

santoshbagadi commented 1 year ago

We've added a fix for this issue in our latest plugin version 5.11.0.