Update AppLovin SDK from 8.5.1 to 8.6.1

This commit is contained in:
wsycarlos 2026-03-18 17:00:45 +08:00
parent 088082e0fe
commit 042dccb032
16 changed files with 70 additions and 45 deletions

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<dependencies>
<androidPackages>
<androidPackage spec="com.applovin:applovin-sdk:13.5.1" />
<androidPackage spec="com.google.android.gms:play-services-ads-identifier:18.0.1" />
<androidPackage spec="com.applovin:applovin-sdk:13.6.1" />
</androidPackages>
<iosPods>
<iosPod name="AppLovinSDK" version="13.5.1" />
<iosPod name="AppLovinSDK" version="13.6.1" />
</iosPods>
</dependencies>

View File

@ -8,7 +8,7 @@
#import "MAUnityAdManager.h"
#define VERSION @"8.5.1"
#define VERSION @"8.6.1"
#define NSSTRING(_X) ( (_X != NULL) ? [NSString stringWithCString: _X encoding: NSStringEncodingConversionAllowLossy].al_stringByTrimmingWhitespace : nil)
@interface NSString (ALUtils)

View File

@ -73,9 +73,14 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor
"MaxSdk/Version.md.meta",
// The alert_icon.png has been renamed to error_icon.png.
"MaxSdk/Resources/Images/alert_icon.png"
"MaxSdk/Resources/Images/alert_icon.png",
"MaxSdk/Resources/Images/alert_icon.png.meta",
// TODO: Add MaxTargetingData and MaxUserSegment when the plugin has enough traction.
// `TargetingData` has been removed and we no longer set `UserSegment` through the Unity Plugin.
"MaxSdk/Scripts/MaxUserSegment.cs",
"MaxSdk/Scripts/MaxUserSegment.cs.meta",
"MaxSdk/Scripts/MaxTargetingData.cs",
"MaxSdk/Scripts/MaxTargetingData.cs.meta"
};
static AppLovinInitialize()

View File

@ -97,6 +97,10 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor
public string Title;
public string Message;
public string Url;
public string MinimumPluginVersion;
public string MaximumPluginVersion;
public string MinimumUnityVersion;
public string MaximumUnityVersion;
public Severity Severity;
@ -119,6 +123,13 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor
break;
}
}
public bool ShouldShowAlert()
{
var pluginVersionValid = MaxSdkUtils.IsVersionInRange(MaxSdk.Version, MinimumPluginVersion, MaximumPluginVersion);
var unityVersionValid = MaxSdkUtils.IsVersionInRange(Application.unityVersion, MinimumUnityVersion, MaximumUnityVersion);
return pluginVersionValid && unityVersionValid;
}
}
/// <summary>

View File

