react-native-applovin-max 7.0.1 → 7.1.1
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/AppLovinMAXAdEvents.java +67 -0
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdView.java +10 -6
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewManager.java +7 -7
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewUiComponent.java +9 -13
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXModule.java +142 -626
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXNativeAdView.java +6 -6
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXNativeAdViewManager.java +4 -4
- package/ios/AppLovinMAX.m +83 -478
- package/ios/AppLovinMAXAdView.h +12 -3
- package/ios/AppLovinMAXAdView.m +17 -13
- package/ios/AppLovinMAXAdViewManager.m +1 -1
- package/ios/AppLovinMAXAdViewUIComponent.h +7 -6
- package/ios/AppLovinMAXAdViewUIComponent.m +10 -15
- package/ios/AppLovinMAXNativeAdView.m +2 -2
- package/lib/commonjs/AppLovinMAX.js +19 -3
- package/lib/commonjs/AppLovinMAX.js.map +1 -1
- package/lib/commonjs/index.js +0 -22
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/AppLovinMAX.js +19 -3
- package/lib/module/AppLovinMAX.js.map +1 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/AppLovinMAX.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/AdProps.d.ts +6 -6
- package/lib/typescript/src/types/AppLovinMAX.d.ts +18 -6
- package/lib/typescript/src/types/AppLovinMAX.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-applovin-max.podspec +2 -2
- package/src/AppLovinMAX.ts +24 -3
- package/src/index.ts +0 -1
- package/src/types/AdProps.ts +6 -6
- package/src/types/AppLovinMAX.ts +20 -7
- package/lib/commonjs/TargetingData.js +0 -179
- package/lib/commonjs/TargetingData.js.map +0 -1
- package/lib/commonjs/types/TargetingData.js +0 -6
- package/lib/commonjs/types/TargetingData.js.map +0 -1
- package/lib/module/TargetingData.js +0 -175
- package/lib/module/TargetingData.js.map +0 -1
- package/lib/module/types/TargetingData.js +0 -2
- package/lib/module/types/TargetingData.js.map +0 -1
- package/lib/typescript/src/TargetingData.d.ts +0 -26
- package/lib/typescript/src/TargetingData.d.ts.map +0 -1
- package/lib/typescript/src/types/TargetingData.d.ts +0 -43
- package/lib/typescript/src/types/TargetingData.d.ts.map +0 -1
- package/src/TargetingData.ts +0 -212
- package/src/types/TargetingData.ts +0 -50
package/android/build.gradle
CHANGED
|
@@ -53,8 +53,8 @@ android {
|
|
|
53
53
|
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
54
54
|
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
55
55
|
|
|
56
|
-
buildConfigField("int", "VERSION_CODE", "
|
|
57
|
-
buildConfigField("String", "VERSION_NAME", "\"7.
|
|
56
|
+
buildConfigField("int", "VERSION_CODE", "7010100")
|
|
57
|
+
buildConfigField("String", "VERSION_NAME", "\"7.1.1\"")
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
buildTypes {
|
|
@@ -85,6 +85,6 @@ dependencies {
|
|
|
85
85
|
//noinspection GradleDynamicVersion
|
|
86
86
|
implementation "com.facebook.react:react-native:0.73.6"
|
|
87
87
|
|
|
88
|
-
implementation "com.applovin:applovin-sdk:12.
|
|
88
|
+
implementation "com.applovin:applovin-sdk:12.6.1"
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
package com.applovin.reactnative;
|
|
2
|
+
|
|
3
|
+
public class AppLovinMAXAdEvents
|
|
4
|
+
{
|
|
5
|
+
// Banner Events
|
|
6
|
+
public static final String ON_BANNER_AD_LOADED_EVENT = "OnBannerAdLoadedEvent";
|
|
7
|
+
public static final String ON_BANNER_AD_LOAD_FAILED_EVENT = "OnBannerAdLoadFailedEvent";
|
|
8
|
+
public static final String ON_BANNER_AD_CLICKED_EVENT = "OnBannerAdClickedEvent";
|
|
9
|
+
public static final String ON_BANNER_AD_EXPANDED_EVENT = "OnBannerAdExpandedEvent";
|
|
10
|
+
public static final String ON_BANNER_AD_COLLAPSED_EVENT = "OnBannerAdCollapsedEvent";
|
|
11
|
+
public static final String ON_BANNER_AD_REVENUE_PAID = "OnBannerAdRevenuePaid";
|
|
12
|
+
|
|
13
|
+
// MREC Events
|
|
14
|
+
public static final String ON_MREC_AD_LOADED_EVENT = "OnMRecAdLoadedEvent";
|
|
15
|
+
public static final String ON_MREC_AD_LOAD_FAILED_EVENT = "OnMRecAdLoadFailedEvent";
|
|
16
|
+
public static final String ON_MREC_AD_CLICKED_EVENT = "OnMRecAdClickedEvent";
|
|
17
|
+
public static final String ON_MREC_AD_EXPANDED_EVENT = "OnMRecAdExpandedEvent";
|
|
18
|
+
public static final String ON_MREC_AD_COLLAPSED_EVENT = "OnMRecAdCollapsedEvent";
|
|
19
|
+
public static final String ON_MREC_AD_REVENUE_PAID = "OnMRecAdRevenuePaid";
|
|
20
|
+
|
|
21
|
+
// Interstitial Events
|
|
22
|
+
public static final String ON_INTERSTITIAL_LOADED_EVENT = "OnInterstitialLoadedEvent";
|
|
23
|
+
public static final String ON_INTERSTITIAL_LOAD_FAILED_EVENT = "OnInterstitialLoadFailedEvent";
|
|
24
|
+
public static final String ON_INTERSTITIAL_CLICKED_EVENT = "OnInterstitialClickedEvent";
|
|
25
|
+
public static final String ON_INTERSTITIAL_DISPLAYED_EVENT = "OnInterstitialDisplayedEvent";
|
|
26
|
+
public static final String ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT = "OnInterstitialAdFailedToDisplayEvent";
|
|
27
|
+
public static final String ON_INTERSTITIAL_HIDDEN_EVENT = "OnInterstitialHiddenEvent";
|
|
28
|
+
public static final String ON_INTERSTITIAL_AD_REVENUE_PAID = "OnInterstitialAdRevenuePaid";
|
|
29
|
+
|
|
30
|
+
// Rewarded Events
|
|
31
|
+
public static final String ON_REWARDED_AD_LOADED_EVENT = "OnRewardedAdLoadedEvent";
|
|
32
|
+
public static final String ON_REWARDED_AD_LOAD_FAILED_EVENT = "OnRewardedAdLoadFailedEvent";
|
|
33
|
+
public static final String ON_REWARDED_AD_CLICKED_EVENT = "OnRewardedAdClickedEvent";
|
|
34
|
+
public static final String ON_REWARDED_AD_DISPLAYED_EVENT = "OnRewardedAdDisplayedEvent";
|
|
35
|
+
public static final String ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT = "OnRewardedAdFailedToDisplayEvent";
|
|
36
|
+
public static final String ON_REWARDED_AD_HIDDEN_EVENT = "OnRewardedAdHiddenEvent";
|
|
37
|
+
public static final String ON_REWARDED_AD_RECEIVED_REWARD_EVENT = "OnRewardedAdReceivedRewardEvent";
|
|
38
|
+
public static final String ON_REWARDED_AD_REVENUE_PAID = "OnRewardedAdRevenuePaid";
|
|
39
|
+
|
|
40
|
+
// AppOpen Events
|
|
41
|
+
public static final String ON_APPOPEN_AD_LOADED_EVENT = "OnAppOpenAdLoadedEvent";
|
|
42
|
+
public static final String ON_APPOPEN_AD_LOAD_FAILED_EVENT = "OnAppOpenAdLoadFailedEvent";
|
|
43
|
+
public static final String ON_APPOPEN_AD_CLICKED_EVENT = "OnAppOpenAdClickedEvent";
|
|
44
|
+
public static final String ON_APPOPEN_AD_DISPLAYED_EVENT = "OnAppOpenAdDisplayedEvent";
|
|
45
|
+
public static final String ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT = "OnAppOpenAdFailedToDisplayEvent";
|
|
46
|
+
public static final String ON_APPOPEN_AD_HIDDEN_EVENT = "OnAppOpenAdHiddenEvent";
|
|
47
|
+
public static final String ON_APPOPEN_AD_REVENUE_PAID = "OnAppOpenAdRevenuePaid";
|
|
48
|
+
|
|
49
|
+
// Native UI Component Events
|
|
50
|
+
public static final String ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT = "OnNativeUIComponentAdViewAdLoadedEvent";
|
|
51
|
+
public static final String ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT = "OnNativeUIComponentAdViewAdLoadFailedEvent";
|
|
52
|
+
|
|
53
|
+
// MaxAdListener
|
|
54
|
+
public static final String ON_AD_LOADED_EVENT = "onAdLoadedEvent";
|
|
55
|
+
public static final String ON_AD_DISPLAYED_EVENT = "onAdDisplayedEvent";
|
|
56
|
+
public static final String ON_AD_HIDDEN_EVENT = "onAdHiddenEvent";
|
|
57
|
+
public static final String ON_AD_CLICKED_EVENT = "onAdClickedEvent";
|
|
58
|
+
public static final String ON_AD_LOAD_FAILED_EVENT = "onAdLoadFailedEvent";
|
|
59
|
+
public static final String ON_AD_DISPLAY_FAILED_EVENT = "onAdDisplayFailedEvent";
|
|
60
|
+
|
|
61
|
+
// MaxAdViewAdListener
|
|
62
|
+
public static final String ON_AD_EXPANDED_EVENT = "onAdExpandedEvent";
|
|
63
|
+
public static final String ON_AD_COLLAPSED_EVENT = "onAdCollapsedEvent";
|
|
64
|
+
|
|
65
|
+
// MaxAdRevenueListener
|
|
66
|
+
public static final String ON_AD_REVENUE_PAID_EVENT = "onAdRevenuePaidEvent";
|
|
67
|
+
}
|
|
@@ -50,7 +50,14 @@ class AppLovinMAXAdView
|
|
|
50
50
|
return ( uiComponent != null ) ? uiComponent.getAdView() : null;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
public static void preloadNativeUIComponentAdView(final String adUnitId,
|
|
53
|
+
public static void preloadNativeUIComponentAdView(final String adUnitId,
|
|
54
|
+
final MaxAdFormat adFormat,
|
|
55
|
+
@Nullable final String placement,
|
|
56
|
+
@Nullable final String customData,
|
|
57
|
+
@Nullable final Map<String, Object> extraParameters,
|
|
58
|
+
@Nullable final Map<String, Object> localExtraParameters,
|
|
59
|
+
final Promise promise,
|
|
60
|
+
final ReactContext context)
|
|
54
61
|
{
|
|
55
62
|
AppLovinMAXAdViewUiComponent preloadedUiComponent = preloadedUiComponentInstances.get( adUnitId );
|
|
56
63
|
if ( preloadedUiComponent != null )
|
|
@@ -278,6 +285,7 @@ class AppLovinMAXAdView
|
|
|
278
285
|
// same adUnitId
|
|
279
286
|
if ( !uiComponent.hasContainerView() )
|
|
280
287
|
{
|
|
288
|
+
uiComponent.setAdaptiveBannerEnabled( adaptiveBannerEnabled );
|
|
281
289
|
uiComponent.setAutoRefresh( autoRefresh );
|
|
282
290
|
uiComponent.attachAdView( AppLovinMAXAdView.this );
|
|
283
291
|
return;
|
|
@@ -324,11 +332,7 @@ class AppLovinMAXAdView
|
|
|
324
332
|
|
|
325
333
|
AppLovinMAXAdViewUiComponent preloadedUiComponent = preloadedUiComponentInstances.get( adUnitId );
|
|
326
334
|
|
|
327
|
-
if ( uiComponent
|
|
328
|
-
{
|
|
329
|
-
uiComponent.setAutoRefresh( false );
|
|
330
|
-
}
|
|
331
|
-
else
|
|
335
|
+
if ( uiComponent != preloadedUiComponent )
|
|
332
336
|
{
|
|
333
337
|
uiComponentInstances.remove( adUnitId );
|
|
334
338
|
uiComponent.destroy();
|
|
@@ -35,13 +35,13 @@ class AppLovinMAXAdViewManager
|
|
|
35
35
|
{
|
|
36
36
|
// mapping Android events to JavaScript events
|
|
37
37
|
return MapBuilder.<String, Object>builder()
|
|
38
|
-
.put(
|
|
39
|
-
.put(
|
|
40
|
-
.put(
|
|
41
|
-
.put(
|
|
42
|
-
.put(
|
|
43
|
-
.put(
|
|
44
|
-
.put(
|
|
38
|
+
.put( AppLovinMAXAdEvents.ON_AD_LOADED_EVENT, MapBuilder.of( "registrationName", AppLovinMAXAdEvents.ON_AD_LOADED_EVENT ) )
|
|
39
|
+
.put( AppLovinMAXAdEvents.ON_AD_LOAD_FAILED_EVENT, MapBuilder.of( "registrationName", AppLovinMAXAdEvents.ON_AD_LOAD_FAILED_EVENT ) )
|
|
40
|
+
.put( AppLovinMAXAdEvents.ON_AD_DISPLAY_FAILED_EVENT, MapBuilder.of( "registrationName", AppLovinMAXAdEvents.ON_AD_DISPLAY_FAILED_EVENT ) )
|
|
41
|
+
.put( AppLovinMAXAdEvents.ON_AD_CLICKED_EVENT, MapBuilder.of( "registrationName", AppLovinMAXAdEvents.ON_AD_CLICKED_EVENT ) )
|
|
42
|
+
.put( AppLovinMAXAdEvents.ON_AD_EXPANDED_EVENT, MapBuilder.of( "registrationName", AppLovinMAXAdEvents.ON_AD_EXPANDED_EVENT ) )
|
|
43
|
+
.put( AppLovinMAXAdEvents.ON_AD_COLLAPSED_EVENT, MapBuilder.of( "registrationName", AppLovinMAXAdEvents.ON_AD_COLLAPSED_EVENT ) )
|
|
44
|
+
.put( AppLovinMAXAdEvents.ON_AD_REVENUE_PAID_EVENT, MapBuilder.of( "registrationName", AppLovinMAXAdEvents.ON_AD_REVENUE_PAID_EVENT ) )
|
|
45
45
|
.build();
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -146,15 +146,11 @@ class AppLovinMAXAdViewUiComponent
|
|
|
146
146
|
WritableMap adInfo = AppLovinMAXModule.getInstance().getAdInfo( ad );
|
|
147
147
|
|
|
148
148
|
// Copy the `adInfo` since sending the same map through the RN bridge more than once will result in `com.facebook.react.bridge.ObjectAlreadyConsumedException: Map already consumed`
|
|
149
|
-
AppLovinMAXModule.getInstance().sendReactNativeEvent(
|
|
149
|
+
AppLovinMAXModule.getInstance().sendReactNativeEvent( AppLovinMAXAdEvents.ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT, adInfo.copy() );
|
|
150
150
|
|
|
151
151
|
if ( containerView != null )
|
|
152
152
|
{
|
|
153
|
-
sendReactNativeCallbackEvent(
|
|
154
|
-
}
|
|
155
|
-
else
|
|
156
|
-
{
|
|
157
|
-
setAutoRefresh( false );
|
|
153
|
+
sendReactNativeCallbackEvent( AppLovinMAXAdEvents.ON_AD_LOADED_EVENT, adInfo );
|
|
158
154
|
}
|
|
159
155
|
}
|
|
160
156
|
|
|
@@ -164,11 +160,11 @@ class AppLovinMAXAdViewUiComponent
|
|
|
164
160
|
WritableMap adLoadFailedInfo = AppLovinMAXModule.getInstance().getAdLoadFailedInfo( adUnitId, error );
|
|
165
161
|
|
|
166
162
|
// Copy the `adLoadFailedInfo` since sending the same map through the RN bridge more than once will result in `com.facebook.react.bridge.ObjectAlreadyConsumedException: Map already consumed`
|
|
167
|
-
AppLovinMAXModule.getInstance().sendReactNativeEvent(
|
|
163
|
+
AppLovinMAXModule.getInstance().sendReactNativeEvent( AppLovinMAXAdEvents.ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT, adLoadFailedInfo.copy() );
|
|
168
164
|
|
|
169
165
|
if ( containerView != null )
|
|
170
166
|
{
|
|
171
|
-
sendReactNativeCallbackEvent(
|
|
167
|
+
sendReactNativeCallbackEvent( AppLovinMAXAdEvents.ON_AD_LOAD_FAILED_EVENT, adLoadFailedInfo );
|
|
172
168
|
}
|
|
173
169
|
}
|
|
174
170
|
|
|
@@ -178,7 +174,7 @@ class AppLovinMAXAdViewUiComponent
|
|
|
178
174
|
if ( containerView != null )
|
|
179
175
|
{
|
|
180
176
|
WritableMap adDisplayFailedInfo = AppLovinMAXModule.getInstance().getAdDisplayFailedInfo( ad, error );
|
|
181
|
-
sendReactNativeCallbackEvent(
|
|
177
|
+
sendReactNativeCallbackEvent( AppLovinMAXAdEvents.ON_AD_DISPLAY_FAILED_EVENT, adDisplayFailedInfo );
|
|
182
178
|
}
|
|
183
179
|
}
|
|
184
180
|
|
|
@@ -188,7 +184,7 @@ class AppLovinMAXAdViewUiComponent
|
|
|
188
184
|
if ( containerView != null )
|
|
189
185
|
{
|
|
190
186
|
WritableMap adInfo = AppLovinMAXModule.getInstance().getAdInfo( ad );
|
|
191
|
-
sendReactNativeCallbackEvent(
|
|
187
|
+
sendReactNativeCallbackEvent( AppLovinMAXAdEvents.ON_AD_CLICKED_EVENT, adInfo );
|
|
192
188
|
}
|
|
193
189
|
}
|
|
194
190
|
|
|
@@ -198,7 +194,7 @@ class AppLovinMAXAdViewUiComponent
|
|
|
198
194
|
if ( containerView != null )
|
|
199
195
|
{
|
|
200
196
|
WritableMap adInfo = AppLovinMAXModule.getInstance().getAdInfo( ad );
|
|
201
|
-
sendReactNativeCallbackEvent(
|
|
197
|
+
sendReactNativeCallbackEvent( AppLovinMAXAdEvents.ON_AD_EXPANDED_EVENT, adInfo );
|
|
202
198
|
}
|
|
203
199
|
}
|
|
204
200
|
|
|
@@ -208,7 +204,7 @@ class AppLovinMAXAdViewUiComponent
|
|
|
208
204
|
if ( containerView != null )
|
|
209
205
|
{
|
|
210
206
|
WritableMap adInfo = AppLovinMAXModule.getInstance().getAdInfo( ad );
|
|
211
|
-
sendReactNativeCallbackEvent(
|
|
207
|
+
sendReactNativeCallbackEvent( AppLovinMAXAdEvents.ON_AD_COLLAPSED_EVENT, adInfo );
|
|
212
208
|
}
|
|
213
209
|
}
|
|
214
210
|
|
|
@@ -218,7 +214,7 @@ class AppLovinMAXAdViewUiComponent
|
|
|
218
214
|
if ( containerView != null )
|
|
219
215
|
{
|
|
220
216
|
WritableMap adRevenueInfo = AppLovinMAXModule.getInstance().getAdRevenueInfo( ad );
|
|
221
|
-
sendReactNativeCallbackEvent(
|
|
217
|
+
sendReactNativeCallbackEvent( AppLovinMAXAdEvents.ON_AD_REVENUE_PAID_EVENT, adRevenueInfo );
|
|
222
218
|
}
|
|
223
219
|
}
|
|
224
220
|
|