react-native-applovin-max 5.6.0 → 5.7.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.
@@ -35,8 +35,8 @@ android {
35
35
  defaultConfig {
36
36
  minSdkVersion 16
37
37
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
38
- versionCode 5060000
39
- versionName "5.6.0"
38
+ versionCode 5070000
39
+ versionName "5.7.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.11.2'
143
+ implementation 'com.applovin:applovin-sdk:11.11.3'
144
144
  }
@@ -954,9 +954,10 @@ public class AppLovinMAXModule
954
954
  }
955
955
 
956
956
  @ReactMethod
957
- public void setBannerLocalExtraParameter(final String adUnitId, final String key, final String value)
957
+ public void setBannerLocalExtraParameter(final String adUnitId, final ReadableMap parameterMap)
958
958
  {
959
- setAdViewLocalExtraParameters( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), key, value );
959
+ Map.Entry<String, Object> entry = parameterMap.getEntryIterator().next();
960
+ setAdViewLocalExtraParameters( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), entry.getKey(), entry.getValue() );
960
961
  }
961
962
 
962
963
  @ReactMethod
@@ -1082,9 +1083,10 @@ public class AppLovinMAXModule
1082
1083
  }
1083
1084
 
1084
1085
  @ReactMethod
1085
- public void setMRecLocalExtraParameter(final String adUnitId, final String key, final String value)
1086
+ public void setMRecLocalExtraParameter(final String adUnitId, final ReadableMap parameterMap)
1086
1087
  {
1087
- setAdViewLocalExtraParameters( adUnitId, MaxAdFormat.MREC, key, value );
1088
+ Map.Entry<String, Object> entry = parameterMap.getEntryIterator().next();
1089
+ setAdViewLocalExtraParameters( adUnitId, MaxAdFormat.MREC, entry.getKey(), entry.getValue() );
1088
1090
  }
1089
1091
 
1090
1092
  @ReactMethod
@@ -1223,7 +1225,7 @@ public class AppLovinMAXModule
1223
1225
  }
1224
1226
 
1225
1227
  @ReactMethod
1226
- public void setInterstitialLocalExtraParameter(final String adUnitId, final String key, final String value)
1228
+ public void setInterstitialLocalExtraParameter(final String adUnitId, final ReadableMap parameterMap)
1227
1229
  {
1228
1230
  if ( sdk == null )
1229
1231
  {
@@ -1234,7 +1236,8 @@ public class AppLovinMAXModule
1234
1236
  MaxInterstitialAd interstitial = retrieveInterstitial( adUnitId, "setInterstitialLocalExtraParameter" );
1235
1237
  if ( interstitial == null ) return;
1236
1238
 
1237
- interstitial.setLocalExtraParameter( key, value );
1239
+ Map.Entry<String, Object> entry = parameterMap.getEntryIterator().next();
1240
+ interstitial.setLocalExtraParameter( entry.getKey(), entry.getValue() );
1238
1241
  }
1239
1242
 
1240
1243
  // REWARDED
@@ -1313,7 +1316,7 @@ public class AppLovinMAXModule
1313
1316
  }
1314
1317
 
1315
1318
  @ReactMethod
1316
- public void setRewardedAdLocalExtraParameter(final String adUnitId, final String key, final String value)
1319
+ public void setRewardedAdLocalExtraParameter(final String adUnitId, final ReadableMap parameterMap)
1317
1320
  {
1318
1321
  if ( sdk == null )
1319
1322
  {
@@ -1324,7 +1327,8 @@ public class AppLovinMAXModule
1324
1327
  MaxRewardedAd rewardedAd = retrieveRewardedAd( adUnitId, "setRewardedAdLocalExtraParameter" );
1325
1328
  if ( rewardedAd == null ) return;
1326
1329
 
1327
- rewardedAd.setLocalExtraParameter( key, value );
1330
+ Map.Entry<String, Object> entry = parameterMap.getEntryIterator().next();
1331
+ rewardedAd.setLocalExtraParameter( entry.getKey(), entry.getValue() );
1328
1332
  }
1329
1333
 
1330
1334
  // APP OPEN AD
@@ -1383,10 +1387,11 @@ public class AppLovinMAXModule
1383
1387
  }
1384
1388
 
1385
1389
  @ReactMethod
1386
- public void setAppOpenAdLocalExtraParameter(final String adUnitId, final String key, final String value)
1390
+ public void setAppOpenAdLocalExtraParameter(final String adUnitId, final ReadableMap parameterMap)
1387
1391
  {
1388
1392
  MaxAppOpenAd appOpenAd = retrieveAppOpenAd( adUnitId );
1389
- appOpenAd.setLocalExtraParameter( key, value );
1393
+ Map.Entry<String, Object> entry = parameterMap.getEntryIterator().next();
1394
+ appOpenAd.setLocalExtraParameter( entry.getKey(), entry.getValue() );
1390
1395
  }
