Skip to content

Commit

Permalink
demoapp/bump_applovin_plugin_6.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AppLovin-Mobile-Engineering committed Jul 22, 2024
1 parent fcffcfb commit dce00c3
Show file tree
Hide file tree
Showing 31 changed files with 1,209 additions and 1,592 deletions.
5 changes: 1 addition & 4 deletions DemoApp/Assets/MaxSdk/AppLovin.meta

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

5 changes: 1 addition & 4 deletions 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.5.0" />
<androidPackage spec="com.applovin:applovin-sdk:12.6.0" />
</androidPackages>
<iosPods>
<iosPod name="AppLovinSDK" version="12.5.0" />
<iosPod name="AppLovinSDK" version="12.6.0" />
</iosPods>
</dependencies>
5 changes: 1 addition & 4 deletions DemoApp/Assets/MaxSdk/AppLovin/Plugins.meta

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

5 changes: 1 addition & 4 deletions 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.
5 changes: 1 addition & 4 deletions 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 @@ -12,7 +12,7 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);

@interface MAUnityAdManager : NSObject

- (ALSdk *)initializeSdkWithSettings:(ALSdkSettings *)settings backgroundCallback:(ALUnityBackgroundCallback)unityBackgroundCallback andCompletionHandler:(ALSdkInitializationCompletionHandler)completionHandler;
- (void)initializeSdkWithConfiguration:(ALSdkInitializationConfiguration *)initConfig andCompletionHandler:(ALSdkInitializationCompletionHandler)completionHandler;

- (void)createBannerWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier atPosition:(nullable NSString *)bannerPosition;
- (void)createBannerWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier x:(CGFloat)xOffset y:(CGFloat)yOffset;
Expand Down Expand Up @@ -92,6 +92,8 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
+ (NSString *)serializeParameters:(NSDictionary<NSString *, id> *)dict;
+ (NSDictionary<NSString *, id> *)deserializeParameters:(nullable NSString *)serialized;

+ (void)setUnityBackgroundCallback:(ALUnityBackgroundCallback)unityBackgroundCallback;

/**
* Creates an instance of @c MAUnityAdManager if needed and returns the singleton instance.
*/
Expand Down
42 changes: 9 additions & 33 deletions DemoApp/Assets/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#import "MAUnityAdManager.h"

#define VERSION @"6.5.2"

#define KEY_WINDOW [UIApplication sharedApplication].keyWindow
#define DEVICE_SPECIFIC_ADVIEW_AD_FORMAT ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) ? MAAdFormat.leader : MAAdFormat.banner
#define IS_VERTICAL_BANNER_POSITION(_POS) ( [@"center_left" isEqual: adViewPosition] || [@"center_right" isEqual: adViewPosition] )
Expand Down Expand Up @@ -193,29 +191,19 @@ + (MAUnityAdManager *)shared
return shared;
}

+ (void)setUnityBackgroundCallback:(ALUnityBackgroundCallback)unityBackgroundCallback
{
backgroundCallback = unityBackgroundCallback;
}

#pragma mark - Plugin Initialization

- (ALSdk *)initializeSdkWithSettings:(ALSdkSettings *)settings
backgroundCallback:(ALUnityBackgroundCallback)unityBackgroundCallback
andCompletionHandler:(ALSdkInitializationCompletionHandler)completionHandler
- (void)initializeSdkWithConfiguration:(ALSdkInitializationConfiguration *)initConfig andCompletionHandler:(ALSdkInitializationCompletionHandler)completionHandler;
{
backgroundCallback = unityBackgroundCallback;
NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
NSString *sdkKey = infoDict[@"AppLovinSdkKey"];
if ( [sdkKey al_isValidString] )
{
self.sdk = [ALSdk sharedWithKey: sdkKey settings: settings];
}
else
{
self.sdk = [ALSdk sharedWithSettings: settings];
}

[self.sdk setPluginVersion: [@"Max-Unity-" stringByAppendingString: VERSION]];
self.sdk.mediationProvider = @"max";
[self.sdk initializeSdkWithCompletionHandler:^(ALSdkConfiguration *configuration)
{
self.sdk = [ALSdk shared];
[self.sdk initializeWithConfiguration: initConfig completionHandler:^(ALSdkConfiguration *configuration) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

// Note: internal state should be updated first
completionHandler( configuration );

Expand All @@ -231,8 +219,6 @@ - (ALSdk *)initializeSdkWithSettings:(ALSdkSettings *)settings
@"isTestModeEnabled" : @([configuration isTestModeEnabled])}];
});
}];

return self.sdk;
}

#pragma mark - Banners
Expand Down Expand Up @@ -1029,16 +1015,6 @@ - (void)didCollapseAd:(MAAd *)ad
});
}

- (void)didStartRewardedVideoForAd:(MAAd *)ad
{
// This event is not forwarded
}

- (void)didCompleteRewardedVideoForAd:(MAAd *)ad
{
// This event is not forwarded
}

- (void)didRewardUserForAd:(MAAd *)ad withReward:(MAReward *)reward
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
Expand Down
Loading

0 comments on commit dce00c3

Please sign in to comment.