Skip to content

Commit febc696

Browse files
author
AppLovin-Mobile-Engineering
committed
demoapp/bump_applovin_plugin_8.1.0
1 parent 803fa2d commit febc696

36 files changed

+576
-1021
lines changed

DemoApp/Assets/MaxSdk/AppLovin.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DemoApp/Assets/MaxSdk/AppLovin/Editor.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<dependencies>
33
<androidPackages>
4-
<androidPackage spec="com.applovin:applovin-sdk:13.0.1" />
4+
<androidPackage spec="com.applovin:applovin-sdk:13.1.0" />
55
</androidPackages>
66
<iosPods>
7-
<iosPod name="AppLovinSDK" version="13.0.1" />
7+
<iosPod name="AppLovinSDK" version="13.1.0" />
88
</iosPods>
99
</dependencies>

DemoApp/Assets/MaxSdk/AppLovin/Plugins.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DemoApp/Assets/MaxSdk/AppLovin/Plugins/Android.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

DemoApp/Assets/MaxSdk/AppLovin/Plugins/iOS.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DemoApp/Assets/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.h

-6
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
6767
- (void)setRewardedAdExtraParameterForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier key:(nullable NSString *)key value:(nullable NSString *)value;
6868
- (void)setRewardedAdLocalExtraParameterForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier key:(nullable NSString *)key value:(nullable id)value;
6969

70-
- (void)loadRewardedInterstitialAdWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier;
71-
- (BOOL)isRewardedInterstitialAdReadyWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier;
72-
- (void)showRewardedInterstitialAdWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData;
73-
- (void)setRewardedInterstitialAdExtraParameterForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier key:(nullable NSString *)key value:(nullable NSString *)value;
74-
- (void)setRewardedInterstitialAdLocalExtraParameterForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier key:(nullable NSString *)key value:(nullable id)value;
75-
7670
// Event Tracking
7771
- (void)trackEvent:(nullable NSString *)event parameters:(nullable NSString *)parameters;
7872

DemoApp/Assets/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.m

+48-97
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void max_unity_dispatch_on_main_thread(dispatch_block_t block)
4242
}
4343
#endif
4444

45-
@interface MAUnityAdManager()<MAAdDelegate, MAAdViewAdDelegate, MARewardedAdDelegate, MAAdRevenueDelegate, MAAdReviewDelegate>
45+
@interface MAUnityAdManager()<MAAdDelegate, MAAdViewAdDelegate, MARewardedAdDelegate, MAAdRevenueDelegate, MAAdReviewDelegate, MAAdExpirationDelegate>
4646

4747
// Parent Fields
4848
@property (nonatomic, weak) ALSdk *sdk;
@@ -51,7 +51,6 @@ @interface MAUnityAdManager()<MAAdDelegate, MAAdViewAdDelegate, MARewardedAdDele
5151
@property (nonatomic, strong) NSMutableDictionary<NSString *, MAInterstitialAd *> *interstitials;
5252
@property (nonatomic, strong) NSMutableDictionary<NSString *, MAAppOpenAd *> *appOpenAds;
5353
@property (nonatomic, strong) NSMutableDictionary<NSString *, MARewardedAd *> *rewardedAds;
54-
@property (nonatomic, strong) NSMutableDictionary<NSString *, MARewardedInterstitialAd *> *rewardedInterstitialAds;
5554

5655
// AdView Fields
5756
@property (nonatomic, strong) NSMutableDictionary<NSString *, MAAdView *> *adViews;
@@ -112,7 +111,6 @@ - (instancetype)init
112111
self.interstitials = [NSMutableDictionary dictionaryWithCapacity: 2];
113112
self.appOpenAds = [NSMutableDictionary dictionaryWithCapacity: 2];
114113
self.rewardedAds = [NSMutableDictionary dictionaryWithCapacity: 2];
115-
self.rewardedInterstitialAds = [NSMutableDictionary dictionaryWithCapacity: 2];
116114
self.adViews = [NSMutableDictionary dictionaryWithCapacity: 2];
117115
self.adViewAdFormats = [NSMutableDictionary dictionaryWithCapacity: 2];
118116
self.adViewPositions = [NSMutableDictionary dictionaryWithCapacity: 2];
@@ -518,44 +516,6 @@ - (void)setRewardedAdLocalExtraParameterForAdUnitIdentifier:(nullable NSString *
518516
[rewardedAd setLocalExtraParameterForKey: key value: value];
519517
}
520518