@ -8,6 +8,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
@ -223,17 +224,21 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor
DrawPluginDetails();
// Draw alerts
if (pluginData != null && pluginData.Alerts != null && pluginData.Alerts.Length > 0)
if (pluginData != null && pluginData.Alerts != null)
{
EditorGUILayout.BeginHorizontal();
var showAlertDetails = DrawExpandCollapseButton(KeyShowAlerts);
EditorGUILayout.LabelField("Alerts", titleLabelStyle, GUILayout.Width(45));
DrawAlertCount();
GUILayout.FlexibleSpace();
EditorGUILayout.EndHorizontal();
if (showAlertDetails)
var alertsToShow = pluginData.Alerts.Where(alert => alert.ShouldShowAlert()).ToList();
if (alertsToShow.Count > 0)
{
DrawAlerts();
EditorGUILayout.BeginHorizontal();
var showAlertDetails = DrawExpandCollapseButton(KeyShowAlerts);
EditorGUILayout.LabelField("Alerts", titleLabelStyle, GUILayout.Width(45));
DrawAlertCount(alertsToShow);
GUILayout.FlexibleSpace();
EditorGUILayout.EndHorizontal();
if (showAlertDetails)
{
DrawAlerts(alertsToShow);
}
}
}
@ -386,13 +391,13 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor
/// <summary>
/// Draw the number of each alert type next to the alert section header.
/// </summary>
private void DrawAlertCount()
private void DrawAlertCount(List<Alert> alerts)
{
if (pluginData == null) return;
var infoAlertsCount = pluginData.Alerts.Count(alert => alert.Severity == Severity.Info);
var warningAlertsCount = pluginData.Alerts.Count(alert => alert.Severity == Severity.Warning);
var errorAlertsCount = pluginData.Alerts.Count(alert => alert.Severity == Severity.Error);
var infoAlertsCount = alerts.Count(alert => alert.Severity == Severity.Info);
var warningAlertsCount = alerts.Count(alert => alert.Severity == Severity.Warning);
var errorAlertsCount = alerts.Count(alert => alert.Severity == Severity.Error);
GUILayout.Label(infoIcon, GUILayout.Width(20), GUILayout.Height(20));
EditorGUILayout.LabelField(AlertCountToString(infoAlertsCount), GUILayout.Width(20));
@ -405,24 +410,24 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor
/// <summary>
/// Draw the list of alerts grouped by severity.
/// </summary>
private void DrawAlerts()
private void DrawAlerts(List<Alert> alerts)
{
GUILayout.BeginHorizontal();
GUILayout.Space(10);
using (new EditorGUILayout.VerticalScope("box"))
{
DrawAlertsOfType(Severity.Error);
DrawAlertsOfType(Severity.Warning);
DrawAlertsOfType(Severity.Info);
DrawAlertsOfType(alerts, Severity.Error);
DrawAlertsOfType(alerts, Severity.Warning);
DrawAlertsOfType(alerts, Severity.Info);
}
GUILayout.Space(5);
GUILayout.EndHorizontal();
}
private void DrawAlertsOfType(Severity severity)
private void DrawAlertsOfType(List<Alert> alerts, Severity severity)
{
var alertsOfType = pluginData.Alerts.Where(alert => alert.Severity == severity).ToList();
var alertsOfType = alerts.Where(alert => alert.Severity == severity).ToList();
foreach (var alert in alertsOfType)
{
DrawAlert(alert);
@ -640,9 +645,9 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor
GUI.enabled = networkButtonsEnabled && isInstalled;
if (GUILayout.Button(new GUIContent {image = uninstallIcon, tooltip = "Uninstall"}, iconStyle))
{
EditorUtility.DisplayProgressBar("Integration Manager", "Deleting " + network.Name + "...", 0.5f);
AppLovinPackageManager.RemoveNetwork(network);
EditorUtility.ClearProgressBar();
AppLovinPackageManager.UpdateCurrentVersions(network);
UpdateShouldShowGoogleWarningIfNeeded();
}
GUI.enabled = true;
@ -790,11 +795,6 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor
GUILayout.Space(4);
GUILayout.Space(4);
if(AppLovinSettings.Instance.QualityServiceEnabled)
{
AppLovinSettings.Instance.AdReviewKey = DrawTextField("AppLovin Ad Review Key", AppLovinSettings.Instance.AdReviewKey, GUILayout.Width(PrivacySettingLabelWidth), privacySettingFieldWidthOption);
}
GUILayout.Space(4);
}
GUILayout.Space(5);

View File

@ -263,6 +263,9 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor
/// otherwise, deletes the adapter from the Assets folder.</param>
internal static void DeleteDuplicateAdapter(Network network, bool keepAssetsAdapter)
{
// Skip duplicate removal logic for our plugin.
if (network.Name.Equals("APPLOVIN_NETWORK")) return;
if (keepAssetsAdapter)
{
var appLovinManifest = AppLovinUpmManifest.Load();

View File

@ -284,13 +284,7 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor
var currentIosVersion = network.CurrentVersions.Ios;
if (string.IsNullOrEmpty(currentIosVersion)) return false;
var minIosVersion = libraryToEmbed.MinVersion;
var maxIosVersion = libraryToEmbed.MaxVersion;
var greaterThanOrEqualToMinVersion = string.IsNullOrEmpty(minIosVersion) || MaxSdkUtils.CompareVersions(currentIosVersion, minIosVersion) != MaxSdkUtils.VersionComparisonResult.Lesser;
var lessThanOrEqualToMaxVersion = string.IsNullOrEmpty(maxIosVersion) || MaxSdkUtils.CompareVersions(currentIosVersion, maxIosVersion) != MaxSdkUtils.VersionComparisonResult.Greater;
return greaterThanOrEqualToMinVersion && lessThanOrEqualToMaxVersion;
return MaxSdkUtils.IsVersionInRange(currentIosVersion, libraryToEmbed.MinVersion, libraryToEmbed.MaxVersion);
}
private static List<string> GetDynamicLibraryPathsInProjectToEmbed(string podsDirectory, List<string> dynamicLibrariesToEmbed)

View File

@ -23,7 +23,7 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor
private const string ElementNameAndroidPackage = "androidPackage";
private const string AttributeNameSpec = "spec";
private const string UmpDependencyPackage = "com.google.android.ump:user-messaging-platform:";
private const string UmpDependencyVersion = "2.1.0";
private const string UmpDependencyVersion = "4.0.0";
public void OnPreprocessBuild(BuildReport report)
{

View File

@ -26,7 +26,7 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor
private const string AttributeNameName = "name";
private const string AttributeNameVersion = "version";
private const string UmpDependencyPod = "GoogleUserMessagingPlatform";
private const string UmpDependencyVersion = "~> 2.1";
private const string UmpDependencyVersion = "~> 3.1";
private static void AddGoogleCmpDependencyIfNeeded()
{

View File

@ -14,7 +14,7 @@ public class MaxSdk :
MaxSdkUnityEditor
#endif
{
private const string _version = "8.5.1";
private const string _version = "8.6.1";
/// <summary>
/// Returns the current plugin version.

View File

@ -812,7 +812,9 @@ public class MaxSdkAndroid : MaxSdkBase
/// <param name="parameters">A dictionary containing key-value pairs further describing this event.</param>
public static void TrackEvent(string name, IDictionary<string, string> parameters = null)
{
MaxUnityPluginClass.CallStatic("trackEvent", name, Json.Serialize(parameters));
// Convert null to "{}" to avoid Unity sending the literal "null" to Android.
var jsonString = ( parameters == null ) ? EmptyJson : Json.Serialize(parameters);
MaxUnityPluginClass.CallStatic("trackEvent", name, jsonString);
}
#endregion

View File

@ -14,6 +14,8 @@ using System.Runtime.InteropServices;
public abstract class MaxSdkBase
{
protected const string EmptyJson = "{}";
/// <summary>
/// This enum represents the user's geography used to determine the type of consent flow shown to the user.
/// </summary>

View File

@ -488,6 +488,13 @@ public static class MaxSdkUtils
}
}
public static bool IsVersionInRange(string currentVersion, string minVersion, string maxVersion)
{
var greaterThanOrEqualToMin = string.IsNullOrEmpty(minVersion) || MaxSdkUtils.CompareVersions(currentVersion, minVersion) != MaxSdkUtils.VersionComparisonResult.Lesser;
var lessThanOrEqualToMax = string.IsNullOrEmpty(maxVersion) || MaxSdkUtils.CompareVersions(currentVersion, maxVersion) != MaxSdkUtils.VersionComparisonResult.Greater;
return greaterThanOrEqualToMin && lessThanOrEqualToMax;
}
/// <summary>
/// Compares its two arguments for order. Returns <see cref="VersionComparisonResult.Lesser"/>, <see cref="VersionComparisonResult.Equal"/>,
/// or <see cref="VersionComparisonResult.Greater"/> as the first version is less than, equal to, or greater than the second.

View File

@ -1027,7 +1027,9 @@ public class MaxSdkiOS : MaxSdkBase
/// <param name="parameters">A dictionary containing key-value pairs further describing this event.</param>
public static void TrackEvent(string name, IDictionary<string, string> parameters = null)
{
_MaxTrackEvent(name, Json.Serialize(parameters));
// Convert null to "{}" to avoid Unity sending the literal "null" to iOS.
var jsonString = ( parameters == null ) ? EmptyJson : Json.Serialize(parameters);
_MaxTrackEvent(name, jsonString);
}
#endregion

View File

@ -1,7 +1,7 @@
{
"name": "com.bywaystudios.applovin.mediation.ads",
"displayName": "AppLovin MAX Mediation Plugin for Unity",
"version": "8.5.1-exp.5",
"version": "8.6.1-exp.1",
"description": "AppLovin turns mobile into the medium of choice for advertisers.\n\nOUR MISSION\n\nEnable advertisers to make ROI-based marketing decisions and deliver relevant content on mobile.\n\nOur marketing platform reaches new users and matches them with relevant brands - ensuring you reach the users that are likely to engage.\n\nWe deliver relevant content to over a billion mobile consumers every month. With AppLovin, advertisers attain their mobile marketing goals.\n\nModified by Byway Studios",
"unity": "2019.2",
"dependencies": {