react-native-applovin-max 5.5.2 → 5.6.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 +1 -1
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXNativeAdView.java +93 -94
- 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 +1 -1
- package/src/NativeAdView.js +1 -1
- package/src/index.js +1 -1
package/android/build.gradle
CHANGED
|
@@ -35,8 +35,8 @@ android {
|
|
|
35
35
|
defaultConfig {
|
|
36
36
|
minSdkVersion 16
|
|
37
37
|
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
38
|
-
versionCode
|
|
39
|
-
versionName "5.
|
|
38
|
+
versionCode 5060000
|
|
39
|
+
versionName "5.6.0"
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
flavorDimensions("default")
|
|
@@ -140,5 +140,5 @@ dependencies {
|
|
|
140
140
|
// noinspection GradleDynamicVersion
|
|
141
141
|
api 'com.facebook.react:react-native:+'
|
|
142
142
|
|
|
143
|
-
implementation 'com.applovin:applovin-sdk:11.
|
|
143
|
+
implementation 'com.applovin:applovin-sdk:11.11.2'
|
|
144
144
|
}
|
|
@@ -252,7 +252,7 @@ class AppLovinMAXAdView
|
|
|
252
252
|
{
|
|
253
253
|
for ( Map.Entry<String, Object> entry : localExtraParameters.entrySet() )
|
|
254
254
|
{
|
|
255
|
-
adView.setLocalExtraParameter( entry.getKey(),
|
|
255
|
+
adView.setLocalExtraParameter( entry.getKey(), entry.getValue() );
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
|
|
@@ -167,7 +167,86 @@ public class AppLovinMAXNativeAdView
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
///
|
|
170
|
+
/// Ad Loader Listener
|
|
171
|
+
|
|
172
|
+
private class NativeAdListener
|
|
173
|
+
extends MaxNativeAdListener
|
|
174
|
+
{
|
|
175
|
+
@Override
|
|
176
|
+
public void onNativeAdLoaded(@Nullable final MaxNativeAdView nativeAdView, final MaxAd ad)
|
|
177
|
+
{
|
|
178
|
+
AppLovinMAXModule.d( "Native ad loaded: " + ad );
|
|
179
|
+
|
|
180
|
+
// Log a warning if it is a template native ad returned - as our plugin will be responsible for re-rendering the native ad's assets
|
|
181
|
+
if ( nativeAdView != null )
|
|
182
|
+
{
|
|
183
|
+
isLoading.set( false );
|
|
184
|
+
|
|
185
|
+
AppLovinMAXModule.e( "Native ad is of template type, failing ad load..." );
|
|
186
|
+
|
|
187
|
+
WritableMap loadFailedInfo = AppLovinMAXModule.getInstance().getAdLoadFailedInfo( adUnitId, null );
|
|
188
|
+
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(), "onAdLoadFailedEvent", loadFailedInfo );
|
|
189
|
+
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
maybeDestroyCurrentAd();
|
|
194
|
+
|
|
195
|
+
nativeAd = ad;
|
|
196
|
+
|
|
197
|
+
// Notify `AppLovinNativeAdView.js`
|
|
198
|
+
sendAdLoadedReactNativeEventForAd( ad.getNativeAd() );
|
|
199
|
+
|
|
200
|
+
// After notifying the RN layer - have slight delay to let views bind to this layer in `clickableViews` before registering
|
|
201
|
+
runOnUiThreadDelayed( () -> {
|
|
202
|
+
|
|
203
|
+
// Loader can be null when the user hides before the properties are fully set
|
|
204
|
+
if ( adLoader != null )
|
|
205
|
+
{
|
|
206
|
+
adLoader.a( clickableViews, AppLovinMAXNativeAdView.this, ad );
|
|
207
|
+
adLoader.b( ad );
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Reassure the size of `mediaView` and its children for the networks, such as
|
|
211
|
+
// LINE, where the actual ad contents are loaded after `mediaView` is sized.
|
|
212
|
+
if ( mediaView != null && mediaView.getParent() != null )
|
|
213
|
+
{
|
|
214
|
+
sizeToFit( mediaView, (View) mediaView.getParent() );
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
isLoading.set( false );
|
|
218
|
+
}, 500L );
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@Override
|
|
222
|
+
public void onNativeAdLoadFailed(final String adUnitId, final MaxError error)
|
|
223
|
+
{
|
|
224
|
+
isLoading.set( false );
|
|
225
|
+
|
|
226
|
+
AppLovinMAXModule.e( "Failed to load native ad for Ad Unit ID " + adUnitId + " with error: " + error );
|
|
227
|
+
|
|
228
|
+
WritableMap loadFailedInfo = AppLovinMAXModule.getInstance().getAdLoadFailedInfo( adUnitId, error );
|
|
229
|
+
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(), "onAdLoadFailedEvent", loadFailedInfo );
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@Override
|
|
233
|
+
public void onNativeAdClicked(final MaxAd ad)
|
|
234
|
+
{
|
|
235
|
+
WritableMap adInfo = AppLovinMAXModule.getInstance().getAdInfo( ad );
|
|
236
|
+
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(), "onAdClickedEvent", adInfo );
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/// Ad Revenue Listener
|
|
241
|
+
|
|
242
|
+
@Override
|
|
243
|
+
public void onAdRevenuePaid(final MaxAd ad)
|
|
244
|
+
{
|
|
245
|
+
WritableMap adRevenueInfo = AppLovinMAXModule.getInstance().getAdRevenueInfo( ad );
|
|
246
|
+
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(), "onAdRevenuePaidEvent", adRevenueInfo );
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/// Native Ad Component Methods
|
|
171
250
|
|
|
172
251
|
public void setTitleView(final int tag)
|
|
173
252
|
{
|
|
@@ -351,84 +430,7 @@ public class AppLovinMAXNativeAdView
|
|
|
351
430
|
}
|
|
352
431
|
}
|
|
353
432
|
|
|
354
|
-
///
|
|
355
|
-
|
|
356
|
-
@Override
|
|
357
|
-
public void onAdRevenuePaid(final MaxAd ad)
|
|
358
|
-
{
|
|
359
|
-
WritableMap adRevenueInfo = AppLovinMAXModule.getInstance().getAdRevenueInfo( ad );
|
|
360
|
-
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(), "onAdRevenuePaidEvent", adRevenueInfo );
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
/// Ad Loader Callback
|
|
364
|
-
|
|
365
|
-
class NativeAdListener
|
|
366
|
-
extends MaxNativeAdListener
|
|
367
|
-
{
|
|
368
|
-
@Override
|
|
369
|
-
public void onNativeAdLoaded(@Nullable final MaxNativeAdView nativeAdView, final MaxAd ad)
|
|
370
|
-
{
|
|
371
|
-
AppLovinMAXModule.d( "Native ad loaded: " + ad );
|
|
372
|
-
|
|
373
|
-
// Log a warning if it is a template native ad returned - as our plugin will be responsible for re-rendering the native ad's assets
|
|
374
|
-
if ( nativeAdView != null )
|
|
375
|
-
{
|
|
376
|
-
isLoading.set( false );
|
|
377
|
-
|
|
378
|
-
AppLovinMAXModule.e( "Native ad is of template type, failing ad load..." );
|
|
379
|
-
WritableMap loadFailedInfo = AppLovinMAXModule.getInstance().getAdLoadFailedInfo( adUnitId, null );
|
|
380
|
-
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(), "onAdLoadFailedEvent", loadFailedInfo );
|
|
381
|
-
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
maybeDestroyCurrentAd();
|
|
386
|
-
|
|
387
|
-
nativeAd = ad;
|
|
388
|
-
|
|
389
|
-
// Notify `AppLovinNativeAdView.js`
|
|
390
|
-
sendAdLoadedReactNativeEventForAd( ad.getNativeAd() );
|
|
391
|
-
|
|
392
|
-
// After notifying the RN layer - have slight delay to let views bind to this layer in `clickableViews` before registering
|
|
393
|
-
runOnUiThreadDelayed( () -> {
|
|
394
|
-
|
|
395
|
-
// Loader can be null when the user hides before the properties are fully set
|
|
396
|
-
if ( adLoader != null )
|
|
397
|
-
{
|
|
398
|
-
adLoader.a( clickableViews, AppLovinMAXNativeAdView.this, ad );
|
|
399
|
-
adLoader.b( ad );
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
// Reassure the size of `mediaView` and its children for the networks, such as
|
|
403
|
-
// LINE, where the actual ad contents are loaded after `mediaView` is sized.
|
|
404
|
-
if ( mediaView != null && mediaView.getParent() != null )
|
|
405
|
-
{
|
|
406
|
-
sizeToFit( mediaView, (View) mediaView.getParent() );
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
isLoading.set( false );
|
|
410
|
-
}, 500L );
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
@Override
|
|
414
|
-
public void onNativeAdLoadFailed(final String adUnitId, final MaxError error)
|
|
415
|
-
{
|
|
416
|
-
isLoading.set( false );
|
|
417
|
-
|
|
418
|
-
AppLovinMAXModule.e( "Failed to load native ad for Ad Unit ID " + adUnitId + " with error: " + error );
|
|
419
|
-
|
|
420
|
-
// Notify publisher
|
|
421
|
-
WritableMap loadFailedInfo = AppLovinMAXModule.getInstance().getAdLoadFailedInfo( adUnitId, error );
|
|
422
|
-
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(), "onAdLoadFailedEvent", loadFailedInfo );
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
@Override
|
|
426
|
-
public void onNativeAdClicked(final MaxAd ad)
|
|
427
|
-
{
|
|
428
|
-
WritableMap adInfo = AppLovinMAXModule.getInstance().getAdInfo( ad );
|
|
429
|
-
reactContext.getJSModule( RCTEventEmitter.class ).receiveEvent( getId(), "onAdClickedEvent", adInfo );
|
|
430
|
-
}
|
|
431
|
-
}
|
|
433
|
+
/// Utility Methods
|
|
432
434
|
|
|
433
435
|
private void sendAdLoadedReactNativeEventForAd(final MaxNativeAd ad)
|
|
434
436
|
{
|
|
@@ -500,26 +502,23 @@ public class AppLovinMAXNativeAdView
|
|
|
500
502
|
{
|
|
501
503
|
if ( nativeAd != null )
|
|
502
504
|
{
|
|
503
|
-
if (
|
|
505
|
+
if ( mediaView != null )
|
|
504
506
|
{
|
|
505
|
-
|
|
507
|
+
ViewGroup parentView = (ViewGroup) mediaView.getParent();
|
|
508
|
+
if ( parentView != null )
|
|
506
509
|
{
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
{
|
|
510
|
-
parentView.removeOnLayoutChangeListener( AppLovinMAXNativeAdView.this );
|
|
511
|
-
parentView.removeView( mediaView );
|
|
512
|
-
}
|
|
510
|
+
parentView.removeOnLayoutChangeListener( AppLovinMAXNativeAdView.this );
|
|
511
|
+
parentView.removeView( mediaView );
|
|
513
512
|
}
|
|
513
|
+
}
|
|
514
514
|
|
|
515
|
-
|
|
515
|
+
if ( optionsView != null )
|
|
516
|
+
{
|
|
517
|
+
ViewGroup parentView = (ViewGroup) optionsView.getParent();
|
|
518
|
+
if ( parentView != null )
|
|
516
519
|
{
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
{
|
|
520
|
-
parentView.removeOnLayoutChangeListener( AppLovinMAXNativeAdView.this );
|
|
521
|
-
parentView.removeView( optionsView );
|
|
522
|
-
}
|
|
520
|
+
parentView.removeOnLayoutChangeListener( AppLovinMAXNativeAdView.this );
|
|
521
|
+
parentView.removeView( optionsView );
|
|
523
522
|
}
|
|
524
523
|
}
|
|
525
524
|
|
package/ios/Podfile
CHANGED
|
@@ -35,6 +35,6 @@ target 'AppLovinMAX' do
|
|
|
35
35
|
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
|
|
36
36
|
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
|
|
37
37
|
|
|
38
|
-
pod 'AppLovinSDK', '11.
|
|
38
|
+
pod 'AppLovinSDK', '11.11.2'
|
|
39
39
|
|
|
40
40
|
end
|
package/ios/Podfile.lock
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
PODS:
|
|
2
|
-
- AppLovinSDK (11.
|
|
2
|
+
- AppLovinSDK (11.11.2)
|
|
3
3
|
- boost-for-react-native (1.63.0)
|
|
4
4
|
- DoubleConversion (1.1.6)
|
|
5
5
|
- FBLazyVector (0.63.5)
|
|
@@ -249,7 +249,7 @@ PODS:
|
|
|
249
249
|
- Yoga (1.14.0)
|
|
250
250
|
|
|
251
251
|
DEPENDENCIES:
|
|
252
|
-
- AppLovinSDK (= 11.
|
|
252
|
+
- AppLovinSDK (= 11.11.2)
|
|
253
253
|
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
|
|
254
254
|
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
|
|
255
255
|
- FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)
|
|
@@ -339,7 +339,7 @@ EXTERNAL SOURCES:
|
|
|
339
339
|
:path: "../node_modules/react-native/ReactCommon/yoga"
|
|
340
340
|
|
|
341
341
|
SPEC CHECKSUMS:
|
|
342
|
-
AppLovinSDK:
|
|
342
|
+
AppLovinSDK: 86ac2d11e3fda1d2cb5b235fb8a4bbd39ab0ebee
|
|
343
343
|
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
|
|
344
344
|
DoubleConversion: cde416483dac037923206447da6e1454df403714
|
|
345
345
|
FBLazyVector: 352a8ca9bbc8e2f097d680747a8c97ecef12d469
|
|
@@ -368,6 +368,6 @@ SPEC CHECKSUMS:
|
|
|
368
368
|
ReactCommon: b9ff54b6dd22ba4a776eda22d7f83ec27544ca35
|
|
369
369
|
Yoga: 0276e9f20976c8568e107cfc1163a8629051adc0
|
|
370
370
|
|
|
371
|
-
PODFILE CHECKSUM:
|
|
371
|
+
PODFILE CHECKSUM: 918bd86877e7473a96702715175257e8c0f3b466
|
|
372
372
|
|
|
373
373
|
COCOAPODS: 1.11.3
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-applovin-max",
|
|
3
3
|
"author": "AppLovin Corporation",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.6.0",
|
|
5
5
|
"description": "AppLovin MAX React Native Plugin for Android and iOS",
|
|
6
6
|
"homepage": "https://github.com/AppLovin/AppLovin-MAX-React-Native",
|
|
7
7
|
"license": "MIT",
|
|
@@ -11,10 +11,10 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.authors = package["author"]
|
|
12
12
|
|
|
13
13
|
s.platforms = { :ios => "10.0" }
|
|
14
|
-
s.source = { :git => "https://github.com/AppLovin/AppLovin-MAX-React-Native.git", :tag => "
|
|
14
|
+
s.source = { :git => "https://github.com/AppLovin/AppLovin-MAX-React-Native.git", :tag => "release_5_6_0" }
|
|
15
15
|
|
|
16
16
|
s.source_files = "ios/AppLovinMAX*.{h,m}"
|
|
17
17
|
|
|
18
18
|
s.dependency "React"
|
|
19
|
-
s.dependency "AppLovinSDK", "11.
|
|
19
|
+
s.dependency "AppLovinSDK", "11.11.2"
|
|
20
20
|
end
|
package/src/AppLovinMAXAdView.js
CHANGED
|
@@ -129,7 +129,7 @@ const AdView = (props) => {
|
|
|
129
129
|
<AppLovinMAXAdView
|
|
130
130
|
style={{...style, ...dimensions}}
|
|
131
131
|
extraParameters={sanitizeExtraParameters('extraParameters', extraParameters)}
|
|
132
|
-
localExtraParameters={
|
|
132
|
+
localExtraParameters={localExtraParameters}
|
|
133
133
|
onAdLoadedEvent={onAdLoadedEvent}
|
|
134
134
|
onAdLoadFailedEvent={onAdLoadFailedEvent}
|
|
135
135
|
onAdDisplayFailedEvent={onAdDisplayFailedEvent}
|
package/src/NativeAdView.js
CHANGED
|
@@ -92,7 +92,7 @@ const NativeAdView = forwardRef((props, ref) => {
|
|
|
92
92
|
<AppLovinMAXNativeAdView
|
|
93
93
|
ref={saveElement}
|
|
94
94
|
extraParameters={sanitizeExtraParameters('extraParameters', extraParameters)}
|
|
95
|
-
localExtraParameters={
|
|
95
|
+
localExtraParameters={localExtraParameters}
|
|
96
96
|
onAdLoadedEvent={onAdLoadedEvent}
|
|
97
97
|
onAdLoadFailedEvent={onAdLoadFailedEvent}
|
|
98
98
|
onAdClickedEvent={onAdClickedEvent}
|