1391
1396
 
1392
1397
  // AD CALLBACKS
@@ -1964,7 +1969,7 @@ public class AppLovinMAXModule
1964
1969
  } );
1965
1970
  }
1966
1971
 
1967
- private void setAdViewLocalExtraParameters(final String adUnitId, final MaxAdFormat adFormat, final String key, final String value)
1972
+ private void setAdViewLocalExtraParameters(final String adUnitId, final MaxAdFormat adFormat, final String key, final Object value)
1968
1973
  {
1969
1974
  getReactApplicationContext().runOnUiQueueThread( new Runnable()
1970
1975
  {
@@ -2441,6 +2446,8 @@ public class AppLovinMAXModule
2441
2446
  {
2442
2447
  errInfo.putInt( "code", error.getCode() );
2443
2448
  errInfo.putString( "message", error.getMessage() );
2449
+ errInfo.putString( "mediatedNetworkErrorCode", error.getMediatedNetworkErrorCode() );
2450
+ errInfo.putString( "mediatedNetworkErrorMessage", error.getMediatedNetworkErrorMessage() );
2444
2451
  errInfo.putString( "adLoadFailureInfo", error.getAdLoadFailureInfo() );
2445
2452
  errInfo.putMap( "waterfall", createAdWaterfallInfo( error.getWaterfall() ) );
2446
2453
  }
@@ -2457,6 +2464,8 @@ public class AppLovinMAXModule
2457
2464
  WritableMap info = getAdInfo( ad );
2458
2465
  info.putInt( "code", error.getCode() );
2459
2466
  info.putString( "message", error.getMessage() );
2467
+ info.putString( "mediatedNetworkErrorCode", error.getMediatedNetworkErrorCode() );
2468
+ info.putString( "mediatedNetworkErrorMessage", error.getMediatedNetworkErrorMessage() );
2460
2469
  return info;
2461
2470
  }
2462
2471
 
@@ -312,13 +312,16 @@ public class AppLovinMAXNativeAdView
312
312
  // Some adapters, like Google, expect a Button widget for CTA to be clickable
313
313
  if ( view instanceof ViewGroup )
314
314
  {
315
- Button button = new Button( reactContext );
316
- button.setAlpha( 0 );
317
- ( (ViewGroup) view ).addView( button );
318
- sizeToFit( button, view );
315
+ if ( view.findViewById( CALL_TO_ACTION_VIEW_TAG ) == null )
316
+ {
317
+ Button button = new Button( reactContext );
318
+ button.setAlpha( 0 );
319
+ ( (ViewGroup) view ).addView( button );
320
+ sizeToFit( button, view );
319
321
 
320
- button.setTag( CALL_TO_ACTION_VIEW_TAG );
321
- clickableViews.add( button );
322
+ button.setTag( CALL_TO_ACTION_VIEW_TAG );
323
+ clickableViews.add( button );
324
+ }
322
325
  }
323
326
  else
324
327
  {
@@ -364,7 +367,17 @@ public class AppLovinMAXNativeAdView
364
367
  }
365
368
 
366
369
  view.addOnLayoutChangeListener( this );
367
- view.addView( optionsView );
370
+
371
+ ViewGroup optionsViewParent = (ViewGroup) optionsView.getParent();
372
+ if ( optionsViewParent == null )
373
+ {
374
+ view.addView( optionsView );
375
+ }
376
+ else if ( optionsViewParent != view )
377
+ {
378
+ optionsViewParent.removeView( optionsView );
379
+ view.addView( optionsView );
380
+ }
368
381
 
369
382
  sizeToFit( optionsView, view );
370
383
  }
@@ -385,7 +398,17 @@ public class AppLovinMAXNativeAdView
385
398
  clickableViews.add( view );
386
399
 
387
400
  view.addOnLayoutChangeListener( this );
388
- view.addView( mediaView );
401
+
402
+ ViewGroup mediaViewParent = (ViewGroup) mediaView.getParent();
403
+ if ( mediaViewParent == null )
404
+ {
405
+ view.addView( mediaView );
406
+ }
407
+ else if ( mediaViewParent != view )
408
+ {
409
+ mediaViewParent.removeView( mediaView );
410
+ view.addView( mediaView );
411
+ }
389
412
 
390
413
  sizeToFit( mediaView, view );
391
414
 
package/ios/AppLovinMAX.m CHANGED
@@ -219,7 +219,7 @@ RCT_EXPORT_METHOD(initialize:(NSString *)pluginVersion :(NSString *)sdkKey :(RCT
219
219
  self.consentFlowEnabledToSet = nil;
220
220
  self.privacyPolicyURLToSet = nil;
221
221
  self.termsOfServiceURLToSet = nil;
222
-
222
+
223
223
  // Initialize SDK
224
224
  self.sdk = [ALSdk sharedWithKey: sdkKey settings: settings];
225
225
  [self.sdk setPluginVersion: [@"React-Native-" stringByAppendingString: pluginVersion]];
@@ -303,7 +303,7 @@ RCT_EXPORT_METHOD(initialize:(NSString *)pluginVersion :(NSString *)sdkKey :(RCT
303
303
  }
304
304
 
305
305
  [self setPendingExtraParametersIfNeeded: self.sdk.settings];
306
-
306
+
307
307
  [self.sdk initializeSdkWithCompletionHandler:^(ALSdkConfiguration *configuration) {
308
308
 
309
309
  [self log: @"SDK initialized"];
@@ -434,7 +434,7 @@ RCT_EXPORT_METHOD(setExtraParameter:(NSString *)key :(nullable NSString *)value)
434
434
  [self log: @"[%@] Failed to set extra parameter for nil or empty key: %@", TAG, key];
435
435
  return;
436
436
  }
437
-
437
+
438
438
  if ( self.sdk )
439
439
  {
440
440
  ALSdkSettings *settings = self.sdk.settings;
@@ -662,7 +662,7 @@ RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier :(NSString *)bannerP
662
662
  [self logUninitializedAccessError: @"createBanner"];
663
663
  return;
664
664
  }
665
-
665
+
666
666
  [self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT atPosition: bannerPosition withOffset: CGPointZero];
667
667
  }
668
668
 
@@ -674,7 +674,7 @@ RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier :(NSStrin
674
674
  [self logUninitializedAccessError: @"createBannerWithOffsets"];
675
675
  return;
676
676
  }
677
-
677
+
678
678
  [self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT atPosition: bannerPosition withOffset: CGPointMake(xOffset, yOffset)];
679
679
  }
680
680
 
@@ -685,7 +685,7 @@ RCT_EXPORT_METHOD(setBannerBackgroundColor:(NSString *)adUnitIdentifier :(NSStri
685
685
  [self logUninitializedAccessError: @"setBannerBackgroundColor"];
686
686
  return;
687
687
  }
688
-
688
+
689
689
  [self setAdViewBackgroundColorForAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT hexColorCode: hexColorCode];
690
690
  }
691
691
 
@@ -696,7 +696,7 @@ RCT_EXPORT_METHOD(setBannerPlacement:(NSString *)adUnitIdentifier :(nullable NSS
696
696
  [self logUninitializedAccessError: @"setBannerPlacement"];
697
697
  return;
698
698
  }
699
-
699
+
700
700
  [self setAdViewPlacement: placement forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
701
701
  }
702
702
 
@@ -707,7 +707,7 @@ RCT_EXPORT_METHOD(setBannerCustomData:(NSString *)adUnitIdentifier :(nullable NS
707
707
  [self logUninitializedAccessError: @"setBannerCustomData"];
708
708
  return;
709
709
  }
710
-
710
+
711
711
  [self setAdViewCustomData: customData forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
712
712
  }
713
713
 
@@ -718,7 +718,7 @@ RCT_EXPORT_METHOD(updateBannerPosition:(NSString *)adUnitIdentifier :(NSString *
718
718
  [self logUninitializedAccessError: @"updateBannerPosition"];
719
719
  return;
720
720
  }
721
-
721
+
722
722
  [self updateAdViewPosition: bannerPosition withOffset: CGPointZero forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
723
723
  }
724
724
 
@@ -729,7 +729,7 @@ RCT_EXPORT_METHOD(updateBannerOffsets:(NSString *)adUnitIdentifier :(CGFloat)xOf
729
729
  [self logUninitializedAccessError: @"updateBannerOffsets"];
730
730
  return;
731
731
  }
732
-
732
+
733
733
  [self updateAdViewPosition: self.adViewPositions[adUnitIdentifier] withOffset: CGPointMake(xOffset, yOffset) forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
734
734
  }
735
735
 
@@ -740,7 +740,7 @@ RCT_EXPORT_METHOD(setBannerWidth:(NSString *)adUnitIdentifier :(CGFloat)width)
740
740
  [self logUninitializedAccessError: @"setBannerWidth"];
741
741
  return;
742
742
  }
743
-
743
+
744
744
  [self setAdViewWidth: width forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
745
745
  }
746
746
 
@@ -751,12 +751,15 @@ RCT_EXPORT_METHOD(setBannerExtraParameter:(NSString *)adUnitIdentifier :(NSStrin
751
751
  [self logUninitializedAccessError: @"setBannerExtraParameter"];
752
752
  return;
753
753
  }
754
-
754
+
755
755
  [self setAdViewExtraParameterForAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT key: key value: value];
756
756
  }
757
757
 
758
- RCT_EXPORT_METHOD(setBannerLocalExtraParameter:(NSString *)adUnitIdentifier :(NSString *)key :(nullable NSString *)value)
759
- {
758
+ RCT_EXPORT_METHOD(setBannerLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
759
+ {
760
+ NSString *key = parameterDict.allKeys.firstObject;
761
+ id value = parameterDict.allValues.firstObject;
762
+
760
763
  [self setAdViewLocalExtraParameterForAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT key: key value: value];
761
764
  }
762
765
 
@@ -767,7 +770,7 @@ RCT_EXPORT_METHOD(startBannerAutoRefresh:(NSString *)adUnitIdentifier)
767
770
  [self logUninitializedAccessError: @"startBannerAutoRefresh"];
768
771
  return;
769
772
  }
770
-
773
+
771
774
  [self startAutoRefresh: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
772
775
  }
773
776
 
@@ -778,7 +781,7 @@ RCT_EXPORT_METHOD(stopBannerAutoRefresh:(NSString *)adUnitIdentifier)
778
781
  [self logUninitializedAccessError: @"stopBannerAutoRefresh"];
779
782
  return;
780
783
  }
781
-
784
+
782
785
  [self stopAutoRefresh: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
783
786
  }
784
787
 
@@ -789,7 +792,7 @@ RCT_EXPORT_METHOD(showBanner:(NSString *)adUnitIdentifier)
789
792
  [self logUninitializedAccessError: @"showBanner"];
790
793
  return;
791
794
  }
792
-
795
+
793
796
  [self showAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
794
797
  }
795
798
 
@@ -800,7 +803,7 @@ RCT_EXPORT_METHOD(hideBanner:(NSString *)adUnitIdentifier)
800
803
  [self logUninitializedAccessError: @"hideBanner"];
801
804
  return;
802
805
  }
803
-
806
+
804
807
  [self hideAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
805
808
  }
806
809
 
@@ -811,7 +814,7 @@ RCT_EXPORT_METHOD(destroyBanner:(NSString *)adUnitIdentifier)
811
814
  [self logUninitializedAccessError: @"destroyBanner"];
812
815
  return;
813
816
  }
814
-
817
+
815
818
  [self destroyAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
816
819
  }
817
820
 
@@ -829,7 +832,7 @@ RCT_EXPORT_METHOD(createMRec:(NSString *)adUnitIdentifier :(NSString *)mrecPosit
829
832
  [self logUninitializedAccessError: @"createMRec"];
830
833
  return;
831
834
  }
832
-
835
+
833
836
  [self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec atPosition: mrecPosition withOffset: CGPointZero];
834
837
  }
835
838
 
@@ -840,7 +843,7 @@ RCT_EXPORT_METHOD(setMRecPlacement:(NSString *)adUnitIdentifier :(nullable NSStr
840
843
  [self logUninitializedAccessError: @"setMRecPlacement"];
841
844
  return;
842
845
  }
843
-
846
+
844
847
  [self setAdViewPlacement: placement forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
845
848
  }
846
849
 
@@ -851,7 +854,7 @@ RCT_EXPORT_METHOD(setMRecCustomData:(NSString *)adUnitIdentifier :(nullable NSSt
851
854
  [self logUninitializedAccessError: @"setMRecCustomData"];
852
855
  return;
853
856
  }
854
-
857
+
855
858
  [self setAdViewCustomData: customData forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
856
859
  }
857
860
 
@@ -862,17 +865,20 @@ RCT_EXPORT_METHOD(updateMRecPosition:(NSString *)mrecPosition :(NSString *)adUni
862
865
  [self logUninitializedAccessError: @"updateMRecPosition"];
863
866
  return;
864
867
  }
865
-
868
+
866
869
  [self updateAdViewPosition: mrecPosition withOffset: CGPointZero forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
867
870
  }
868
871
 
869
872
  RCT_EXPORT_METHOD(setMRecExtraParameter:(NSString *)adUnitIdentifier :(NSString *)key :(nullable NSString *)value)
870
- {
873
+ {
871
874
  [self setAdViewExtraParameterForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec key: key value: value];
872
875
  }
873
876
 
874
- RCT_EXPORT_METHOD(setMRecLocalExtraParameter:(NSString *)adUnitIdentifier :(NSString *)key :(nullable NSString *)value)
877
+ RCT_EXPORT_METHOD(setMRecLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
875
878
  {
879
+ NSString *key = parameterDict.allKeys.firstObject;
880
+ id value = parameterDict.allValues.firstObject;
881
+
876
882
  [self setAdViewLocalExtraParameterForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec key: key value: value];
877
883
  }
878
884
 
@@ -883,7 +889,7 @@ RCT_EXPORT_METHOD(startMRecAutoRefresh:(NSString *)adUnitIdentifier)
883
889
  [self logUninitializedAccessError: @"startMRecAutoRefresh"];
884
890
  return;
885
891
  }
886
-
892
+
887
893
  [self startAutoRefresh: adUnitIdentifier adFormat: MAAdFormat.mrec];
888
894
  }
889
895
 
@@ -894,7 +900,7 @@ RCT_EXPORT_METHOD(stopMRecAutoRefresh:(NSString *)adUnitIdentifier)
894
900
  [self logUninitializedAccessError: @"stopMRecAutoRefresh"];
895
901
  return;
896
902
  }
897
-
903
+
898
904
  [self stopAutoRefresh: adUnitIdentifier adFormat: MAAdFormat.mrec];
899
905
  }
900
906
 
@@ -905,7 +911,7 @@ RCT_EXPORT_METHOD(showMRec:(NSString *)adUnitIdentifier)
905
911
  [self logUninitializedAccessError: @"showMRec"];
906
912
  return;
907
913
  }
