Skip to content

Commit

Permalink
demoapp/bump_applovin_plugin_6.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Mar 4, 2024
1 parent ca2a02e commit 11ef949
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 22 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.2.0" />
<androidPackage spec="com.applovin:applovin-sdk:12.3.0" />
</androidPackages>
<iosPods>
<iosPod name="AppLovinSDK" version="12.2.1" />
<iosPod name="AppLovinSDK" version="12.3.0" />
</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.

25 changes: 16 additions & 9 deletions DemoApp/Assets/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#import "MAUnityAdManager.h"

#define VERSION @"6.2.1"
#define VERSION @"6.3.0"

#define KEY_WINDOW [UIApplication sharedApplication].keyWindow
#define DEVICE_SPECIFIC_ADVIEW_AD_FORMAT ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) ? MAAdFormat.leader : MAAdFormat.banner
Expand Down Expand Up @@ -566,6 +566,7 @@ - (NSString *)adInfoForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier
@"revenue" : [@(ad.revenue) stringValue],
@"revenuePrecision" : ad.revenuePrecision,
@"waterfallInfo" : [self createAdWaterfallInfo: ad.waterfall],
@"latencyMillis" : [self requestLatencyMillisFromRequestLatency: ad.requestLatency],
@"dspName" : ad.DSPName ?: @""};
}

Expand All @@ -584,11 +585,9 @@ - (NSString *)adInfoForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier
{
[networkResponsesArray addObject: [self createNetworkResponseInfo: response]];
}
waterfallInfoDict[@"networkResponses"] = networkResponsesArray;

// Convert latency from seconds to milliseconds to match Android.
long latencyMillis = waterfallInfo.latency * 1000;
waterfallInfoDict[@"latencyMillis"] = @(latencyMillis).stringValue;
waterfallInfoDict[@"networkResponses"] = networkResponsesArray;
waterfallInfoDict[@"latencyMillis"] = [self requestLatencyMillisFromRequestLatency: waterfallInfo.latency];

return waterfallInfoDict;
}
Expand Down Expand Up @@ -621,13 +620,12 @@ - (NSString *)adInfoForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier
errorObject[@"errorMessage"] = error.message;
errorObject[@"adLoadFailure"] = error.adLoadFailureInfo;
errorObject[@"errorCode"] = @(error.code).stringValue;
errorObject[@"latencyMillis"] = [self requestLatencyMillisFromRequestLatency: error.requestLatency];

networkResponseDict[@"error"] = errorObject;
}

// Convert latency from seconds to milliseconds to match Android.
long latencySeconds = response.latency * 1000;
networkResponseDict[@"latencyMillis"] = @(latencySeconds).stringValue;
networkResponseDict[@"latencyMillis"] = [self requestLatencyMillisFromRequestLatency: response.latency];

return networkResponseDict;
}
Expand Down Expand Up @@ -758,7 +756,8 @@ - (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withErro
@"errorCode" : [@(error.code) stringValue],
@"errorMessage" : error.message,
@"waterfallInfo" : [self createAdWaterfallInfo: error.waterfall],
@"adLoadFailureInfo" : error.adLoadFailureInfo ?: @""}];
@"adLoadFailureInfo" : error.adLoadFailureInfo ?: @"",
@"latencyMillis" : [self requestLatencyMillisFromRequestLatency: error.requestLatency]}];
}

- (void)didClickAd:(MAAd *)ad
Expand Down Expand Up @@ -861,6 +860,7 @@ - (void)didFailToDisplayAd:(MAAd *)ad withError:(MAError *)error
args[@"mediatedNetworkErrorCode"] = [@(error.mediatedNetworkErrorCode) stringValue];
args[@"mediatedNetworkErrorMessage"] = error.mediatedNetworkErrorMessage;
args[@"waterfallInfo"] = [self createAdWaterfallInfo: error.waterfall];
args[@"latencyMillis"] = [self requestLatencyMillisFromRequestLatency: error.requestLatency];
[MAUnityAdManager forwardUnityEventWithArgs: args];
}

