react-native-applovin-max 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdView.java +7 -1
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewManager.java +24 -0
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXModule.java +377 -282
- package/ios/AppLovinMAX.h +1 -1
- package/ios/AppLovinMAX.m +305 -175
- package/ios/AppLovinMAX.xcworkspace/xcuserdata/thomasso.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/AppLovinMAXAdViewManager.m +35 -0
- package/ios/Podfile +1 -1
- package/ios/Podfile.lock +4 -4
- package/package.json +1 -1
- package/react-native-applovin-max.podspec +2 -2
- package/src/AppLovinMAXAdView.js +24 -0
- package/src/UserSegment.js +12 -0
- package/src/index.js +52 -1
package/android/build.gradle
CHANGED
|
@@ -41,8 +41,8 @@ android {
|
|
|
41
41
|
defaultConfig {
|
|
42
42
|
minSdkVersion 16
|
|
43
43
|
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
44
|
-
versionCode
|
|
45
|
-
versionName "3.
|
|
44
|
+
versionCode 3020000
|
|
45
|
+
versionName "3.2.0"
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
flavorDimensions("default")
|
|
@@ -150,5 +150,5 @@ dependencies {
|
|
|
150
150
|
|
|
151
151
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
152
152
|
|
|
153
|
-
implementation 'com.applovin:applovin-sdk:11.3
|
|
153
|
+
implementation 'com.applovin:applovin-sdk:11.4.3'
|
|
154
154
|
}
|
|
@@ -74,7 +74,7 @@ class AppLovinMAXAdView
|
|
|
74
74
|
return adView;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
public void maybeAttachAdView(final String placement, final String adaptiveBannerEnabledStr, final String adUnitId, final MaxAdFormat adFormat)
|
|
77
|
+
public void maybeAttachAdView(final String placement, final String customData, final String adaptiveBannerEnabledStr, final String adUnitId, final MaxAdFormat adFormat)
|
|
78
78
|
{
|
|
79
79
|
final Activity currentActivity = reactContext.getCurrentActivity();
|
|
80
80
|
if ( currentActivity == null )
|
|
@@ -94,12 +94,18 @@ class AppLovinMAXAdView
|
|
|
94
94
|
{
|
|
95
95
|
adView = new MaxAdView( adUnitId, adFormat, AppLovinMAXModule.getInstance().getSdk(), currentActivity );
|
|
96
96
|
adView.setListener( AppLovinMAXModule.getInstance() );
|
|
97
|
+
adView.setRevenueListener( AppLovinMAXModule.getInstance() );
|
|
97
98
|
|
|
98
99
|
if ( placement != null )
|
|
99
100
|
{
|
|
100
101
|
adView.setPlacement( placement );
|
|
101
102
|
}
|
|
102
103
|
|
|
104
|
+
if ( customData != null )
|
|
105
|
+
{
|
|
106
|
+
adView.setCustomData( customData );
|
|
107
|
+
}
|
|
108
|
+
|
|
103
109
|
if ( adaptiveBannerEnabledStr != null )
|
|
104
110
|
{
|
|
105
111
|
adView.setExtraParameter( "adaptive_banner", adaptiveBannerEnabledStr );
|
|
@@ -31,6 +31,7 @@ class AppLovinMAXAdViewManager
|
|
|
31
31
|
|
|
32
32
|
// Storage for placement and extra parameters if set before the MAAdView is created
|
|
33
33
|
private final Map<AppLovinMAXAdView, String> placementRegistry = new HashMap<>();
|
|
34
|
+
private final Map<AppLovinMAXAdView, String> customDataRegistry = new HashMap<>();
|
|
34
35
|
private final Map<AppLovinMAXAdView, String> adaptiveBannerEnabledRegistry = new HashMap<>();
|
|
35
36
|
|
|
36
37
|
public AppLovinMAXAdViewManager(final ReactApplicationContext reactApplicationContext)
|
|
@@ -67,6 +68,10 @@ class AppLovinMAXAdViewManager
|
|
|
67
68
|
{
|
|
68
69
|
setAdaptiveBannerEnabled( view, arg );
|
|
69
70
|
}
|
|
71
|
+
else if ( "setCustomData".equals( commandId ) )
|
|
72
|
+
{
|
|
73
|
+
setCustomData( view, arg );
|
|
74
|
+
}
|
|
70
75
|
else if ( "setAdUnitId".equals( commandId ) )
|
|
71
76
|
{
|
|
72
77
|
setAdUnitId( view, arg );
|
|
@@ -98,6 +103,23 @@ class AppLovinMAXAdViewManager
|
|
|
98
103
|
} );
|
|
99
104
|
}
|
|
100
105
|
|
|
106
|
+
public void setCustomData(final AppLovinMAXAdView view, final String customData)
|
|
107
|
+
{
|
|
108
|
+
// Post to main thread to avoid race condition with actual creation of MaxAdView in maybeAttachAdView()
|
|
109
|
+
view.post( () -> {
|
|
110
|
+
|
|
111
|
+
MaxAdView adView = view.getAdView();
|
|
112
|
+
if ( adView != null )
|
|
113
|
+
{
|
|
114
|
+
adView.setCustomData( customData );
|
|
115
|
+
}
|
|
116
|
+
else
|
|
117
|
+
{
|
|
118
|
+
customDataRegistry.put( view, customData );
|
|
119
|
+
}
|
|
120
|
+
} );
|
|
121
|
+
}
|
|
122
|
+
|
|
101
123
|
public void setAdaptiveBannerEnabled(final AppLovinMAXAdView view, final String enabledStr)
|
|
102
124
|
{
|
|
103
125
|
// Post to main thread to avoid race condition with actual creation of MaxAdView in maybeAttachAdView()
|
|
@@ -138,9 +160,11 @@ class AppLovinMAXAdViewManager
|
|
|
138
160
|
private void maybeAttachAdView(final AppLovinMAXAdView view)
|
|
139
161
|
{
|
|
140
162
|
String placement = placementRegistry.remove( view );
|
|
163
|
+
String customData = customDataRegistry.remove( view );
|
|
141
164
|
String adaptiveBannerEnabledStr = adaptiveBannerEnabledRegistry.remove( view );
|
|
142
165
|
|
|
143
166
|
view.maybeAttachAdView( placement,
|
|
167
|
+
customData,
|
|
144
168
|
adaptiveBannerEnabledStr,
|
|
145
169
|
adUnitIdRegistry.get( view ),
|
|
146
170
|
adFormatRegistry.get( view ) );
|