908
-
914
+
909
915
  [self showAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
910
916
  }
911
917
 
@@ -916,7 +922,7 @@ RCT_EXPORT_METHOD(hideMRec:(NSString *)adUnitIdentifier)
916
922
  [self logUninitializedAccessError: @"hideMRec"];
917
923
  return;
918
924
  }
919
-
925
+
920
926
  [self hideAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
921
927
  }
922
928
 
@@ -927,7 +933,7 @@ RCT_EXPORT_METHOD(destroyMRec:(NSString *)adUnitIdentifier)
927
933
  [self logUninitializedAccessError: @"destroyMRec"];
928
934
  return;
929
935
  }
930
-
936
+
931
937
  [self destroyAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
932
938
  }
933
939
 
@@ -940,7 +946,7 @@ RCT_EXPORT_METHOD(loadInterstitial:(NSString *)adUnitIdentifier)
940
946
  [self logUninitializedAccessError: @"loadInterstitial"];
941
947
  return;
942
948
  }
943
-
949
+
944
950
  MAInterstitialAd *interstitial = [self retrieveInterstitialForAdUnitIdentifier: adUnitIdentifier];
945
951
  [interstitial loadAd];
946
952
  }
@@ -953,7 +959,7 @@ RCT_EXPORT_METHOD(isInterstitialReady:(NSString *)adUnitIdentifier :(RCTPromiseR
953
959
  resolve(@(NO));
954
960
  return;
955
961
  }
956
-
962
+
957
963
  MAInterstitialAd *interstitial = [self retrieveInterstitialForAdUnitIdentifier: adUnitIdentifier];
958
964
  resolve(@([interstitial isReady]));
959
965
  }
