Skip to content

Commit

Permalink
demoapp/bump_applovin_plugin_6.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Mar 18, 2024
1 parent 11ef949 commit 9e80b89
Show file tree
Hide file tree
Showing 18 changed files with 106 additions and 15 deletions.
2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/AppLovin.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/AppLovin/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions DemoApp/Assets/MaxSdk/AppLovin/Editor/Dependencies.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<dependencies>
<androidPackages>
<androidPackage spec="com.applovin:applovin-sdk:12.3.0" />
<androidPackage spec="com.applovin:applovin-sdk:12.3.1" />
</androidPackages>
<iosPods>
<iosPod name="AppLovinSDK" version="12.3.0" />
<iosPod name="AppLovinSDK" version="12.3.1" />
</iosPods>
</dependencies>
2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/AppLovin/Plugins.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/AppLovin/Plugins/Android.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/AppLovin/Plugins/iOS.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#import "MAUnityAdManager.h"

#define VERSION @"6.3.0"
#define VERSION @"6.3.1"

#define KEY_WINDOW [UIApplication sharedApplication].keyWindow
#define DEVICE_SPECIFIC_ADVIEW_AD_FORMAT ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) ? MAAdFormat.leader : MAAdFormat.banner
Expand Down
7 changes: 7 additions & 0 deletions DemoApp/Assets/MaxSdk/AppLovin/Plugins/iOS/MAUnityPlugin.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,13 @@ void _MaxSetExtraParameter(const char *key, const char *value)
}
}
}

int * _MaxGetSafeAreaInsets()
{
UIEdgeInsets safeAreaInsets = UnityGetGLView().safeAreaInsets;
static int insets[4] = {(int) safeAreaInsets.left, (int) safeAreaInsets.top, (int) safeAreaInsets.right, (int) safeAreaInsets.bottom};
return insets;
}

void _MaxShowCmpForExistingUser()
{
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/Prefabs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/Resources.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/Resources/Images.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/Scripts.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/Scripts/MaxSdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class MaxSdk :
MaxSdkUnityEditor
#endif
{
private const string _version = "6.3.0";
private const string _version = "6.3.1";

/// <summary>
/// Returns the current plugin version.
Expand Down
19 changes: 19 additions & 0 deletions DemoApp/Assets/MaxSdk/Scripts/MaxSdkAndroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,25 @@ public static void SetExtraParameter(string key, string value)
MaxUnityPluginClass.CallStatic("setExtraParameter", key, value);
}

/// <summary>
/// Get the native insets in pixels for the safe area.
/// These insets are used to position ads within the safe area of the screen.
/// </summary>
public static SafeAreaInsets GetSafeAreaInsets()
{
// Use an int array instead of json serialization for performance
var insets = MaxUnityPluginClass.CallStatic<int[]>("getSafeAreaInsets");

// Convert from points to pixels
var screenDensity = MaxSdkUtils.GetScreenDensity();
for (var i = 0; i < insets.Length; i++)
{
insets[i] *= (int) screenDensity;
}

return new SafeAreaInsets(insets);
}

#endregion

#region Private
Expand Down
31 changes: 31 additions & 0 deletions DemoApp/Assets/MaxSdk/Scripts/MaxSdkBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,37 @@ public override string ToString()
}
}

/// <summary>
/// Inset values for the safe area on the screen used to render banner ads.
/// </summary>
public class SafeAreaInsets
{
public int Left { get; private set; }
public int Top { get; private set; }
public int Right { get; private set; }
public int Bottom { get; private set; }

/// <summary>
/// Creates a new instance of <see cref="SafeAreaInsets"/>.
/// </summary>
/// <param name="insets">An integer array with insets values in the order of left, top, right, and bottom</param>
internal SafeAreaInsets(int[] insets)
{
Left = insets[0];
Top = insets[1];
Right = insets[2];
Bottom = insets[3];
}

public override string ToString()
{
return "[SafeAreaInsets: Left: " + Left +
", Top: " + Top +
", Right: " + Right +
", Bottom: " + Bottom + "]";
}
}

/// <summary>
/// The CMP service, which provides direct APIs for interfacing with the Google-certified CMP installed, if any.
/// </summary>
Expand Down
12 changes: 11 additions & 1 deletion DemoApp/Assets/MaxSdk/Scripts/MaxSdkUnityEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class MaxSdkUnityEditor : MaxSdkBase
private static bool _doNotSell = false;
private static bool _isDoNotSellSet = false;
private static bool _showStubAds = true;
private static SafeAreaInsets _safeAreaInsets = new SafeAreaInsets(new int[] {0, 0, 0, 0});
private static readonly HashSet<string> RequestedAdUnits = new HashSet<string>();
private static readonly HashSet<string> ReadyAdUnits = new HashSet<string>();
private static readonly Dictionary<string, GameObject> StubBanners = new Dictionary<string, GameObject>();
Expand Down Expand Up @@ -1301,7 +1302,7 @@ public static void SetCreativeDebuggerEnabled(bool enabled) { }
/// </summary>
/// <param name="advertisingIdentifiers">String list of advertising identifiers from devices to receive test ads.</param>
public static void SetTestDeviceAdvertisingIdentifiers(string[] advertisingIdentifiers)
{
{
if (IsInitialized())
{
MaxSdkLogger.UserError("Test Device Advertising Identifiers must be set before SDK initialization.");
Expand All @@ -1327,6 +1328,15 @@ public static void SetLocationCollectionEnabled(bool enabled) { }
/// <param name="value">The value for the extra parameter. May be null.</param>
public static void SetExtraParameter(string key, string value) { }

/// <summary>
/// Get the native insets in pixels for the safe area.
/// These insets are used to position ads within the safe area of the screen.
/// </summary>
public static SafeAreaInsets GetSafeAreaInsets()
{
return _safeAreaInsets;
}

#endregion

#region Internal
Expand Down
26 changes: 25 additions & 1 deletion DemoApp/Assets/MaxSdk/Scripts/MaxSdkiOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ public static Rect GetMRecLayout(string adUnitIdentifier)
}

#endregion

#region Interstitials

[DllImport("__Internal")]
Expand Down Expand Up @@ -1317,6 +1317,30 @@ public static void SetExtraParameter(string key, string value)
_MaxSetExtraParameter(key, value);
}

[DllImport("__Internal")]
private static extern IntPtr _MaxGetSafeAreaInsets();

/// <summary>
/// Get the native insets in pixels for the safe area.
/// These insets are used to position ads within the safe area of the screen.
/// </summary>
public static SafeAreaInsets GetSafeAreaInsets()
{
// Use an int array instead of json serialization for performance
var insetsPtr = _MaxGetSafeAreaInsets();
var insets = new int[4];
Marshal.Copy(insetsPtr, insets, 0, 4);

// Convert from points to pixels
var screenDensity = MaxSdkUtils.GetScreenDensity();
for (var i = 0; i < insets.Length; i++)
{
insets[i] *= (int) screenDensity;
}

return new SafeAreaInsets(insets);
}

#endregion

#region Private
Expand Down

0 comments on commit 9e80b89

Please sign in to comment.