521-
#pragma mark - Rewarded Interstitials
522-
523-
- (void)loadRewardedInterstitialAdWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier
524-
{
525-
MARewardedInterstitialAd *rewardedInterstitialAd = [self retrieveRewardedInterstitialAdForAdUnitIdentifier: adUnitIdentifier];
526-
[rewardedInterstitialAd loadAd];
527-
}
528-
529-
- (BOOL)isRewardedInterstitialAdReadyWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier
530-
{
531-
MARewardedInterstitialAd *rewardedInterstitialAd = [self retrieveRewardedInterstitialAdForAdUnitIdentifier: adUnitIdentifier];
532-
return [rewardedInterstitialAd isReady];
533-
}
534-
535-
- (void)showRewardedInterstitialAdWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData
536-
{
537-
MARewardedInterstitialAd *rewardedInterstitialAd = [self retrieveRewardedInterstitialAdForAdUnitIdentifier: adUnitIdentifier];
538-
[rewardedInterstitialAd showAdForPlacement: placement customData: customData];
539-
}
540-
541-
- (void)setRewardedInterstitialAdExtraParameterForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier key:(nullable NSString *)key value:(nullable NSString *)value
542-
{
543-
MARewardedInterstitialAd *rewardedInterstitialAd = [self retrieveRewardedInterstitialAdForAdUnitIdentifier: adUnitIdentifier];
544-
[rewardedInterstitialAd setExtraParameterForKey: key value: value];
545-
}
546-
547-
- (void)setRewardedInterstitialAdLocalExtraParameterForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier key:(nullable NSString *)key value:(nullable id)value
548-
{
549-
if ( !key )
550-
{
551-
[self log: @"Failed to set local extra parameter: No key specified"];
552-
return;
553-
}
554-
555-
MARewardedInterstitialAd *rewardedInterstitialAd = [self retrieveRewardedInterstitialAdForAdUnitIdentifier: adUnitIdentifier];
556-
[rewardedInterstitialAd setLocalExtraParameterForKey: key value: value];
557-
}
558-
559519
#pragma mark - Event Tracking
560520

561521
- (void)trackEvent:(nullable NSString *)event parameters:(nullable NSString *)parameters
@@ -627,6 +587,7 @@ - (NSString *)adInfoForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier
627587
networkInfoObject[@"adapterClassName"] = response.mediatedNetwork.adapterClassName;
628588
networkInfoObject[@"adapterVersion"] = response.mediatedNetwork.adapterVersion;
629589
networkInfoObject[@"sdkVersion"] = response.mediatedNetwork.sdkVersion;
590+
networkInfoObject[@"initializationStatus"] = @(response.mediatedNetwork.initializationStatus);
630591