@@ -965,7 +971,7 @@ RCT_EXPORT_METHOD(showInterstitial:(NSString *)adUnitIdentifier :(nullable NSStr
965
971
  [self logUninitializedAccessError: @"showInterstitial"];
966
972
  return;
967
973
  }
968
-
974
+
969
975
  MAInterstitialAd *interstitial = [self retrieveInterstitialForAdUnitIdentifier: adUnitIdentifier];
970
976
  [interstitial showAdForPlacement: placement customData: customData];
971
977
  }
@@ -977,13 +983,16 @@ RCT_EXPORT_METHOD(setInterstitialExtraParameter:(NSString *)adUnitIdentifier :(N
977
983
  [self logUninitializedAccessError: @"setInterstitialExtraParameter"];
978
984
  return;
979
985
  }
980
-
986
+
981
987
  MAInterstitialAd *interstitial = [self retrieveInterstitialForAdUnitIdentifier: adUnitIdentifier];
982
988
  [interstitial setExtraParameterForKey: key value: value];
983
989
  }
984
990
 
985
- RCT_EXPORT_METHOD(setInterstitialLocalExtraParameter:(NSString *)adUnitIdentifier :(NSString *)key :(nullable NSString *)value)
991
+ RCT_EXPORT_METHOD(setInterstitialLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
986
992
  {
993
+ NSString *key = parameterDict.allKeys.firstObject;
994
+ id value = parameterDict.allValues.firstObject;
995
+
987
996
  MAInterstitialAd *interstitial = [self retrieveInterstitialForAdUnitIdentifier: adUnitIdentifier];
988
997
  [interstitial setLocalExtraParameterForKey: key value: value];
989
998
  }
@@ -997,7 +1006,7 @@ RCT_EXPORT_METHOD(loadRewardedAd:(NSString *)adUnitIdentifier)
997
1006
  [self logUninitializedAccessError: @"loadRewardedAd"];
998
1007
  return;
999
1008
  }
