react-native-applovin-max 7.1.0 → 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 +86 -121
- 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 +29 -11
- 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 +1 -1
- package/lib/module/AppLovinMAX.js +1 -1
- package/lib/typescript/src/types/AdProps.d.ts +6 -6
- package/package.json +1 -1
- package/react-native-applovin-max.podspec +2 -2
- package/src/AppLovinMAX.ts +1 -1
- package/src/types/AdProps.ts +6 -6
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.1.
|
|
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.6.
|
|
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
|
|
|
@@ -82,48 +82,6 @@ public class AppLovinMAXModule
|
|
|
82
82
|
private static final String USER_GEOGRAPHY_OTHER = "O";
|
|
83
83
|
private static final String USER_GEOGRAPHY_UNKNOWN = "U";
|
|
84
84
|
|
|
85
|
-
private static final String ON_BANNER_AD_LOADED_EVENT = "OnBannerAdLoadedEvent";
|
|
86
|
-
private static final String ON_BANNER_AD_LOAD_FAILED_EVENT = "OnBannerAdLoadFailedEvent";
|
|
87
|
-
private static final String ON_BANNER_AD_CLICKED_EVENT = "OnBannerAdClickedEvent";
|
|
88
|
-
private static final String ON_BANNER_AD_COLLAPSED_EVENT = "OnBannerAdCollapsedEvent";
|
|
89
|
-
private static final String ON_BANNER_AD_EXPANDED_EVENT = "OnBannerAdExpandedEvent";
|
|
90
|
-
private static final String ON_BANNER_AD_REVENUE_PAID = "OnBannerAdRevenuePaid";
|
|
91
|
-
|
|
92
|
-
private static final String ON_MREC_AD_LOADED_EVENT = "OnMRecAdLoadedEvent";
|
|
93
|
-
private static final String ON_MREC_AD_LOAD_FAILED_EVENT = "OnMRecAdLoadFailedEvent";
|
|
94
|
-
private static final String ON_MREC_AD_CLICKED_EVENT = "OnMRecAdClickedEvent";
|
|
95
|
-
private static final String ON_MREC_AD_COLLAPSED_EVENT = "OnMRecAdCollapsedEvent";
|
|
96
|
-
private static final String ON_MREC_AD_EXPANDED_EVENT = "OnMRecAdExpandedEvent";
|
|
97
|
-
private static final String ON_MREC_AD_REVENUE_PAID = "OnMRecAdRevenuePaid";
|
|
98
|
-
|
|
99
|
-
private static final String ON_INTERSTITIAL_LOADED_EVENT = "OnInterstitialLoadedEvent";
|
|
100
|
-
private static final String ON_INTERSTITIAL_LOAD_FAILED_EVENT = "OnInterstitialLoadFailedEvent";
|
|
101
|
-
private static final String ON_INTERSTITIAL_CLICKED_EVENT = "OnInterstitialClickedEvent";
|
|
102
|
-
private static final String ON_INTERSTITIAL_DISPLAYED_EVENT = "OnInterstitialDisplayedEvent";
|
|
103
|
-
private static final String ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT = "OnInterstitialAdFailedToDisplayEvent";
|
|
104
|
-
private static final String ON_INTERSTITIAL_HIDDEN_EVENT = "OnInterstitialHiddenEvent";
|
|
105
|
-
private static final String ON_INTERSTITIAL_AD_REVENUE_PAID = "OnInterstitialAdRevenuePaid";
|
|
106
|
-
|
|
107
|
-
private static final String ON_REWARDED_AD_LOADED_EVENT = "OnRewardedAdLoadedEvent";
|
|
108
|
-
private static final String ON_REWARDED_AD_LOAD_FAILED_EVENT = "OnRewardedAdLoadFailedEvent";
|
|
109
|
-
private static final String ON_REWARDED_AD_CLICKED_EVENT = "OnRewardedAdClickedEvent";
|
|
110
|
-
private static final String ON_REWARDED_AD_DISPLAYED_EVENT = "OnRewardedAdDisplayedEvent";
|
|
111
|
-
private static final String ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT = "OnRewardedAdFailedToDisplayEvent";
|
|
112
|
-
private static final String ON_REWARDED_AD_HIDDEN_EVENT = "OnRewardedAdHiddenEvent";
|
|
113
|
-
private static final String ON_REWARDED_AD_RECEIVED_REWARD_EVENT = "OnRewardedAdReceivedRewardEvent";
|
|
114
|
-
private static final String ON_REWARDED_AD_REVENUE_PAID = "OnRewardedAdRevenuePaid";
|
|
115
|
-
|
|
116
|
-
private static final String ON_APPOPEN_AD_LOADED_EVENT = "OnAppOpenAdLoadedEvent";
|
|
117
|
-
private static final String ON_APPOPEN_AD_LOAD_FAILED_EVENT = "OnAppOpenAdLoadFailedEvent";
|
|
118
|
-
private static final String ON_APPOPEN_AD_CLICKED_EVENT = "OnAppOpenAdClickedEvent";
|
|
119
|
-
private static final String ON_APPOPEN_AD_DISPLAYED_EVENT = "OnAppOpenAdDisplayedEvent";
|
|
120
|
-
private static final String ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT = "OnAppOpenAdFailedToDisplayEvent";
|
|
121
|
-
private static final String ON_APPOPEN_AD_HIDDEN_EVENT = "OnAppOpenAdHiddenEvent";
|
|
122
|
-
private static final String ON_APPOPEN_AD_REVENUE_PAID = "OnAppOpenAdRevenuePaid";
|
|
123
|
-
|
|
124
|
-
private static final String ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT = "OnNativeUIComponentAdViewAdLoadedEvent";
|
|
125
|
-
private static final String ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT = "OnNativeUIComponentAdViewAdLoadFailedEvent";
|
|
126
|
-
|
|
127
85
|
private static final String TOP_CENTER = "top_center";
|
|
128
86
|
private static final String TOP_LEFT = "top_left";
|
|
129
87
|
private static final String TOP_RIGHT = "top_right";
|
|
@@ -150,9 +108,9 @@ public class AppLovinMAXModule
|
|
|
150
108
|
private int lastRotation;
|
|
151
109
|
|
|
152
110
|
// Store these values if pub attempts to set it before initializing
|
|
153
|
-
private
|
|
154
|
-
private
|
|
155
|
-
private MaxSegmentCollection.Builder segmentCollectionBuilder = MaxSegmentCollection.builder();
|
|
111
|
+
private List<String> initializationAdUnitIdsToSet;
|
|
112
|
+
private List<String> testDeviceAdvertisingIdsToSet;
|
|
113
|
+
private final MaxSegmentCollection.Builder segmentCollectionBuilder = MaxSegmentCollection.builder();
|
|
156
114
|
|
|
157
115
|
// Fullscreen Ad Fields
|
|
158
116
|
private final Map<String, MaxInterstitialAd> interstitials = new HashMap<>( 2 );
|
|
@@ -902,7 +860,7 @@ public class AppLovinMAXModule
|
|
|
902
860
|
MaxInterstitialAd interstitial = retrieveInterstitial( adUnitId, "loadInterstitial" );
|
|
903
861
|
if ( interstitial == null )
|
|
904
862
|
{
|
|
905
|
-
sendReactNativeEventForAdLoadFailed( ON_INTERSTITIAL_LOAD_FAILED_EVENT, adUnitId, null );
|
|
863
|
+
sendReactNativeEventForAdLoadFailed( AppLovinMAXAdEvents.ON_INTERSTITIAL_LOAD_FAILED_EVENT, adUnitId, null );
|
|
906
864
|
return;
|
|
907
865
|
}
|
|
908
866
|
|
|
@@ -941,7 +899,7 @@ public class AppLovinMAXModule
|
|
|
941
899
|
MaxInterstitialAd interstitial = retrieveInterstitial( adUnitId, "showInterstitial" );
|
|
942
900
|
if ( interstitial == null )
|
|
943
901
|
{
|
|
944
|
-
sendReactNativeEvent( ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT, getAdUnitInfo( adUnitId ) );
|
|
902
|
+
sendReactNativeEvent( AppLovinMAXAdEvents.ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT, getAdUnitInfo( adUnitId ) );
|
|
945
903
|
return;
|
|
946
904
|
}
|
|
947
905
|
|
|
@@ -993,7 +951,7 @@ public class AppLovinMAXModule
|
|
|
993
951
|
MaxRewardedAd rewardedAd = retrieveRewardedAd( adUnitId, "loadRewardedAd" );
|
|
994
952
|
if ( rewardedAd == null )
|
|
995
953
|
{
|
|
996
|
-
sendReactNativeEventForAdLoadFailed( ON_REWARDED_AD_LOAD_FAILED_EVENT, adUnitId, null );
|
|
954
|
+
sendReactNativeEventForAdLoadFailed( AppLovinMAXAdEvents.ON_REWARDED_AD_LOAD_FAILED_EVENT, adUnitId, null );
|
|
997
955
|
return;
|
|
998
956
|
}
|
|
999
957
|
|
|
@@ -1032,7 +990,7 @@ public class AppLovinMAXModule
|
|
|
1032
990
|
MaxRewardedAd rewardedAd = retrieveRewardedAd( adUnitId, "showRewardedAd" );
|
|
1033
991
|
if ( rewardedAd == null )
|
|
1034
992
|
{
|
|
1035
|
-
sendReactNativeEvent( ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT, getAdUnitInfo( adUnitId ) );
|
|
993
|
+
sendReactNativeEvent( AppLovinMAXAdEvents.ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT, getAdUnitInfo( adUnitId ) );
|
|
1036
994
|
return;
|
|
1037
995
|
}
|
|
1038
996
|
|
|
@@ -1158,7 +1116,14 @@ public class AppLovinMAXModule
|
|
|
1158
1116
|
final Map<String, Object> extraParameters = ( extraParameterMap != null ) ? extraParameterMap.toHashMap() : null;
|
|
1159
1117
|
final Map<String, Object> localExtraParameters = ( localExtraParameterMap != null ) ? localExtraParameterMap.toHashMap() : null;
|
|
1160
1118
|
|
|
1161
|
-
getReactApplicationContext().runOnUiQueueThread( () -> AppLovinMAXAdView.preloadNativeUIComponentAdView( adUnitId,
|
|
1119
|
+
getReactApplicationContext().runOnUiQueueThread( () -> AppLovinMAXAdView.preloadNativeUIComponentAdView( adUnitId,
|
|
1120
|
+
finalAdFormat,
|
|
1121
|
+
placement,
|
|
1122
|
+
customData,
|
|
1123
|
+
extraParameters,
|
|
1124
|
+
localExtraParameters,
|
|
1125
|
+
promise,
|
|
1126
|
+
getReactApplicationContext() ) );
|
|
1162
1127
|
}
|
|
1163
1128
|
|
|
1164
1129
|
@ReactMethod
|
|
@@ -1176,7 +1141,7 @@ public class AppLovinMAXModule
|
|
|
1176
1141
|
MaxAdFormat adFormat = ad.getFormat();
|
|
1177
1142
|
if ( adFormat.isAdViewAd() )
|
|
1178
1143
|
{
|
|
1179
|
-
name = ( MaxAdFormat.MREC == adFormat ) ? ON_MREC_AD_LOADED_EVENT : ON_BANNER_AD_LOADED_EVENT;
|
|
1144
|
+
name = ( MaxAdFormat.MREC == adFormat ) ? AppLovinMAXAdEvents.ON_MREC_AD_LOADED_EVENT : AppLovinMAXAdEvents.ON_BANNER_AD_LOADED_EVENT;
|
|
1180
1145
|
|
|
1181
1146
|
String adViewPosition = adViewPositions.get( ad.getAdUnitId() );
|
|
1182
1147
|
if ( AppLovinSdkUtils.isValidString( adViewPosition ) )
|
|
@@ -1195,15 +1160,15 @@ public class AppLovinMAXModule
|
|
|
1195
1160
|
}
|
|
1196
1161
|
else if ( MaxAdFormat.INTERSTITIAL == adFormat )
|
|
1197
1162
|
{
|
|
1198
|
-
name = ON_INTERSTITIAL_LOADED_EVENT;
|
|
1163
|
+
name = AppLovinMAXAdEvents.ON_INTERSTITIAL_LOADED_EVENT;
|
|
1199
1164
|
}
|
|
1200
1165
|
else if ( MaxAdFormat.REWARDED == adFormat )
|
|
1201
1166
|
{
|
|
1202
|
-
name = ON_REWARDED_AD_LOADED_EVENT;
|
|
1167
|
+
name = AppLovinMAXAdEvents.ON_REWARDED_AD_LOADED_EVENT;
|
|
1203
1168
|
}
|
|
1204
1169
|
else if ( MaxAdFormat.APP_OPEN == adFormat )
|
|
1205
1170
|
{
|
|
1206
|
-
name = ON_APPOPEN_AD_LOADED_EVENT;
|
|
1171
|
+
name = AppLovinMAXAdEvents.ON_APPOPEN_AD_LOADED_EVENT;
|
|
1207
1172
|
}
|
|
1208
1173
|
else
|
|
1209
1174
|
{
|
|
@@ -1226,19 +1191,19 @@ public class AppLovinMAXModule
|
|
|
1226
1191
|
String name;
|
|
1227
1192
|
if ( adViews.containsKey( adUnitId ) )
|
|
1228
1193
|
{
|
|
1229
|
-
name = ( MaxAdFormat.MREC == adViewAdFormats.get( adUnitId ) ) ? ON_MREC_AD_LOAD_FAILED_EVENT : ON_BANNER_AD_LOAD_FAILED_EVENT;
|
|
1194
|
+
name = ( MaxAdFormat.MREC == adViewAdFormats.get( adUnitId ) ) ? AppLovinMAXAdEvents.ON_MREC_AD_LOAD_FAILED_EVENT : AppLovinMAXAdEvents.ON_BANNER_AD_LOAD_FAILED_EVENT;
|
|
1230
1195
|
}
|
|
1231
1196
|
else if ( interstitials.containsKey( adUnitId ) )
|
|
1232
1197
|
{
|
|
1233
|
-
name = ON_INTERSTITIAL_LOAD_FAILED_EVENT;
|
|
1198
|
+
name = AppLovinMAXAdEvents.ON_INTERSTITIAL_LOAD_FAILED_EVENT;
|
|
1234
1199
|
}
|
|
1235
1200
|
else if ( rewardedAds.containsKey( adUnitId ) )
|
|
1236
1201
|
{
|
|
1237
|
-
name = ON_REWARDED_AD_LOAD_FAILED_EVENT;
|
|
1202
|
+
name = AppLovinMAXAdEvents.ON_REWARDED_AD_LOAD_FAILED_EVENT;
|
|
1238
1203
|
}
|
|
1239
1204
|
else if ( appOpenAds.containsKey( adUnitId ) )
|
|
1240
1205
|
{
|
|
1241
|
-
name = ON_APPOPEN_AD_LOAD_FAILED_EVENT;
|
|
1206
|
+
name = AppLovinMAXAdEvents.ON_APPOPEN_AD_LOAD_FAILED_EVENT;
|
|
1242
1207
|
}
|
|
1243
1208
|
else
|
|
1244
1209
|
{
|
|
@@ -1261,23 +1226,23 @@ public class AppLovinMAXModule
|
|
|
1261
1226
|
final String name;
|
|
1262
1227
|
if ( MaxAdFormat.BANNER == adFormat || MaxAdFormat.LEADER == adFormat )
|
|
1263
1228
|
{
|
|
1264
|
-
name = ON_BANNER_AD_CLICKED_EVENT;
|
|
1229
|
+
name = AppLovinMAXAdEvents.ON_BANNER_AD_CLICKED_EVENT;
|
|
1265
1230
|
}
|
|
1266
1231
|
else if ( MaxAdFormat.MREC == adFormat )
|
|
1267
1232
|
{
|
|
1268
|
-
name = ON_MREC_AD_CLICKED_EVENT;
|
|
1233
|
+
name = AppLovinMAXAdEvents.ON_MREC_AD_CLICKED_EVENT;
|
|
1269
1234
|
}
|
|
1270
1235
|
else if ( MaxAdFormat.INTERSTITIAL == adFormat )
|
|
1271
1236
|
{
|
|
1272
|
-
name = ON_INTERSTITIAL_CLICKED_EVENT;
|
|
1237
|
+
name = AppLovinMAXAdEvents.ON_INTERSTITIAL_CLICKED_EVENT;
|
|
1273
1238
|
}
|
|
1274
1239
|
else if ( MaxAdFormat.REWARDED == adFormat )
|
|
1275
1240
|
{
|
|
1276
|
-
name = ON_REWARDED_AD_CLICKED_EVENT;
|
|
1241
|
+
name = AppLovinMAXAdEvents.ON_REWARDED_AD_CLICKED_EVENT;
|
|
1277
1242
|
}
|
|
1278
1243
|
else if ( MaxAdFormat.APP_OPEN == adFormat )
|
|
1279
1244
|
{
|
|
1280
|
-
name = ON_APPOPEN_AD_CLICKED_EVENT;
|
|
1245
|
+
name = AppLovinMAXAdEvents.ON_APPOPEN_AD_CLICKED_EVENT;
|
|
1281
1246
|
}
|
|
1282
1247
|
else
|
|
1283
1248
|
{
|
|
@@ -1298,15 +1263,15 @@ public class AppLovinMAXModule
|
|
|
1298
1263
|
final String name;
|
|
1299
1264
|
if ( MaxAdFormat.INTERSTITIAL == adFormat )
|
|
1300
1265
|
{
|
|
1301
|
-
name = ON_INTERSTITIAL_DISPLAYED_EVENT;
|
|
1266
|
+
name = AppLovinMAXAdEvents.ON_INTERSTITIAL_DISPLAYED_EVENT;
|
|
1302
1267
|
}
|
|
1303
1268
|
else if ( MaxAdFormat.REWARDED == adFormat )
|
|
1304
1269
|
{
|
|
1305
|
-
name = ON_REWARDED_AD_DISPLAYED_EVENT;
|
|
1270
|
+
name = AppLovinMAXAdEvents.ON_REWARDED_AD_DISPLAYED_EVENT;
|
|
1306
1271
|
}
|
|
1307
1272
|
else // APP OPEN
|
|
1308
1273
|
{
|
|
1309
|
-
name = ON_APPOPEN_AD_DISPLAYED_EVENT;
|
|
1274
|
+
name = AppLovinMAXAdEvents.ON_APPOPEN_AD_DISPLAYED_EVENT;
|
|
1310
1275
|
}
|
|
1311
1276
|
|
|
1312
1277
|
sendReactNativeEvent( name, getAdInfo( ad ) );
|
|
@@ -1322,15 +1287,15 @@ public class AppLovinMAXModule
|
|
|
1322
1287
|
final String name;
|
|
1323
1288
|
if ( MaxAdFormat.INTERSTITIAL == adFormat )
|
|
1324
1289
|
{
|
|
1325
|
-
name = ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT;
|
|
1290
|
+
name = AppLovinMAXAdEvents.ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT;
|
|
1326
1291
|
}
|
|
1327
1292
|
else if ( MaxAdFormat.REWARDED == adFormat )
|
|
1328
1293
|
{
|
|
1329
|
-
name = ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT;
|
|
1294
|
+
name = AppLovinMAXAdEvents.ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT;
|
|
1330
1295
|
}
|
|
1331
1296
|
else // APP OPEN
|
|
1332
1297
|
{
|
|
1333
|
-
name = ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT;
|
|
1298
|
+
name = AppLovinMAXAdEvents.ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT;
|
|
1334
1299
|
}
|
|
1335
1300
|
|
|
1336
1301
|
sendReactNativeEvent( name, getAdDisplayFailedInfo( ad, error ) );
|
|
@@ -1346,15 +1311,15 @@ public class AppLovinMAXModule
|
|
|
1346
1311
|
String name;
|
|
1347
1312
|
if ( MaxAdFormat.INTERSTITIAL == adFormat )
|
|
1348
1313
|
{
|
|
1349
|
-
name = ON_INTERSTITIAL_HIDDEN_EVENT;
|
|
1314
|
+
name = AppLovinMAXAdEvents.ON_INTERSTITIAL_HIDDEN_EVENT;
|
|
1350
1315
|
}
|
|
1351
1316
|
else if ( MaxAdFormat.REWARDED == adFormat )
|
|
1352
1317
|
{
|
|
1353
|
-
name = ON_REWARDED_AD_HIDDEN_EVENT;
|
|
1318
|
+
name = AppLovinMAXAdEvents.ON_REWARDED_AD_HIDDEN_EVENT;
|
|
1354
1319
|
}
|
|
1355
1320
|
else // APP OPEN
|
|
1356
1321
|
{
|
|
1357
|
-
name = ON_APPOPEN_AD_HIDDEN_EVENT;
|
|
1322
|
+
name = AppLovinMAXAdEvents.ON_APPOPEN_AD_HIDDEN_EVENT;
|
|
1358
1323
|
}
|
|
1359
1324
|
|
|
1360
1325
|
sendReactNativeEvent( name, getAdInfo( ad ) );
|
|
@@ -1370,7 +1335,7 @@ public class AppLovinMAXModule
|
|
|
1370
1335
|
return;
|
|
1371
1336
|
}
|
|
1372
1337
|
|
|
1373
|
-
sendReactNativeEvent( ( MaxAdFormat.MREC == adFormat ) ? ON_MREC_AD_EXPANDED_EVENT : ON_BANNER_AD_EXPANDED_EVENT, getAdInfo( ad ) );
|
|
1338
|
+
sendReactNativeEvent( ( MaxAdFormat.MREC == adFormat ) ? AppLovinMAXAdEvents.ON_MREC_AD_EXPANDED_EVENT : AppLovinMAXAdEvents.ON_BANNER_AD_EXPANDED_EVENT, getAdInfo( ad ) );
|
|
1374
1339
|
}
|
|
1375
1340
|
|
|
1376
1341
|
@Override
|
|
@@ -1383,7 +1348,7 @@ public class AppLovinMAXModule
|
|
|
1383
1348
|
return;
|
|
1384
1349
|
}
|
|
1385
1350
|
|
|
1386
|
-
sendReactNativeEvent( ( MaxAdFormat.MREC == adFormat ) ? ON_MREC_AD_COLLAPSED_EVENT : ON_BANNER_AD_COLLAPSED_EVENT, getAdInfo( ad ) );
|
|
1351
|
+
sendReactNativeEvent( ( MaxAdFormat.MREC == adFormat ) ? AppLovinMAXAdEvents.ON_MREC_AD_COLLAPSED_EVENT : AppLovinMAXAdEvents.ON_BANNER_AD_COLLAPSED_EVENT, getAdInfo( ad ) );
|
|
1387
1352
|
}
|
|
1388
1353
|
|
|
1389
1354
|
@Override
|
|
@@ -1393,23 +1358,23 @@ public class AppLovinMAXModule
|
|
|
1393
1358
|
final String name;
|
|
1394
1359
|
if ( MaxAdFormat.BANNER == adFormat || MaxAdFormat.LEADER == adFormat )
|
|
1395
1360
|
{
|
|
1396
|
-
name = ON_BANNER_AD_REVENUE_PAID;
|
|
1361
|
+
name = AppLovinMAXAdEvents.ON_BANNER_AD_REVENUE_PAID;
|
|
1397
1362
|
}
|
|
1398
1363
|
else if ( MaxAdFormat.MREC == adFormat )
|
|
1399
1364
|
{
|
|
1400
|
-
name = ON_MREC_AD_REVENUE_PAID;
|
|
1365
|
+
name = AppLovinMAXAdEvents.ON_MREC_AD_REVENUE_PAID;
|
|
1401
1366
|
}
|
|
1402
1367
|
else if ( MaxAdFormat.INTERSTITIAL == adFormat )
|
|
1403
1368
|
{
|
|
1404
|
-
name = ON_INTERSTITIAL_AD_REVENUE_PAID;
|
|
1369
|
+
name = AppLovinMAXAdEvents.ON_INTERSTITIAL_AD_REVENUE_PAID;
|
|
1405
1370
|
}
|
|
1406
1371
|
else if ( MaxAdFormat.REWARDED == adFormat )
|
|
1407
1372
|
{
|
|
1408
|
-
name = ON_REWARDED_AD_REVENUE_PAID;
|
|
1373
|
+
name = AppLovinMAXAdEvents.ON_REWARDED_AD_REVENUE_PAID;
|
|
1409
1374
|
}
|
|
1410
1375
|
else if ( MaxAdFormat.APP_OPEN == adFormat )
|
|
1411
1376
|
{
|
|
1412
|
-
name = ON_APPOPEN_AD_REVENUE_PAID;
|
|
1377
|
+
name = AppLovinMAXAdEvents.ON_APPOPEN_AD_REVENUE_PAID;
|
|
1413
1378
|
}
|
|
1414
1379
|
else
|
|
1415
1380
|
{
|
|
@@ -1448,7 +1413,7 @@ public class AppLovinMAXModule
|
|
|
1448
1413
|
WritableMap params = getAdInfo( ad );
|
|
1449
1414
|
params.putString( "rewardLabel", rewardLabel );
|
|
1450
1415
|
params.putInt( "rewardAmount", rewardAmount );
|
|
1451
|
-
sendReactNativeEvent(
|
|
1416
|
+
sendReactNativeEvent( AppLovinMAXAdEvents.ON_REWARDED_AD_RECEIVED_REWARD_EVENT, params );
|
|
1452
1417
|
}
|
|
1453
1418
|
|
|
1454
1419
|
// INTERNAL METHODS
|
|
@@ -2369,47 +2334,47 @@ public class AppLovinMAXModule
|
|
|
2369
2334
|
{
|
|
2370
2335
|
final Map<String, Object> constants = new HashMap<>();
|
|
2371
2336
|
|
|
2372
|
-
constants.put( "ON_MREC_AD_LOADED_EVENT", ON_MREC_AD_LOADED_EVENT );
|
|
2373
|
-
constants.put( "ON_MREC_AD_LOAD_FAILED_EVENT", ON_MREC_AD_LOAD_FAILED_EVENT );
|
|
2374
|
-
constants.put( "ON_MREC_AD_CLICKED_EVENT", ON_MREC_AD_CLICKED_EVENT );
|
|
2375
|
-
constants.put( "ON_MREC_AD_COLLAPSED_EVENT", ON_MREC_AD_COLLAPSED_EVENT );
|
|
2376
|
-
constants.put( "ON_MREC_AD_EXPANDED_EVENT", ON_MREC_AD_EXPANDED_EVENT );
|
|
2377
|
-
constants.put( "ON_MREC_AD_REVENUE_PAID", ON_MREC_AD_REVENUE_PAID );
|
|
2378
|
-
|
|
2379
|
-
constants.put( "ON_BANNER_AD_LOADED_EVENT", ON_BANNER_AD_LOADED_EVENT );
|
|
2380
|
-
constants.put( "ON_BANNER_AD_LOAD_FAILED_EVENT", ON_BANNER_AD_LOAD_FAILED_EVENT );
|
|
2381
|
-
constants.put( "ON_BANNER_AD_CLICKED_EVENT", ON_BANNER_AD_CLICKED_EVENT );
|
|
2382
|
-
constants.put( "ON_BANNER_AD_COLLAPSED_EVENT", ON_BANNER_AD_COLLAPSED_EVENT );
|
|
2383
|
-
constants.put( "ON_BANNER_AD_EXPANDED_EVENT", ON_BANNER_AD_EXPANDED_EVENT );
|
|
2384
|
-
constants.put( "ON_BANNER_AD_REVENUE_PAID", ON_BANNER_AD_REVENUE_PAID );
|
|
2385
|
-
|
|
2386
|
-
constants.put( "ON_INTERSTITIAL_LOADED_EVENT", ON_INTERSTITIAL_LOADED_EVENT );
|
|
2387
|
-
constants.put( "ON_INTERSTITIAL_LOAD_FAILED_EVENT", ON_INTERSTITIAL_LOAD_FAILED_EVENT );
|
|
2388
|
-
constants.put( "ON_INTERSTITIAL_CLICKED_EVENT", ON_INTERSTITIAL_CLICKED_EVENT );
|
|
2389
|
-
constants.put( "ON_INTERSTITIAL_DISPLAYED_EVENT", ON_INTERSTITIAL_DISPLAYED_EVENT );
|
|
2390
|
-
constants.put( "ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT", ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT );
|
|
2391
|
-
constants.put( "ON_INTERSTITIAL_HIDDEN_EVENT", ON_INTERSTITIAL_HIDDEN_EVENT );
|
|
2392
|
-
constants.put( "ON_INTERSTITIAL_AD_REVENUE_PAID", ON_INTERSTITIAL_AD_REVENUE_PAID );
|
|
2393
|
-
|
|
2394
|
-
constants.put( "ON_REWARDED_AD_LOADED_EVENT", ON_REWARDED_AD_LOADED_EVENT );
|
|
2395
|
-
constants.put( "ON_REWARDED_AD_LOAD_FAILED_EVENT", ON_REWARDED_AD_LOAD_FAILED_EVENT );
|
|
2396
|
-
constants.put( "ON_REWARDED_AD_CLICKED_EVENT", ON_REWARDED_AD_CLICKED_EVENT );
|
|
2397
|
-
constants.put( "ON_REWARDED_AD_DISPLAYED_EVENT", ON_REWARDED_AD_DISPLAYED_EVENT );
|
|
2398
|
-
constants.put( "ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT", ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT );
|
|
2399
|
-
constants.put( "ON_REWARDED_AD_HIDDEN_EVENT", ON_REWARDED_AD_HIDDEN_EVENT );
|
|
2400
|
-
constants.put( "ON_REWARDED_AD_RECEIVED_REWARD_EVENT", ON_REWARDED_AD_RECEIVED_REWARD_EVENT );
|
|
2401
|
-
constants.put( "ON_REWARDED_AD_REVENUE_PAID", ON_REWARDED_AD_REVENUE_PAID );
|
|
2402
|
-
|
|
2403
|
-
constants.put( "ON_APPOPEN_AD_LOADED_EVENT", ON_APPOPEN_AD_LOADED_EVENT );
|
|
2404
|
-
constants.put( "ON_APPOPEN_AD_LOAD_FAILED_EVENT", ON_APPOPEN_AD_LOAD_FAILED_EVENT );
|
|
2405
|
-
constants.put( "ON_APPOPEN_AD_CLICKED_EVENT", ON_APPOPEN_AD_CLICKED_EVENT );
|
|
2406
|
-
constants.put( "ON_APPOPEN_AD_DISPLAYED_EVENT", ON_APPOPEN_AD_DISPLAYED_EVENT );
|
|
2407
|
-
constants.put( "ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT", ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT );
|
|
2408
|
-
constants.put( "ON_APPOPEN_AD_HIDDEN_EVENT", ON_APPOPEN_AD_HIDDEN_EVENT );
|
|
2409
|
-
constants.put( "ON_APPOPEN_AD_REVENUE_PAID", ON_APPOPEN_AD_REVENUE_PAID );
|
|
2410
|
-
|
|
2411
|
-
constants.put( "ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT", ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT );
|
|
2412
|
-
constants.put( "ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT", ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT );
|
|
2337
|
+
constants.put( "ON_MREC_AD_LOADED_EVENT", AppLovinMAXAdEvents.ON_MREC_AD_LOADED_EVENT );
|
|
2338
|
+
constants.put( "ON_MREC_AD_LOAD_FAILED_EVENT", AppLovinMAXAdEvents.ON_MREC_AD_LOAD_FAILED_EVENT );
|
|
2339
|
+
constants.put( "ON_MREC_AD_CLICKED_EVENT", AppLovinMAXAdEvents.ON_MREC_AD_CLICKED_EVENT );
|
|
2340
|
+
constants.put( "ON_MREC_AD_COLLAPSED_EVENT", AppLovinMAXAdEvents.ON_MREC_AD_COLLAPSED_EVENT );
|
|
2341
|
+
constants.put( "ON_MREC_AD_EXPANDED_EVENT", AppLovinMAXAdEvents.ON_MREC_AD_EXPANDED_EVENT );
|
|
2342
|
+
constants.put( "ON_MREC_AD_REVENUE_PAID", AppLovinMAXAdEvents.ON_MREC_AD_REVENUE_PAID );
|
|
2343
|
+
|
|
2344
|
+
constants.put( "ON_BANNER_AD_LOADED_EVENT", AppLovinMAXAdEvents.ON_BANNER_AD_LOADED_EVENT );
|
|
2345
|
+
constants.put( "ON_BANNER_AD_LOAD_FAILED_EVENT", AppLovinMAXAdEvents.ON_BANNER_AD_LOAD_FAILED_EVENT );
|
|
2346
|
+
constants.put( "ON_BANNER_AD_CLICKED_EVENT", AppLovinMAXAdEvents.ON_BANNER_AD_CLICKED_EVENT );
|
|
2347
|
+
constants.put( "ON_BANNER_AD_COLLAPSED_EVENT", AppLovinMAXAdEvents.ON_BANNER_AD_COLLAPSED_EVENT );
|
|
2348
|
+
constants.put( "ON_BANNER_AD_EXPANDED_EVENT", AppLovinMAXAdEvents.ON_BANNER_AD_EXPANDED_EVENT );
|
|
2349
|
+
constants.put( "ON_BANNER_AD_REVENUE_PAID", AppLovinMAXAdEvents.ON_BANNER_AD_REVENUE_PAID );
|
|
2350
|
+
|
|
2351
|
+
constants.put( "ON_INTERSTITIAL_LOADED_EVENT", AppLovinMAXAdEvents.ON_INTERSTITIAL_LOADED_EVENT );
|
|
2352
|
+
constants.put( "ON_INTERSTITIAL_LOAD_FAILED_EVENT", AppLovinMAXAdEvents.ON_INTERSTITIAL_LOAD_FAILED_EVENT );
|
|
2353
|
+
constants.put( "ON_INTERSTITIAL_CLICKED_EVENT", AppLovinMAXAdEvents.ON_INTERSTITIAL_CLICKED_EVENT );
|
|
2354
|
+
constants.put( "ON_INTERSTITIAL_DISPLAYED_EVENT", AppLovinMAXAdEvents.ON_INTERSTITIAL_DISPLAYED_EVENT );
|
|
2355
|
+
constants.put( "ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT", AppLovinMAXAdEvents.ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT );
|
|
2356
|
+
constants.put( "ON_INTERSTITIAL_HIDDEN_EVENT", AppLovinMAXAdEvents.ON_INTERSTITIAL_HIDDEN_EVENT );
|
|
2357
|
+
constants.put( "ON_INTERSTITIAL_AD_REVENUE_PAID", AppLovinMAXAdEvents.ON_INTERSTITIAL_AD_REVENUE_PAID );
|
|
2358
|
+
|
|
2359
|
+
constants.put( "ON_REWARDED_AD_LOADED_EVENT", AppLovinMAXAdEvents.ON_REWARDED_AD_LOADED_EVENT );
|
|
2360
|
+
constants.put( "ON_REWARDED_AD_LOAD_FAILED_EVENT", AppLovinMAXAdEvents.ON_REWARDED_AD_LOAD_FAILED_EVENT );
|
|
2361
|
+
constants.put( "ON_REWARDED_AD_CLICKED_EVENT", AppLovinMAXAdEvents.ON_REWARDED_AD_CLICKED_EVENT );
|
|
2362
|
+
constants.put( "ON_REWARDED_AD_DISPLAYED_EVENT", AppLovinMAXAdEvents.ON_REWARDED_AD_DISPLAYED_EVENT );
|
|
2363
|
+
constants.put( "ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT", AppLovinMAXAdEvents.ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT );
|
|
2364
|
+
constants.put( "ON_REWARDED_AD_HIDDEN_EVENT", AppLovinMAXAdEvents.ON_REWARDED_AD_HIDDEN_EVENT );
|
|
2365
|
+
constants.put( "ON_REWARDED_AD_RECEIVED_REWARD_EVENT", AppLovinMAXAdEvents.ON_REWARDED_AD_RECEIVED_REWARD_EVENT );
|
|
2366
|
+
constants.put( "ON_REWARDED_AD_REVENUE_PAID", AppLovinMAXAdEvents.ON_REWARDED_AD_REVENUE_PAID );
|
|
2367
|
+
|
|
2368
|
+
constants.put( "ON_APPOPEN_AD_LOADED_EVENT", AppLovinMAXAdEvents.ON_APPOPEN_AD_LOADED_EVENT );
|
|
2369
|
+
constants.put( "ON_APPOPEN_AD_LOAD_FAILED_EVENT", AppLovinMAXAdEvents.ON_APPOPEN_AD_LOAD_FAILED_EVENT );
|
|
2370
|
+
constants.put( "ON_APPOPEN_AD_CLICKED_EVENT", AppLovinMAXAdEvents.ON_APPOPEN_AD_CLICKED_EVENT );
|
|
2371
|
+
constants.put( "ON_APPOPEN_AD_DISPLAYED_EVENT", AppLovinMAXAdEvents.ON_APPOPEN_AD_DISPLAYED_EVENT );
|
|
2372
|
+
constants.put( "ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT", AppLovinMAXAdEvents.ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT );
|
|
2373
|
+
constants.put( "ON_APPOPEN_AD_HIDDEN_EVENT", AppLovinMAXAdEvents.ON_APPOPEN_AD_HIDDEN_EVENT );
|
|
2374
|
+
constants.put( "ON_APPOPEN_AD_REVENUE_PAID", AppLovinMAXAdEvents.ON_APPOPEN_AD_REVENUE_PAID );
|
|
2375
|
+
|
|
2376
|
+
constants.put( "ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT", AppLovinMAXAdEvents.ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT );
|
|
2377
|
+
constants.put( "ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT", AppLovinMAXAdEvents.ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT );
|
|
2413
2378
|
|
|
2414
2379
|
constants.put( "TOP_CENTER_POSITION", TOP_CENTER );
|
|
2415
2380
|
constants.put( "TOP_LEFT_POSITION", TOP_LEFT );
|
|
@@ -188,7 +188,7 @@ public class AppLovinMAXNativeAdView
|
|
|
188
188
|
AppLovinMAXModule.e( "Native ad is of template type, failing ad load..." );
|
|
189
189
|
|
|
190
190
|
WritableMap loadFailedInfo = AppLovinMAXModule.getInstance().getAdLoadFailedInfo( adUnitId, null );
|
|
191
|
-
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(),
|
|
191
|
+
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(), AppLovinMAXAdEvents.ON_AD_LOAD_FAILED_EVENT, loadFailedInfo );
|
|
192
192
|
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
@@ -211,14 +211,14 @@ public class AppLovinMAXNativeAdView
|
|
|
211
211
|
AppLovinMAXModule.e( "Failed to load native ad for Ad Unit ID " + adUnitId + " with error: " + error );
|
|
212
212
|
|
|
213
213
|
WritableMap loadFailedInfo = AppLovinMAXModule.getInstance().getAdLoadFailedInfo( adUnitId, error );
|
|
214
|
-
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(),
|
|
214
|
+
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(), AppLovinMAXAdEvents.ON_AD_LOAD_FAILED_EVENT, loadFailedInfo );
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
@Override
|
|
218
218
|
public void onNativeAdClicked(@NonNull final MaxAd ad)
|
|
219
219
|
{
|
|
220
220
|
WritableMap adInfo = AppLovinMAXModule.getInstance().getAdInfo( ad );
|
|
221
|
-
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(),
|
|
221
|
+
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(), AppLovinMAXAdEvents.ON_AD_CLICKED_EVENT, adInfo );
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
|
|
@@ -228,7 +228,7 @@ public class AppLovinMAXNativeAdView
|
|
|
228
228
|
public void onAdRevenuePaid(@NonNull final MaxAd ad)
|
|
229
229
|
{
|
|
230
230
|
WritableMap adRevenueInfo = AppLovinMAXModule.getInstance().getAdRevenueInfo( ad );
|
|
231
|
-
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(),
|
|
231
|
+
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(), AppLovinMAXAdEvents.ON_AD_REVENUE_PAID_EVENT, adRevenueInfo );
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
/// Native Ad Component Methods
|
|
@@ -380,7 +380,7 @@ public class AppLovinMAXNativeAdView
|
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
view.setTag( MEDIA_VIEW_CONTAINER_TAG );
|
|
383
|
-
clickableViews.add(
|
|
383
|
+
clickableViews.add( mediaView );
|
|
384
384
|
|
|
385
385
|
view.addOnLayoutChangeListener( this );
|
|
386
386
|
|
|
@@ -545,7 +545,7 @@ public class AppLovinMAXNativeAdView
|
|
|
545
545
|
arg.putMap( "nativeAd", jsNativeAd );
|
|
546
546
|
|
|
547
547
|
// Send to `AppLovinNativeAdView.js`
|
|
548
|
-
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(),
|
|
548
|
+
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(), AppLovinMAXAdEvents.ON_AD_LOADED_EVENT, arg );
|
|
549
549
|
}
|
|
550
550
|
|
|
551
551
|
private void maybeDestroyCurrentAd()
|
|
@@ -43,10 +43,10 @@ public class AppLovinMAXNativeAdViewManager
|
|
|
43
43
|
{
|
|
44
44
|
// mapping Android events to JavaScript events
|
|
45
45
|
return MapBuilder.<String, Object>builder()
|
|
46
|
-
.put(
|
|
47
|
-
.put(
|
|
48
|
-
.put(
|
|
49
|
-
.put(
|
|
46
|
+
.put( AppLovinMAXAdEvents.ON_AD_LOADED_EVENT, MapBuilder.of( "registrationName", AppLovinMAXAdEvents.ON_AD_LOADED_EVENT ) )
|
|
47
|
+
.put( AppLovinMAXAdEvents.ON_AD_LOAD_FAILED_EVENT, MapBuilder.of( "registrationName", AppLovinMAXAdEvents.ON_AD_LOAD_FAILED_EVENT ) )
|
|
48
|
+
.put( AppLovinMAXAdEvents.ON_AD_CLICKED_EVENT, MapBuilder.of( "registrationName", AppLovinMAXAdEvents.ON_AD_CLICKED_EVENT ) )
|
|
49
|
+
.put( AppLovinMAXAdEvents.ON_AD_REVENUE_PAID_EVENT, MapBuilder.of( "registrationName", AppLovinMAXAdEvents.ON_AD_REVENUE_PAID_EVENT ) )
|
|
50
50
|
.build();
|
|
51
51
|
}
|
|
52
52
|
|
package/ios/AppLovinMAX.m
CHANGED
|
@@ -87,7 +87,7 @@ static NSString *const ON_BANNER_AD_REVENUE_PAID = @"OnBannerAdRevenuePaid";
|
|
|
87
87
|
|
|
88
88
|
static NSString *const ON_MREC_AD_LOADED_EVENT = @"OnMRecAdLoadedEvent";
|
|
89
89
|
static NSString *const ON_MREC_AD_LOAD_FAILED_EVENT = @"OnMRecAdLoadFailedEvent";
|
|
90
|
-
static NSString *const ON_MREC_AD_CLICKED_EVENT= @"OnMRecAdClickedEvent";
|
|
90
|
+
static NSString *const ON_MREC_AD_CLICKED_EVENT = @"OnMRecAdClickedEvent";
|
|
91
91
|
static NSString *const ON_MREC_AD_COLLAPSED_EVENT = @"OnMRecAdCollapsedEvent";
|
|
92
92
|
static NSString *const ON_MREC_AD_EXPANDED_EVENT = @"OnMRecAdExpandedEvent";
|
|
93
93
|
static NSString *const ON_MREC_AD_REVENUE_PAID = @"OnMRecAdRevenuePaid";
|
|
@@ -117,8 +117,8 @@ static NSString *const ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT = @"OnAppOpenAdFail
|
|
|
117
117
|
static NSString *const ON_APPOPEN_AD_HIDDEN_EVENT = @"OnAppOpenAdHiddenEvent";
|
|
118
118
|
static NSString *const ON_APPOPEN_AD_REVENUE_PAID = @"OnAppOpenAdRevenuePaid";
|
|
119
119
|
|
|
120
|
-
static NSString *const ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT = @"
|
|
121
|
-
static NSString *const ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT = @"
|
|
120
|
+
static NSString *const ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT = @"OnNativeUIComponentAdViewAdLoadedEvent";
|
|
121
|
+
static NSString *const ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT = @"OnNativeUIComponentAdViewAdLoadFailedEvent";
|
|
122
122
|
|
|
123
123
|
static NSString *const TOP_CENTER = @"top_center";
|
|
124
124
|
static NSString *const TOP_LEFT = @"top_left";
|
|
@@ -226,7 +226,7 @@ RCT_EXPORT_METHOD(initialize:(NSString *)pluginVersion :(NSString *)sdkKey :(RCT
|
|
|
226
226
|
}
|
|
227
227
|
}];
|
|
228
228
|
|
|
229
|
-
[self.sdk initializeWithConfiguration:initConfig completionHandler:^(ALSdkConfiguration *configuration) {
|
|
229
|
+
[self.sdk initializeWithConfiguration: initConfig completionHandler:^(ALSdkConfiguration *configuration) {
|
|
230
230
|
|
|
231
231
|
[self log: @"SDK initialized"];
|
|
232
232
|
|
|
@@ -932,7 +932,14 @@ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier :
|
|
|
932
932
|
|
|
933
933
|
#pragma mark - AdView Preloading
|
|
934
934
|
|
|
935
|
-
RCT_EXPORT_METHOD(preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
935
|
+
RCT_EXPORT_METHOD(preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
936
|
+
:(NSString *)adFormatStr
|
|
937
|
+
:(nullable NSString *)placement
|
|
938
|
+
:(nullable NSString *)customData
|
|
939
|
+
:(nullable NSDictionary<NSString *, id> *)extraParameterDict
|
|
940
|
+
:(nullable NSDictionary<NSString *, id> *)localExtraParameterDict
|
|
941
|
+
:(RCTPromiseResolveBlock)resolve
|
|
942
|
+
:(RCTPromiseRejectBlock)reject)
|
|
936
943
|
{
|
|
937
944
|
MAAdFormat *adFormat;
|
|
938
945
|
|
|
@@ -950,12 +957,23 @@ RCT_EXPORT_METHOD(preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier :(
|
|
|
950
957
|
return;
|
|
951
958
|
}
|
|
952
959
|
|
|
953
|
-
[AppLovinMAXAdView preloadNativeUIComponentAdView:adUnitIdentifier
|
|
960
|
+
[AppLovinMAXAdView preloadNativeUIComponentAdView: adUnitIdentifier
|
|
961
|
+
adFormat: adFormat
|
|
962
|
+
placement: placement
|
|
963
|
+
customData: customData
|
|
964
|
+
extraParameters: extraParameterDict
|
|
965
|
+
localExtraParameters: localExtraParameterDict
|
|
966
|
+
withPromiseResolver: resolve
|
|
967
|
+
withPromiseRejecter: reject];
|
|
954
968
|
}
|
|
955
969
|
|
|
956
|
-
RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
970
|
+
RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
971
|
+
:(RCTPromiseResolveBlock)resolve
|
|
972
|
+
:(RCTPromiseRejectBlock)reject)
|
|
957
973
|
{
|
|
958
|
-
[AppLovinMAXAdView destroyNativeUIComponentAdView:adUnitIdentifier
|
|
974
|
+
[AppLovinMAXAdView destroyNativeUIComponentAdView: adUnitIdentifier
|
|
975
|
+
withPromiseResolver: resolve
|
|
976
|
+
withPromiseRejecter: reject];
|
|
959
977
|
}
|
|
960
978
|
|
|
961
979
|
#pragma mark - Ad Callbacks
|
|
@@ -1012,7 +1030,7 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(NSString *)adUnitIdentifier :(
|
|
|
1012
1030
|
NSString *name;
|
|
1013
1031
|
if ( self.adViews[adUnitIdentifier] )
|
|
1014
1032
|
{
|
|
1015
|
-
name = ( MAAdFormat.mrec == self.adViewAdFormats[adUnitIdentifier] ) ?
|
|
1033
|
+
name = ( MAAdFormat.mrec == self.adViewAdFormats[adUnitIdentifier] ) ? ON_MREC_AD_LOAD_FAILED_EVENT : ON_BANNER_AD_LOAD_FAILED_EVENT;
|
|
1016
1034
|
}
|
|
1017
1035
|
else if ( self.interstitials[adUnitIdentifier] )
|
|
1018
1036
|
{
|
|
@@ -1725,7 +1743,7 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(NSString *)adUnitIdentifier :(
|
|
|
1725
1743
|
|
|
1726
1744
|
- (void)logInvalidAdFormat:(MAAdFormat *)adFormat withPromiseReject:(nullable RCTPromiseRejectBlock)reject
|
|
1727
1745
|
{
|
|
1728
|
-
NSString *message = [NSString stringWithFormat
|
|
1746
|
+
NSString *message = [NSString stringWithFormat: @"invalid ad format: %@, from %@", adFormat, [NSThread callStackSymbols]];
|
|
1729
1747
|
|
|
1730
1748
|
if ( !reject )
|
|
1731
1749
|
{
|
|
@@ -1743,7 +1761,7 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(NSString *)adUnitIdentifier :(
|
|
|
1743
1761
|
|
|
1744
1762
|
- (void)logUninitializedAccessError:(NSString *)callingMethod withPromiseReject:(nullable RCTPromiseRejectBlock)reject
|
|
1745
1763
|
{
|
|
1746
|
-
NSString *message = [NSString stringWithFormat
|
|
1764
|
+
NSString *message = [NSString stringWithFormat: @"ERROR: Failed to execute %@() - please ensure the AppLovin MAX React Native module has been initialized by calling 'AppLovinMAX.initialize(...);'!", callingMethod];
|
|
1747
1765
|
|
|
1748
1766
|
if ( !reject )
|
|
1749
1767
|
{
|
package/ios/AppLovinMAXAdView.h
CHANGED
|
@@ -23,9 +23,18 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
23
23
|
|
|
24
24
|
+ (MAAdView *)sharedWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
|
25
25
|
|
|
26
|
-
+ (void)preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
+ (void)preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
27
|
+
adFormat:(MAAdFormat *)adFormat
|
|
28
|
+
placement:(nullable NSString *)placement
|
|
29
|
+
customData:(nullable NSString *)customData
|
|
30
|
+
extraParameters:(nullable NSDictionary<NSString *, id> *)extraParameters
|
|
31
|
+
localExtraParameters:(nullable NSDictionary<NSString *, id> *)localExtraParameters
|
|
32
|
+
withPromiseResolver:(RCTPromiseResolveBlock)resolve
|
|
33
|
+
withPromiseRejecter:(RCTPromiseRejectBlock)reject;
|
|
34
|
+
|
|
35
|
+
+ (void)destroyNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
36
|
+
withPromiseResolver:(RCTPromiseResolveBlock)resolve
|
|
37
|
+
withPromiseRejecter:(RCTPromiseRejectBlock)reject;
|
|
29
38
|
|
|
30
39
|
- (void)loadAd;
|
|
31
40
|
|
package/ios/AppLovinMAXAdView.m
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
@property (nonatomic, assign, readonly, getter=isAdaptiveBannerEnabled) BOOL adaptiveBannerEnabled;
|
|
23
23
|
@property (nonatomic, assign, readonly, getter=isAutoRefresh) BOOL autoRefresh;
|
|
24
24
|
@property (nonatomic, assign, readonly, getter=isLoadOnMount) BOOL loadOnMount;
|
|
25
|
-
@property (nonatomic, copy, nullable) NSDictionary *extraParameters;
|
|
26
|
-
@property (nonatomic, copy, nullable) NSDictionary *localExtraParameters;
|
|
25
|
+
@property (nonatomic, copy, nullable) NSDictionary<NSString *, id> *extraParameters;
|
|
26
|
+
@property (nonatomic, copy, nullable) NSDictionary<NSString *, id> *localExtraParameters;
|
|
27
27
|
|
|
28
28
|
@end
|
|
29
29
|
|
|
@@ -41,12 +41,17 @@ static NSMutableDictionary<NSString *, AppLovinMAXAdViewUIComponent *> *preloade
|
|
|
41
41
|
|
|
42
42
|
+ (MAAdView *)sharedWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
|
43
43
|
{
|
|
44
|
-
|
|
45
|
-
if ( !uiComponent ) uiComponent = uiComponentInstances[adUnitIdentifier];
|
|
46
|
-
return uiComponent ? uiComponent.adView : nil;
|
|
44
|
+
return (preloadedUIComponentInstances[adUnitIdentifier] ?: uiComponentInstances[adUnitIdentifier]).adView;
|
|
47
45
|
}
|
|
48
46
|
|
|
49
|
-
+ (void)preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
47
|
+
+ (void)preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
48
|
+
adFormat:(MAAdFormat *)adFormat
|
|
49
|
+
placement:(nullable NSString *)placement
|
|
50
|
+
customData:(nullable NSString *)customData
|
|
51
|
+
extraParameters:(nullable NSDictionary<NSString *, id> *)extraParameters
|
|
52
|
+
localExtraParameters:(nullable NSDictionary<NSString *, id> *)localExtraParameters
|
|
53
|
+
withPromiseResolver:(RCTPromiseResolveBlock)resolve
|
|
54
|
+
withPromiseRejecter:(RCTPromiseRejectBlock)reject
|
|
50
55
|
{
|
|
51
56
|
AppLovinMAXAdViewUIComponent *preloadedUIComponent = preloadedUIComponentInstances[ adUnitIdentifier];
|
|
52
57
|
if ( preloadedUIComponent )
|
|
@@ -68,7 +73,9 @@ static NSMutableDictionary<NSString *, AppLovinMAXAdViewUIComponent *> *preloade
|
|
|
68
73
|
resolve(nil);
|
|
69
74
|
}
|
|
70
75
|
|
|
71
|
-
+ (void)destroyNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
76
|
+
+ (void)destroyNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
77
|
+
withPromiseResolver:(RCTPromiseResolveBlock)resolve
|
|
78
|
+
withPromiseRejecter:(RCTPromiseRejectBlock)reject
|
|
72
79
|
{
|
|
73
80
|
AppLovinMAXAdViewUIComponent *preloadedUIComponent = preloadedUIComponentInstances[adUnitIdentifier];
|
|
74
81
|
if ( !preloadedUIComponent )
|
|
@@ -187,7 +194,7 @@ static NSMutableDictionary<NSString *, AppLovinMAXAdViewUIComponent *> *preloade
|
|
|
187
194
|
|
|
188
195
|
if ( ![AppLovinMAX shared].sdk )
|
|
189
196
|
{
|
|
190
|
-
[[AppLovinMAX shared] logUninitializedAccessError: @"
|
|
197
|
+
[[AppLovinMAX shared] logUninitializedAccessError: @"AppLovinMAXAdView.attachAdViewIfNeeded"];
|
|
191
198
|
return;
|
|
192
199
|
}
|
|
193
200
|
|
|
@@ -218,6 +225,7 @@ static NSMutableDictionary<NSString *, AppLovinMAXAdViewUIComponent *> *preloade
|
|
|
218
225
|
// same adUnitId
|
|
219
226
|
if ( ![self.uiComponent hasContainerView] )
|
|
220
227
|
{
|
|
228
|
+
self.uiComponent.adaptiveBannerEnabled = self.isAdaptiveBannerEnabled;
|
|
221
229
|
self.uiComponent.autoRefresh = self.isAutoRefresh;
|
|
222
230
|
[self.uiComponent attachAdView: self];
|
|
223
231
|
return;
|
|
@@ -269,11 +277,7 @@ static NSMutableDictionary<NSString *, AppLovinMAXAdViewUIComponent *> *preloade
|
|
|
269
277
|
|
|
270
278
|
AppLovinMAXAdViewUIComponent *preloadedUIComponent = preloadedUIComponentInstances[self.adUnitId];
|
|
271
279
|
|
|
272
|
-
if ( self.uiComponent
|
|
273
|
-
{
|
|
274
|
-
self.uiComponent.autoRefresh = NO;
|
|
275
|
-
}
|
|
276
|
-
else
|
|
280
|
+
if ( self.uiComponent != preloadedUIComponent )
|
|
277
281
|
{
|
|
278
282
|
[uiComponentInstances removeObjectForKey: self.adUnitId];
|
|
279
283
|
[self.uiComponent destroy];
|
|
@@ -7,21 +7,22 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
7
7
|
@interface AppLovinMAXAdViewUIComponent : NSObject
|
|
8
8
|
|
|
9
9
|
@property (nonatomic, strong, readonly) MAAdView *adView;
|
|
10
|
+
@property (nonatomic, assign, readonly) BOOL hasContainerView;
|
|
10
11
|
|
|
11
12
|
@property (nonatomic, copy, nullable) NSString *placement;
|
|
12
13
|
@property (nonatomic, copy, nullable) NSString *customData;
|
|
13
|
-
@property (nonatomic, copy, nullable) NSDictionary *extraParameters;
|
|
14
|
-
@property (nonatomic, copy, nullable) NSDictionary *localExtraParameters;
|
|
15
|
-
@property (nonatomic, assign) BOOL adaptiveBannerEnabled;
|
|
16
|
-
@property (nonatomic, assign) BOOL autoRefresh;
|
|
14
|
+
@property (nonatomic, copy, nullable) NSDictionary<NSString *, id> *extraParameters;
|
|
15
|
+
@property (nonatomic, copy, nullable) NSDictionary<NSString *, id> *localExtraParameters;
|
|
16
|
+
@property (nonatomic, assign, getter=isAdaptiveBannerEnabled) BOOL adaptiveBannerEnabled;
|
|
17
|
+
@property (nonatomic, assign, getter=isAutoRefreshEnabled) BOOL autoRefresh;
|
|
17
18
|
|
|
18
|
-
- (instancetype)initWithAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat;
|
|
19
19
|
- (void)loadAd;
|
|
20
|
-
- (BOOL)hasContainerView;
|
|
21
20
|
- (void)attachAdView:(AppLovinMAXAdView *)view;
|
|
22
21
|
- (void)detachAdView;
|
|
23
22
|
- (void)destroy;
|
|
24
23
|
|
|
24
|
+
- (instancetype)initWithAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat;
|
|
25
|
+
|
|
25
26
|
@end
|
|
26
27
|
|
|
27
28
|
NS_ASSUME_NONNULL_END
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
return self;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
- (void)setPlacement:(NSString *)placement
|
|
36
|
+
- (void)setPlacement:(nullable NSString *)placement
|
|
37
37
|
{
|
|
38
38
|
self.adView.placement = placement;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
- (void)setCustomData:(NSString *)customData
|
|
41
|
+
- (void)setCustomData:(nullable NSString *)customData
|
|
42
42
|
{
|
|
43
43
|
self.adView.customData = customData;
|
|
44
44
|
}
|
|
@@ -60,21 +60,20 @@
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
-(void)setExtraParameters:(NSDictionary<NSString *, id> *)parameterDict
|
|
63
|
+
- (void)setExtraParameters:(nullable NSDictionary<NSString *, id> *)parameterDict
|
|
64
64
|
{
|
|
65
|
-
for (NSString *key in parameterDict)
|
|
65
|
+
for ( NSString *key in parameterDict )
|
|
66
66
|
{
|
|
67
|
-
|
|
68
|
-
[self.adView setExtraParameterForKey:key value:value];
|
|
67
|
+
[self.adView setExtraParameterForKey: key value: [parameterDict al_stringForKey: key]];
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
|
|
72
|
-
-(void)setLocalExtraParameters:(NSDictionary<NSString *, id> *)parameterDict
|
|
71
|
+
- (void)setLocalExtraParameters:(nullable NSDictionary<NSString *, id> *)parameterDict
|
|
73
72
|
{
|
|
74
|
-
for (NSString *key in parameterDict)
|
|
73
|
+
for ( NSString *key in parameterDict )
|
|
75
74
|
{
|
|
76
75
|
id value = parameterDict[key];
|
|
77
|
-
[self.adView setLocalExtraParameterForKey:key value:value];
|
|
76
|
+
[self.adView setLocalExtraParameterForKey: key value: (value != [NSNull null] ? value : nil)];
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
|
|
@@ -123,23 +122,19 @@
|
|
|
123
122
|
{
|
|
124
123
|
NSDictionary *adInfo = [[AppLovinMAX shared] adInfoForAd: ad];
|
|
125
124
|
|
|
126
|
-
[[AppLovinMAX shared] sendEventWithName
|
|
125
|
+
[[AppLovinMAX shared] sendEventWithName: @"OnNativeUIComponentAdViewAdLoadedEvent" body: adInfo];
|
|
127
126
|
|
|
128
127
|
if ( self.containerView )
|
|
129
128
|
{
|
|
130
129
|
self.containerView.onAdLoadedEvent(adInfo);
|
|
131
130
|
}
|
|
132
|
-
else
|
|
133
|
-
{
|
|
134
|
-
[self setAutoRefresh: NO];
|
|
135
|
-
}
|
|
136
131
|
}
|
|
137
132
|
|
|
138
133
|
- (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withError:(MAError *)error
|
|
139
134
|
{
|
|
140
135
|
NSDictionary *adLoadFailedInfo = [[AppLovinMAX shared] adLoadFailedInfoForAd: adUnitIdentifier withError: error];
|
|
141
136
|
|
|
142
|
-
[[AppLovinMAX shared] sendEventWithName
|
|
137
|
+
[[AppLovinMAX shared] sendEventWithName: @"OnNativeUIComponentAdViewAdLoadFailedEvent" body: adLoadFailedInfo];
|
|
143
138
|
|
|
144
139
|
if ( self.containerView )
|
|
145
140
|
{
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
{
|
|
106
106
|
if ( ![AppLovinMAX shared].sdk )
|
|
107
107
|
{
|
|
108
|
-
[[AppLovinMAX shared] logUninitializedAccessError: @"
|
|
108
|
+
[[AppLovinMAX shared] logUninitializedAccessError: @"AppLovinMAXNativeAdView.loadAd"];
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
|
|
119
119
|
for ( NSString *key in self.extraParameters )
|
|
120
120
|
{
|
|
121
|
-
[self.adLoader setExtraParameterForKey: key value: self.extraParameters
|
|
121
|
+
[self.adLoader setExtraParameterForKey: key value: [self.extraParameters al_stringForKey: key]];
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
for ( NSString *key in self.localExtraParameters )
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.ConsentFlowUserGeography = exports.CMPErrorCode = exports.AppTrackingStatus = exports.AppLovinMAX = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
const NativeAppLovinMAX = _reactNative.NativeModules.AppLovinMAX;
|
|
9
|
-
const VERSION = '7.1.
|
|
9
|
+
const VERSION = '7.1.1';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* This enum represents the user's geography used to determine the type of consent flow shown to the
|
|
@@ -4,7 +4,7 @@ import type { AdDisplayFailedInfo, AdInfo, AdLoadFailedInfo, AdRevenueInfo } fro
|
|
|
4
4
|
*/
|
|
5
5
|
export type LocalExtraParameterValue = string | number | boolean | object | null;
|
|
6
6
|
/**
|
|
7
|
-
* Defines the base properties for the UI component ads i.e {@link
|
|
7
|
+
* Defines the base properties for the UI component ads i.e {@link AdView} and {@link NativeAdView}.
|
|
8
8
|
*/
|
|
9
9
|
export type AdProps = {
|
|
10
10
|
/**
|
|
@@ -35,23 +35,23 @@ export type AdProps = {
|
|
|
35
35
|
[key: string]: LocalExtraParameterValue;
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
|
-
* A callback fuction that {@link
|
|
38
|
+
* A callback fuction that {@link AdView} or {@link NativeAdView} fires when it loads a new ad.
|
|
39
39
|
*/
|
|
40
40
|
onAdLoaded?: (adInfo: AdInfo) => void;
|
|
41
41
|
/**
|
|
42
|
-
* A callback fuction that {@link
|
|
42
|
+
* A callback fuction that {@link AdView} or {@link NativeAdView} fires when it could not load a new ad.
|
|
43
43
|
*/
|
|
44
44
|
onAdLoadFailed?: (error: AdLoadFailedInfo) => void;
|
|
45
45
|
/**
|
|
46
|
-
* A callback fuction that {@link
|
|
46
|
+
* A callback fuction that {@link AdView} or {@link NativeAdView} fires when it fails to display the ad.
|
|
47
47
|
*/
|
|
48
48
|
onAdDisplayFailed?: (error: AdDisplayFailedInfo) => void;
|
|
49
49
|
/**
|
|
50
|
-
* A callback fuction that {@link
|
|
50
|
+
* A callback fuction that {@link AdView} or {@link NativeAdView} fires when the user clicks the ad.
|
|
51
51
|
*/
|
|
52
52
|
onAdClicked?: (adInfo: AdInfo) => void;
|
|
53
53
|
/**
|
|
54
|
-
* A callback fuction that {@link
|
|
54
|
+
* A callback fuction that {@link AdView} or {@link NativeAdView} fires when it pays ad revenue to the publisher.
|
|
55
55
|
*/
|
|
56
56
|
onAdRevenuePaid?: (adInfo: AdRevenueInfo) => void;
|
|
57
57
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-applovin-max",
|
|
3
3
|
"author": "AppLovin Corporation <support@applovin.com> (https://applovin.com)",
|
|
4
|
-
"version": "7.1.
|
|
4
|
+
"version": "7.1.1",
|
|
5
5
|
"description": "AppLovin MAX React Native Plugin for Android and iOS",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
7
7
|
"module": "lib/module/index",
|
|
@@ -12,11 +12,11 @@ Pod::Spec.new do |s|
|
|
|
12
12
|
s.authors = package["author"]
|
|
13
13
|
|
|
14
14
|
s.platforms = { :ios => min_ios_version_supported }
|
|
15
|
-
s.source = { :git => "https://github.com/AppLovin/AppLovin-MAX-React-Native.git", :tag => "
|
|
15
|
+
s.source = { :git => "https://github.com/AppLovin/AppLovin-MAX-React-Native.git", :tag => "release_7_1_1" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/AppLovinMAX*.{h,m}"
|
|
18
18
|
|
|
19
|
-
s.dependency "AppLovinSDK", "12.6.
|
|
19
|
+
s.dependency "AppLovinSDK", "12.6.1"
|
|
20
20
|
|
|
21
21
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
22
22
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
package/src/AppLovinMAX.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Configuration } from './types/Configuration';
|
|
|
4
4
|
|
|
5
5
|
const NativeAppLovinMAX = NativeModules.AppLovinMAX;
|
|
6
6
|
|
|
7
|
-
const VERSION = '7.1.
|
|
7
|
+
const VERSION = '7.1.1';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* This enum represents the user's geography used to determine the type of consent flow shown to the
|
package/src/types/AdProps.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { AdDisplayFailedInfo, AdInfo, AdLoadFailedInfo, AdRevenueInfo } fro
|
|
|
6
6
|
export type LocalExtraParameterValue = string | number | boolean | object | null;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Defines the base properties for the UI component ads i.e {@link
|
|
9
|
+
* Defines the base properties for the UI component ads i.e {@link AdView} and {@link NativeAdView}.
|
|
10
10
|
*/
|
|
11
11
|
export type AdProps = {
|
|
12
12
|
/**
|
|
@@ -38,27 +38,27 @@ export type AdProps = {
|
|
|
38
38
|
localExtraParameters?: { [key: string]: LocalExtraParameterValue };
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
* A callback fuction that {@link
|
|
41
|
+
* A callback fuction that {@link AdView} or {@link NativeAdView} fires when it loads a new ad.
|
|
42
42
|
*/
|
|
43
43
|
onAdLoaded?: (adInfo: AdInfo) => void;
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* A callback fuction that {@link
|
|
46
|
+
* A callback fuction that {@link AdView} or {@link NativeAdView} fires when it could not load a new ad.
|
|
47
47
|
*/
|
|
48
48
|
onAdLoadFailed?: (error: AdLoadFailedInfo) => void;
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
* A callback fuction that {@link
|
|
51
|
+
* A callback fuction that {@link AdView} or {@link NativeAdView} fires when it fails to display the ad.
|
|
52
52
|
*/
|
|
53
53
|
onAdDisplayFailed?: (error: AdDisplayFailedInfo) => void;
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* A callback fuction that {@link
|
|
56
|
+
* A callback fuction that {@link AdView} or {@link NativeAdView} fires when the user clicks the ad.
|
|
57
57
|
*/
|
|
58
58
|
onAdClicked?: (adInfo: AdInfo) => void;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
* A callback fuction that {@link
|
|
61
|
+
* A callback fuction that {@link AdView} or {@link NativeAdView} fires when it pays ad revenue to the publisher.
|
|
62
62
|
*/
|
|
63
63
|
onAdRevenuePaid?: (adInfo: AdRevenueInfo) => void;
|
|
64
64
|
};
|