631592
networkResponseDict[@"mediatedNetwork"] = networkInfoObject;
632593
}
@@ -705,10 +666,6 @@ - (void)didLoadAd:(MAAd *)ad
705666
{
706667
name = @"OnRewardedAdLoadedEvent";
707668
}
708-
else if ( MAAdFormat.rewardedInterstitial == adFormat )
709-
{
710-
name = @"OnRewardedInterstitialAdLoadedEvent";
711-
}
712669
else
713670
{
714671
[self logInvalidAdFormat: adFormat];
@@ -762,10 +719,6 @@ - (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withErro
762719
{
763720
name = @"OnRewardedAdLoadFailedEvent";
764721
}
765-
else if ( self.rewardedInterstitialAds[adUnitIdentifier] )
766-
{
767-
name = @"OnRewardedInterstitialAdLoadFailedEvent";
768-
}
769722
else
770723
{
771724
[self log: @"invalid adUnitId from %@", [NSThread callStackSymbols]];
@@ -813,10 +766,6 @@ - (void)didClickAd:(MAAd *)ad
813766
{
814767
name = @"OnRewardedAdClickedEvent";
815768
}
816-
else if ( MAAdFormat.rewardedInterstitial == adFormat )
817-
{
818-
name = @"OnRewardedInterstitialAdClickedEvent";
819-
}
820769
else
821770
{
822771
[self logInvalidAdFormat: adFormat];
@@ -850,14 +799,10 @@ - (void)didDisplayAd:(MAAd *)ad
850799
{
851800
name = @"OnAppOpenAdDisplayedEvent";
852801
}
853-
else if ( MAAdFormat.rewarded == adFormat )
802+
else // rewarded
854803
{
855804
name = @"OnRewardedAdDisplayedEvent";
856805
}
857-
else // rewarded inters
858-
{
859-
name = @"OnRewardedInterstitialAdDisplayedEvent";
860-
}
861806

862807
NSDictionary<NSString *, id> *args = [self defaultAdEventParametersForName: name withAd: ad];
863808
[self forwardUnityEventWithArgs: args];
@@ -881,14 +826,10 @@ - (void)didFailToDisplayAd:(MAAd *)ad withError:(MAError *)error
881826
{
882827
name = @"OnAppOpenAdFailedToDisplayEvent";
883828
}
884-
else if ( MAAdFormat.rewarded == adFormat )
829+
else // rewarded
885830
{
886831
name = @"OnRewardedAdFailedToDisplayEvent";
887832
}
888-
else // rewarded inters
889-
{
890-
name = @"OnRewardedInterstitialAdFailedToDisplayEvent";
891-
}
892833

893834
NSMutableDictionary<NSString *, id> *args = [self defaultAdEventParametersForName: name withAd: ad];
894835
args[@"errorCode"] = [@(error.code) stringValue];
@@ -932,14 +873,10 @@ - (void)didHideAd:(MAAd *)ad
932873
{
933874
name = @"OnAppOpenAdHiddenEvent";
934875
}
935-
else if ( MAAdFormat.rewarded == adFormat )
876+
else // rewarded
936877
{
937878
name = @"OnRewardedAdHiddenEvent";
938879
}
939-
else // rewarded inters
940-
{
941-
name = @"OnRewardedInterstitialAdHiddenEvent";
942-
}
943880

944881
NSDictionary<NSString *, id> *args = [self defaultAdEventParametersForName: name withAd: ad];
945882
[self forwardUnityEventWithArgs: args];
@@ -1022,7 +959,7 @@ - (void)didRewardUserForAd:(MAAd *)ad withReward:(MAReward *)reward
1022959
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
1023960

1024961
MAAdFormat *adFormat = ad.format;
1025-
if ( adFormat != MAAdFormat.rewarded && adFormat != MAAdFormat.rewardedInterstitial )
962+
if ( adFormat != MAAdFormat.rewarded )
1026963
{
1027964
[self logInvalidAdFormat: adFormat];
1028965
return;
@@ -1031,10 +968,8 @@ - (void)didRewardUserForAd:(MAAd *)ad withReward:(MAReward *)reward
1031968
NSString *rewardLabel = reward ? reward.label : @"";
1032969
NSInteger rewardAmountInt = reward ? reward.amount : 0;
1033970
NSString *rewardAmount = [@(rewardAmountInt) stringValue];
1034-
1035-
NSString *name = (adFormat == MAAdFormat.rewarded) ? @"OnRewardedAdReceivedRewardEvent" : @"OnRewardedInterstitialAdReceivedRewardEvent";
1036-
1037-
971+
NSString *name = @"OnRewardedAdReceivedRewardEvent";
972+
1038973
NSMutableDictionary<NSString *, id> *args = [self defaultAdEventParametersForName: name withAd: ad];
1039974
args[@"rewardLabel"] = rewardLabel;
1040975
args[@"rewardAmount"] = rewardAmount;
@@ -1068,10 +1003,6 @@ - (void)didPayRevenueForAd:(MAAd *)ad
10681003
{
10691004
name = @"OnRewardedAdRevenuePaidEvent";
10701005
}
1071-
else if ( MAAdFormat.rewardedInterstitial == adFormat )
1072-
{
1073-
name = @"OnRewardedInterstitialAdRevenuePaidEvent";
1074-
}
10751006
else
10761007
{
10771008
[self logInvalidAdFormat: adFormat];
@@ -1084,6 +1015,43 @@ - (void)didPayRevenueForAd:(MAAd *)ad
10841015
});
10851016
}
10861017

1018+
- (void)didReloadExpiredAd:(MAAd *)expiredAd withNewAd:(MAAd *)newAd;
1019+
{
1020+
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
1021+
1022+
NSString *name;
1023+
MAAdFormat *adFormat = newAd.format;
1024+
if ( MAAdFormat.interstitial == adFormat )
1025+
{
1026+
name = @"OnExpiredInterstitialAdReloadedEvent";
1027+
}
1028+
else if ( MAAdFormat.appOpen == adFormat )
1029+
{
1030+
name = @"OnExpiredAppOpenAdReloadedEvent";
1031+
}
1032+
else if ( MAAdFormat.rewarded == adFormat )
1033+
{
1034+
name = @"OnExpiredRewardedAdReloadedEvent ";
1035+
}
1036+
else
1037+
{
1038+
[self logInvalidAdFormat: adFormat];
1039+
return;
1040+
}
1041+
1042+
@synchronized ( self.adInfoDictLock )
1043+
{
1044+
self.adInfoDict[newAd.adUnitIdentifier] = newAd;
1045+
}
1046+
1047+
NSMutableDictionary<NSString *, NSObject *> *args = [NSMutableDictionary dictionary];
1048+
args[@"expiredAdInfo"] = [self adInfoForAd: expiredAd];
1049+
args[@"newAdInfo"] = [self adInfoForAd: newAd];
1050+
args[@"name"] = name;
1051+
[self forwardUnityEventWithArgs: args];
1052+
});
1053+
}
1054+
10871055
- (void)didGenerateCreativeIdentifier:(NSString *)creativeIdentifier forAd:(MAAd *)ad
10881056
{
10891057
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
@@ -1106,10 +1074,6 @@ - (void)didGenerateCreativeIdentifier:(NSString *)creativeIdentifier forAd:(MAAd
11061074
{
11071075
name = @"OnRewardedAdReviewCreativeIdGeneratedEvent";
11081076
}
1109-
else if ( MAAdFormat.rewardedInterstitial == adFormat )
1110-
{
1111-
name = @"OnRewardedInterstitialAdReviewCreativeIdGeneratedEvent";
1112-
}
11131077
else
11141078
{
11151079
[self logInvalidAdFormat: adFormat];
@@ -1577,6 +1541,7 @@ - (MAInterstitialAd *)retrieveInterstitialForAdUnitIdentifier:(NSString *)adUnit
15771541
result.delegate = self;
15781542
result.revenueDelegate = self;
15791543
result.adReviewDelegate = self;
1544+
result.expirationDelegate = self;
15801545

15811546
self.interstitials[adUnitIdentifier] = result;
15821547
}
@@ -1592,6 +1557,7 @@ - (MAAppOpenAd *)retrieveAppOpenAdForAdUnitIdentifier:(NSString *)adUnitIdentifi
15921557
result = [[MAAppOpenAd alloc] initWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
15931558
result.delegate = self;
15941559
result.revenueDelegate = self;
1560+
result.expirationDelegate = self;
15951561

15961562
self.appOpenAds[adUnitIdentifier] = result;
15971563
}
@@ -1608,29 +1574,14 @@ - (MARewardedAd *)retrieveRewardedAdForAdUnitIdentifier:(NSString *)adUnitIdenti
16081574
result.delegate = self;
16091575
result.revenueDelegate = self;
16101576
result.adReviewDelegate = self;
1577+
result.expirationDelegate = self;
16111578

16121579
self.rewardedAds[adUnitIdentifier] = result;
16131580
}
16141581

16151582
return result;
16161583
}
16171584

1618-
- (MARewardedInterstitialAd *)retrieveRewardedInterstitialAdForAdUnitIdentifier:(NSString *)adUnitIdentifier
1619-
{
1620-
MARewardedInterstitialAd *result = self.rewardedInterstitialAds[adUnitIdentifier];
1621-
if ( !result )
1622-
{
1623-
result = [[MARewardedInterstitialAd alloc] initWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
1624-
result.delegate = self;
1625-
result.revenueDelegate = self;
1626-
result.adReviewDelegate = self;
1627-
1628-
self.rewardedInterstitialAds[adUnitIdentifier] = result;
1629-
}
1630-
1631-
return result;
1632-
}
1633-
16341585
- (MAAdView *)retrieveAdViewForAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat
16351586
{
16361587
return [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: nil withOffset: CGPointZero];

0 commit comments

Comments
 (0)