1000
-
1009
+
1001
1010
  MARewardedAd *rewardedAd = [self retrieveRewardedAdForAdUnitIdentifier: adUnitIdentifier];
1002
1011
  [rewardedAd loadAd];
1003
1012
  }
@@ -1010,7 +1019,7 @@ RCT_EXPORT_METHOD(isRewardedAdReady:(NSString *)adUnitIdentifier :(RCTPromiseRes
1010
1019
  resolve(@(NO));
1011
1020
  return;
1012
1021
  }
1013
-
1022
+
1014
1023
  MARewardedAd *rewardedAd = [self retrieveRewardedAdForAdUnitIdentifier: adUnitIdentifier];
1015
1024
  resolve(@([rewardedAd isReady]));
1016
1025
  }
@@ -1022,7 +1031,7 @@ RCT_EXPORT_METHOD(showRewardedAd:(NSString *)adUnitIdentifier :(nullable NSStrin
1022
1031
  [self logUninitializedAccessError: @"showRewardedAd"];
1023
1032
  return;
1024
1033
  }
1025
-
1034
+
1026
1035
  MARewardedAd *rewardedAd = [self retrieveRewardedAdForAdUnitIdentifier: adUnitIdentifier];
1027
1036
  [rewardedAd showAdForPlacement: placement customData: customData];
1028
1037
  }
