// // AppLovinBuildPreProcessiOS.cs // AppLovin MAX Unity Plugin // // Created by Jonathan Liu on 10/17/2023. // Copyright © 2023 AppLovin. All rights reserved. // #if UNITY_IOS using UnityEditor.Build; using UnityEditor.Build.Reporting; namespace AppLovinMax.Scripts.IntegrationManager.Editor { public class AppLovinPreProcessiOS : AppLovinPreProcess, IPreprocessBuildWithReport { public void OnPreprocessBuild(BuildReport report) { AddGoogleCmpDependencyIfNeeded(); } private const string UmpLegacyDependencyLine = ""; private const string UmpDependencyLine = ""; private const string IosPodsContainerElementString = "iosPods"; private static void AddGoogleCmpDependencyIfNeeded() { // Remove the legacy fixed UMP version if it exists, we'll add the dependency with a dynamic version below. TryRemoveStringFromDependencyFile(UmpLegacyDependencyLine, IosPodsContainerElementString); if (AppLovinInternalSettings.Instance.ConsentFlowEnabled) { TryAddStringToDependencyFile(UmpDependencyLine, IosPodsContainerElementString); } else { TryRemoveStringFromDependencyFile(UmpDependencyLine, IosPodsContainerElementString); } } public int callbackOrder { get { return int.MaxValue; } } } } #endif