Expand Down Expand Up @@ -1952,6 +1952,13 @@ - (MAAdFormat *)adViewAdFormatForAdUnitIdentifier:(NSString *)adUnitIdentifier
}
}

- (NSString *)requestLatencyMillisFromRequestLatency:(NSTimeInterval)requestLatency
{
// Convert latency from seconds to milliseconds to match Android.
long requestLatencyMillis = requestLatency * 1000;
return @(requestLatencyMillis).stringValue;
}

#pragma mark - User Service

- (void)didDismissUserConsentDialog
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.2.1";
private const string _version = "6.3.0";

/// <summary>
/// Returns the current plugin version.
Expand Down
7 changes: 6 additions & 1 deletion DemoApp/Assets/MaxSdk/Scripts/MaxSdkBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ public static SdkConfiguration Create(IDictionary<string, object> eventProps)
sdkConfiguration.ConsentFlowUserGeography = ConsentFlowUserGeography.Unknown;
}


#pragma warning disable 0618
var consentDialogStateStr = MaxSdkUtils.GetStringFromDictionary(eventProps, "consentDialogState", "");
if ("1".Equals(consentDialogStateStr))
Expand Down Expand Up @@ -325,6 +324,7 @@ public class AdInfo
public double Revenue { get; private set; }
public string RevenuePrecision { get; private set; }
public WaterfallInfo WaterfallInfo { get; private set; }
public long LatencyMillis { get; private set; }
public string DspName { get; private set; }

public AdInfo(IDictionary<string, object> adInfoDictionary)
Expand All @@ -338,6 +338,7 @@ public AdInfo(IDictionary<string, object> adInfoDictionary)
Revenue = MaxSdkUtils.GetDoubleFromDictionary(adInfoDictionary, "revenue", -1);
RevenuePrecision = MaxSdkUtils.GetStringFromDictionary(adInfoDictionary, "revenuePrecision");
WaterfallInfo = new WaterfallInfo(MaxSdkUtils.GetDictionaryFromDictionary(adInfoDictionary, "waterfallInfo", new Dictionary<string, object>()));
LatencyMillis = MaxSdkUtils.GetLongFromDictionary(adInfoDictionary, "latencyMillis");
DspName = MaxSdkUtils.GetStringFromDictionary(adInfoDictionary, "dspName");
}

Expand All @@ -351,6 +352,7 @@ public override string ToString()
", placement: " + Placement +
", revenue: " + Revenue +
", revenuePrecision: " + RevenuePrecision +
", latency: " + LatencyMillis +
", dspName: " + DspName + "]";
}
}
Expand Down Expand Up @@ -469,6 +471,7 @@ public class ErrorInfo
public string MediatedNetworkErrorMessage { get; private set; }
public string AdLoadFailureInfo { get; private set; }
public WaterfallInfo WaterfallInfo { get; private set; }
public long LatencyMillis { get; private set; }

public ErrorInfo(IDictionary<string, object> errorInfoDictionary)
{
Expand All @@ -478,6 +481,7 @@ public ErrorInfo(IDictionary<string, object> errorInfoDictionary)
MediatedNetworkErrorMessage = MaxSdkUtils.GetStringFromDictionary(errorInfoDictionary, "mediatedNetworkErrorMessage", "");
AdLoadFailureInfo = MaxSdkUtils.GetStringFromDictionary(errorInfoDictionary, "adLoadFailureInfo", "");
WaterfallInfo = new WaterfallInfo(MaxSdkUtils.GetDictionaryFromDictionary(errorInfoDictionary, "waterfallInfo", new Dictionary<string, object>()));
LatencyMillis = MaxSdkUtils.GetLongFromDictionary(errorInfoDictionary, "latencyMillis");
}

public override string ToString()
Expand All @@ -491,6 +495,7 @@ public override string ToString()
stringbuilder.Append(", mediatedNetworkMessage: ").Append(MediatedNetworkErrorMessage);
}

stringbuilder.Append(", latency: ").Append(LatencyMillis);
return stringbuilder.Append(", adLoadFailureInfo: ").Append(AdLoadFailureInfo).Append("]").ToString();
}
}
Expand Down

0 comments on commit 11ef949

Please sign in to comment.