@@ -1034,13 +1043,16 @@ RCT_EXPORT_METHOD(setRewardedAdExtraParameter:(NSString *)adUnitIdentifier :(NSS
1034
1043
  [self logUninitializedAccessError: @"setRewardedAdExtraParameter"];
1035
1044
  return;
1036
1045
  }
1037
-
1046
+
1038
1047
  MARewardedAd *rewardedAd = [self retrieveRewardedAdForAdUnitIdentifier: adUnitIdentifier];
1039
1048
  [rewardedAd setExtraParameterForKey: key value: value];
1040
1049
  }
1041
1050
 
1042
- RCT_EXPORT_METHOD(setRewardedAdLocalExtraParameter:(NSString *)adUnitIdentifier :(NSString *)key :(nullable NSString *)value)
1051
+ RCT_EXPORT_METHOD(setRewardedAdLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
1043
1052
  {
1053
+ NSString *key = parameterDict.allKeys.firstObject;
1054
+ id value = parameterDict.allValues.firstObject;
1055
+
1044
1056
  MARewardedAd *rewardedAd = [self retrieveRewardedAdForAdUnitIdentifier: adUnitIdentifier];
1045
1057
  [rewardedAd setLocalExtraParameterForKey: key value: value];
1046
1058
  }
@@ -1054,7 +1066,7 @@ RCT_EXPORT_METHOD(loadAppOpenAd:(NSString *)adUnitIdentifier)
1054
1066
  [self logUninitializedAccessError: @"loadAppOpenAd"];
1055
1067
  return;
1056
1068
  }
1057
-
1069
+
1058
1070
  MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
1059
1071
  [appOpenAd loadAd];
1060
1072
  }
@@ -1067,7 +1079,7 @@ RCT_EXPORT_METHOD(isAppOpenAdReady:(NSString *)adUnitIdentifier :(RCTPromiseReso
1067
1079
  resolve(@(NO));
1068
1080
  return;
1069
1081
  }
1070
-
1082
+
1071
1083
  MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
1072
1084
  resolve(@([appOpenAd isReady]));
1073
1085
  }
@@ -1079,7 +1091,7 @@ RCT_EXPORT_METHOD(showAppOpenAd:(NSString *)adUnitIdentifier placement:(nullable
1079
1091
  [self logUninitializedAccessError: @"showAppOpenAd"];
1080
1092
  return;
1081
1093
  }
1082
-
1094
+
1083
1095
  MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
1084
1096
  [appOpenAd showAdForPlacement: placement customData: customData];
1085
1097
  }
@@ -1091,13 +1103,16 @@ RCT_EXPORT_METHOD(setAppOpenAdExtraParameter:(NSString *)adUnitIdentifier key:(N
1091
1103
  [self logUninitializedAccessError: @"setAppOpenAdExtraParameter"];
1092
1104
  return;
1093
1105
  }
1094
-
1106
+
1095
1107
  MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
1096
1108
  [appOpenAd setExtraParameterForKey: key value: value];
1097
1109
  }
1098
1110
 
1099
- RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value)
1111
+ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
1100
1112
  {
1113
+ NSString *key = parameterDict.allKeys.firstObject;
1114
+ id value = parameterDict.allValues.firstObject;
1115
+
1101
1116
  MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
1102
1117
  [appOpenAd setLocalExtraParameterForKey: key value: value];
1103
1118
  }
@@ -1435,9 +1450,9 @@ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier k
1435
1450
  - (void)setAdViewCustomData:(nullable NSString *)customData forAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat
1436
1451
  {
1437
1452
  dispatch_async(dispatch_get_main_queue(), ^{
1438
-
1453
+
1439
1454
  [self log: @"Setting custom data \"%@\" for \"%@\" with ad unit identifier \"%@\"", customData, adFormat, adUnitIdentifier];
1440
-
1455
+
1441
1456
  MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: @"" withOffset: CGPointZero];
1442
1457
  adView.customData = customData;
1443
1458
  });
@@ -1512,7 +1527,7 @@ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier k
1512
1527
  });
1513
1528
  }
1514
1529
 
1515
- - (void)setAdViewLocalExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat key:(NSString *)key value:(nullable NSString *)value
1530
+ - (void)setAdViewLocalExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat key:(NSString *)key value:(nullable id)value
1516
1531
  {
1517
1532
  dispatch_async(dispatch_get_main_queue(), ^{
1518
1533
 
@@ -1665,7 +1680,7 @@ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier k
1665
1680
 
1666
1681
  // Set this extra parameter to work around a SDK bug that ignores calls to stopAutoRefresh()
1667
1682
  [result setExtraParameterForKey: @"allow_pause_auto_refresh_immediately" value: @"true"];
1668
-
1683
+
1669
1684
  self.adViews[adUnitIdentifier] = result;
1670
1685
  self.adViewPositions[adUnitIdentifier] = adViewPosition;
1671
1686
  self.adViewOffsets[adUnitIdentifier] = [NSValue valueWithCGPoint: offset];
@@ -1878,7 +1893,7 @@ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier k
1878
1893
  {
1879
1894
  [settings setExtraParameterForKey: key value: self.extraParametersToSet[key]];
1880
1895
  }
1881
-
1896
+
1882
1897
  [self.extraParametersToSet removeAllObjects];
1883
1898
  }
1884
1899
 
@@ -1937,7 +1952,7 @@ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier k
1937
1952
  {
1938
1953
  return @"O";
1939
1954
  }
1940
-
1955
+
1941
1956
  return @"U";
1942
1957
  }
1943
1958
 
@@ -1980,20 +1995,24 @@ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier k
1980
1995
  - (NSDictionary<NSString *, id> *)adLoadFailedInfoForAd:(NSString *)adUnitIdentifier withError:(MAError *)error
1981
1996
  {
1982
1997
  return ( error ) ?
1983
- @{@"adUnitId": adUnitIdentifier,
1984
- @"code" : @(error.code),
1985
- @"message" : error.message,
1986
- @"adLoadFailureInfo" : error.adLoadFailureInfo ?: @"",
1987
- @"waterfall": [self createAdWaterfallInfo: error.waterfall]}
1998
+ @{@"adUnitId": adUnitIdentifier,
1999
+ @"code" : @(error.code),
2000
+ @"message" : error.message,
2001
+ @"mediatedNetworkErrorCode" : @(error.mediatedNetworkErrorCode),
2002
+ @"mediatedNetworkErrorMessage" : error.mediatedNetworkErrorMessage,
2003
+ @"adLoadFailureInfo" : error.adLoadFailureInfo ?: @"",
2004
+ @"waterfall": [self createAdWaterfallInfo: error.waterfall]}
1988
2005
  :
1989
- @{@"adUnitId": adUnitIdentifier,
1990
- @"code" : @(MAErrorCodeUnspecified)};
2006
+ @{@"adUnitId": adUnitIdentifier,
2007
+ @"code" : @(MAErrorCodeUnspecified)};
1991
2008
  }
1992
2009
 
1993
2010
  - (NSDictionary<NSString *, id> *)adDisplayFailedInfoForAd:(MAAd *)ad withError:(MAError *)error
1994
2011
  {
1995
2012
  NSMutableDictionary *body = [@{@"code" : @(error.code),
1996
- @"message" : error.message} mutableCopy];
2013
+ @"message" : error.message,
2014
+ @"mediatedNetworkErrorCode" : @(error.mediatedNetworkErrorCode),
2015
+ @"mediatedNetworkErrorMessage" : error.mediatedNetworkErrorMessage} mutableCopy];
1997
2016
  [body addEntriesFromDictionary: [self adInfoForAd: ad]];
1998
2017
  return body;
1999
2018
  }
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.11.2'
38
+ pod 'AppLovinSDK', '11.11.3'
39
39
 
40
40
  end
package/ios/Podfile.lock CHANGED
@@ -1,5 +1,5 @@
1
1
  PODS:
2
- - AppLovinSDK (11.11.2)
2
+ - AppLovinSDK (11.11.3)
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.11.2)
252
+ - AppLovinSDK (= 11.11.3)
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: 86ac2d11e3fda1d2cb5b235fb8a4bbd39ab0ebee
342
+ AppLovinSDK: 623ef78363c0dd2c3ff5446cde37e4920a96b7e0
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: 918bd86877e7473a96702715175257e8c0f3b466
371
+ PODFILE CHECKSUM: 0e638fe64c425ebeff3ccbfd5c809f3b35246730
372
372
 
373
- COCOAPODS: 1.11.3
373
+ COCOAPODS: 1.12.1
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.6.0",
4
+ "version": "5.7.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 => "release_5_6_0" }
14
+ s.source = { :git => "https://github.com/AppLovin/AppLovin-MAX-React-Native.git", :tag => "release_5_7_0" }
15
15
 
16
16
  s.source_files = "ios/AppLovinMAX*.{h,m}"
17
17
 
18
18
  s.dependency "React"
19
- s.dependency "AppLovinSDK", "11.11.2"
19
+ s.dependency "AppLovinSDK", "11.11.3"
20
20
  end
package/src/index.js CHANGED
@@ -6,7 +6,7 @@ import EventListeners from "./AppLovinMAXEventListeners";
6
6
 
7
7
  const { AppLovinMAX } = NativeModules;
8
8
 
9
- const VERSION = "5.6.0";
9
+ const VERSION = "5.7.0";
10
10
 
11
11
  /*---------*/
12
12
  /* BANNERS */
@@ -22,12 +22,7 @@ const setBannerExtraParameter = (adUnitId, key, value) => {
22
22
  }
23
23
 
24
24
  const setBannerLocalExtraParameter = (adUnitId, key, value) => {
25
- if ((value !== null) && (value !== undefined) && (typeof value !== 'string')) {
26
- console.warn("setBannerLocalExtraParameter() supports only string values: " + value);
27
- return;
28
- }
29
-
30
- AppLovinMAX.setBannerLocalExtraParameter(adUnitId, key, value);
25
+ AppLovinMAX.setBannerLocalExtraParameter(adUnitId, {key:value});
31
26
  }
32
27
 
33
28
  /*-------*/
@@ -44,12 +39,7 @@ const setMRecExtraParameter = (adUnitId, key, value) => {
44
39
  }
45
40
 
46
41
  const setMRecLocalExtraParameter = (adUnitId, key, value) => {
47
- if ((value !== null) && (value !== undefined) && (typeof value !== 'string')) {
48
- console.warn("setMRecLocalExtraParameter() supports only string values: " + value);
49
- return;
50
- }
51
-
52
- AppLovinMAX.setMRecLocalExtraParameter(adUnitId, key, value);
42
+ AppLovinMAX.setMRecLocalExtraParameter(adUnitId, {key:value});
53
43
  }
54
44
 
55
45
  /*---------------*/
@@ -83,12 +73,7 @@ const setInterstitialExtraParameter = (adUnitId, key, value) => {
83
73
  }
84
74
 
85
75
  const setInterstitialLocalExtraParameter = (adUnitId, key, value) => {
86
- if ((value !== null) && (value !== undefined) && (typeof value !== 'string')) {
87
- console.warn("setInterstitialLocalExtraParameter() supports only string values: " + value);
88
- return;
89
- }
90
-
91
- AppLovinMAX.setInterstitialLocalExtraParameter(adUnitId, key, value);
76
+ AppLovinMAX.setInterstitialLocalExtraParameter(adUnitId, {key:value});
92
77
  }
93
78
 
94
79
  /*----------*/
@@ -122,12 +107,7 @@ const setRewardedAdExtraParameter = (adUnitId, key, value) => {
122
107
  }
123
108
 
124
109
  const setRewardedAdLocalExtraParameter = (adUnitId, key, value) => {
125
- if ((value !== null) && (value !== undefined) && (typeof value !== 'string')) {
126
- console.warn("setRewardedAdLocalExtraParameter() supports only string values: " + value);
127
- return;
128
- }
129
-
130
- AppLovinMAX.setRewardedAdLocalExtraParameter(adUnitId, key, value);
110
+ AppLovinMAX.setRewardedAdLocalExtraParameter(adUnitId, {key:value});
131
111
  }
132
112
 
133
113
  /*----------*/
@@ -161,12 +141,7 @@ const setAppOpenAdExtraParameter = (adUnitId, key, value) => {
161
141
  }
162
142
 
163
143
  const setAppOpenAdLocalExtraParameter = (adUnitId, key, value) => {
164
- if ((value !== null) && (value !== undefined) && (typeof value !== 'string')) {
165
- console.warn("setAppOpenAdLocalExtraParameter() supports only string values: " + value);
166
- return;
167
- }
168
-
169
- AppLovinMAX.setAppOpenAdLocalExtraParameter(adUnitId, key, value);
144
+ AppLovinMAX.setAppOpenAdLocalExtraParameter(adUnitId, {key:value});
170
145
  }
171
146
 
172
147
  export default {