react-native-applovin-max 4.1.6 → 5.0.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.
@@ -43,10 +43,9 @@ import com.applovin.sdk.AppLovinSdk;
43
43
  import com.applovin.sdk.AppLovinSdkConfiguration;
44
44
  import com.applovin.sdk.AppLovinSdkSettings;
45
45
  import com.applovin.sdk.AppLovinSdkUtils;
46
- import com.applovin.sdk.AppLovinUserService;
47
46
  import com.facebook.react.bridge.Arguments;
48
- import com.facebook.react.bridge.Callback;
49
47
  import com.facebook.react.bridge.LifecycleEventListener;
48
+ import com.facebook.react.bridge.Promise;
50
49
  import com.facebook.react.bridge.ReactApplicationContext;
51
50
  import com.facebook.react.bridge.ReactContextBaseJavaModule;
52
51
  import com.facebook.react.bridge.ReactMethod;
@@ -80,6 +79,55 @@ public class AppLovinMAXModule
80
79
  private static final String SDK_TAG = "AppLovinSdk";
81
80
  private static final String TAG = "AppLovinMAXModule";
82
81
 
82
+ private static final String ON_BANNER_AD_LOADED_EVENT = "OnBannerAdLoadedEvent";
83
+ private static final String ON_BANNER_AD_LOAD_FAILED_EVENT = "OnBannerAdLoadFailedEvent";
84
+ private static final String ON_BANNER_AD_CLICKED_EVENT = "OnBannerAdClickedEvent";
85
+ private static final String ON_BANNER_AD_COLLAPSED_EVENT = "OnBannerAdCollapsedEvent";
86
+ private static final String ON_BANNER_AD_EXPANDED_EVENT = "OnBannerAdExpandedEvent";
87
+ private static final String ON_BANNER_AD_REVENUE_PAID = "OnBannerAdRevenuePaid";
88
+
89
+ private static final String ON_MREC_AD_LOADED_EVENT = "OnMRecAdLoadedEvent";
90
+ private static final String ON_MREC_AD_LOAD_FAILED_EVENT = "OnMRecAdLoadFailedEvent";
91
+ private static final String ON_MREC_AD_CLICKED_EVENT = "OnMRecAdClickedEvent";
92
+ private static final String ON_MREC_AD_COLLAPSED_EVENT = "OnMRecAdCollapsedEvent";
93
+ private static final String ON_MREC_AD_EXPANDED_EVENT = "OnMRecAdExpandedEvent";
94
+ private static final String ON_MREC_AD_REVENUE_PAID = "OnMRecAdRevenuePaid";
95
+
96
+ private static final String ON_INTERSTITIAL_LOADED_EVENT = "OnInterstitialLoadedEvent";
97
+ private static final String ON_INTERSTITIAL_LOAD_FAILED_EVENT = "OnInterstitialLoadFailedEvent";
98
+ private static final String ON_INTERSTITIAL_CLICKED_EVENT = "OnInterstitialClickedEvent";
99
+ private static final String ON_INTERSTITIAL_DISPLAYED_EVENT = "OnInterstitialDisplayedEvent";
100
+ private static final String ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT = "OnInterstitialAdFailedToDisplayEvent";
101
+ private static final String ON_INTERSTITIAL_HIDDEN_EVENT = "OnInterstitialHiddenEvent";
102
+ private static final String ON_INTERSTITIAL_AD_REVENUE_PAID = "OnInterstitialAdRevenuePaid";
103
+
104
+ private static final String ON_REWARDED_AD_LOADED_EVENT = "OnRewardedAdLoadedEvent";
105
+ private static final String ON_REWARDED_AD_LOAD_FAILED_EVENT = "OnRewardedAdLoadFailedEvent";
106
+ private static final String ON_REWARDED_AD_CLICKED_EVENT = "OnRewardedAdClickedEvent";
107
+ private static final String ON_REWARDED_AD_DISPLAYED_EVENT = "OnRewardedAdDisplayedEvent";
108
+ private static final String ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT = "OnRewardedAdFailedToDisplayEvent";
109
+ private static final String ON_REWARDED_AD_HIDDEN_EVENT = "OnRewardedAdHiddenEvent";
110
+ private static final String ON_REWARDED_AD_RECEIVED_REWARD_EVENT = "OnRewardedAdReceivedRewardEvent";
111
+ private static final String ON_REWARDED_AD_REVENUE_PAID = "OnRewardedAdRevenuePaid";
112
+
113
+ private static final String ON_APPOPEN_AD_LOADED_EVENT = "OnAppOpenAdLoadedEvent";
114
+ private static final String ON_APPOPEN_AD_LOAD_FAILED_EVENT = "OnAppOpenAdLoadFailedEvent";
115
+ private static final String ON_APPOPEN_AD_CLICKED_EVENT = "OnAppOpenAdClickedEvent";
116
+ private static final String ON_APPOPEN_AD_DISPLAYED_EVENT = "OnAppOpenAdDisplayedEvent";
117
+ private static final String ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT = "OnAppOpenAdFailedToDisplayEvent";
118
+ private static final String ON_APPOPEN_AD_HIDDEN_EVENT = "OnAppOpenAdHiddenEvent";
119
+ private static final String ON_APPOPEN_AD_REVENUE_PAID = "OnAppOpenAdRevenuePaid";
120
+
121
+ private static final String TOP_CENTER = "top_center";
122
+ private static final String TOP_LEFT = "top_left";
123
+ private static final String TOP_RIGHT = "top_right";
124
+ private static final String CENTERED = "centered";
125
+ private static final String CENTER_LEFT = "center_left";
126
+ private static final String CENTER_RIGHT = "center_right";
127
+ private static final String BOTTOM_LEFT = "bottom_left";
128
+ private static final String BOTTOM_CENTER = "bottom_center";
129
+ private static final String BOTTOM_RIGHT = "bottom_right";
130
+
83
131
  private static final Point DEFAULT_AD_VIEW_OFFSET = new Point( 0, 0 );
84
132
 
85
133
  public static AppLovinMAXModule instance;
@@ -102,13 +150,13 @@ public class AppLovinMAXModule
102
150
  private Boolean locationCollectionEnabledToSet;
103
151
  private final Map<String, String> extraParametersToSet = new HashMap<>( 8 );
104
152
 
105
- private Integer targetingYearOfBirthToSet;
106
- private String targetingGenderToSet;
107
- private Integer targetingMaximumAdContentRatingToSet;
108
- private String targetingEmailToSet;
109
- private String targetingPhoneNumberToSet;
110
- private ReadableArray targetingKeywordsToSet;
111
- private ReadableArray targetingInterestsToSet;
153
+ private Integer targetingYearOfBirthToSet;
154
+ private String targetingGenderToSet;
155
+ private Integer targetingMaximumAdContentRatingToSet;
156
+ private String targetingEmailToSet;
157
+ private String targetingPhoneNumberToSet;
158
+ private List targetingKeywordsToSet;
159
+ private List targetingInterestsToSet;
112
160
 
113
161
  // Fullscreen Ad Fields
114
162
  private final Map<String, MaxInterstitialAd> mInterstitials = new HashMap<>( 2 );
@@ -167,20 +215,20 @@ public class AppLovinMAXModule
167
215
  return sCurrentActivity;
168
216
  }
169
217
 
170
- @ReactMethod(isBlockingSynchronousMethod = true)
171
- public boolean isInitialized()
218
+ @ReactMethod
219
+ public void isInitialized(final Promise promise)
172
220
  {
173
- return isPluginInitialized && isSdkInitialized;
221
+ promise.resolve( isPluginInitialized && isSdkInitialized );
174
222
  }
175
223
 
176
224
  @ReactMethod
177
- public void initialize(final String pluginVersion, final String sdkKey, final Callback callback)
225
+ public void initialize(final String pluginVersion, final String sdkKey, final Promise promise)
178
226
  {
179
227
  // Check if Activity is available
180
228
  Activity currentActivity = maybeGetCurrentActivity();
181
229
  if ( currentActivity != null )
182
230
  {
183
- performInitialization( pluginVersion, sdkKey, currentActivity, callback );
231
+ performInitialization( pluginVersion, sdkKey, currentActivity, promise );
184
232
  }
185
233
  else
186
234
  {
@@ -198,13 +246,13 @@ public class AppLovinMAXModule
198
246
  contextToUse = getReactApplicationContext();
199
247
  }
200
248
 
201
- performInitialization( pluginVersion, sdkKey, contextToUse, callback );
249
+ performInitialization( pluginVersion, sdkKey, contextToUse, promise );
202
250
  }
203
251
  }, TimeUnit.SECONDS.toMillis( 3 ) );
204
252
  }
205
253
  }
206
254
 
207
- private void performInitialization(final String pluginVersion, final String sdkKey, final Context context, final Callback callback)
255
+ private void performInitialization(final String pluginVersion, final String sdkKey, final Context context, final Promise promise)
208
256
  {
209
257
  // Guard against running init logic multiple times
210
258
  if ( isPluginInitialized ) return;
@@ -233,7 +281,8 @@ public class AppLovinMAXModule
233
281
 
234
282
  if ( TextUtils.isEmpty( sdkKeyToUse ) )
235
283
  {
236
- throw new IllegalStateException( "Unable to initialize AppLovin SDK - no SDK key provided and not found in Android Manifest!" );
284
+ promise.reject( new IllegalStateException( "Unable to initialize AppLovin SDK - no SDK key provided and not found in Android Manifest!" ) );
285
+ return;
237
286
  }
238
287
  }
239
288
 
@@ -309,13 +358,13 @@ public class AppLovinMAXModule
309
358
 
310
359
  if ( targetingKeywordsToSet != null )
311
360
  {
312
- sdk.getTargetingData().setKeywords( getStringArrayList( targetingKeywordsToSet ) );
361
+ sdk.getTargetingData().setKeywords( targetingKeywordsToSet );
313
362
  targetingKeywordsToSet = null;
314
363
  }
315
364
 
316
365
  if ( targetingInterestsToSet != null )
317
366
  {
318
- sdk.getTargetingData().setInterests( getStringArrayList( targetingInterestsToSet ) );
367
+ sdk.getTargetingData().setInterests( targetingInterestsToSet );
319
368
  targetingInterestsToSet = null;
320
369
  }
321
370
 
@@ -354,20 +403,19 @@ public class AppLovinMAXModule
354
403
  }.enable();
355
404
 
356
405
  WritableMap sdkConfiguration = Arguments.createMap();
357
- sdkConfiguration.putInt( "consentDialogState", configuration.getConsentDialogState().ordinal() );
358
406
  sdkConfiguration.putString( "countryCode", configuration.getCountryCode() );
359
- callback.invoke( sdkConfiguration );
407
+ promise.resolve( sdkConfiguration );
360
408
  }
361
409
  } );
362
410
  }
363
411
 
364
412
  // General Public API
365
413
 
366
- @ReactMethod(isBlockingSynchronousMethod = true)
367
- public boolean isTablet()
414
+ @ReactMethod
415
+ public void isTablet(final Promise promise)
368
416
  {
369
417
  Context contextToUse = ( maybeGetCurrentActivity() != null ) ? maybeGetCurrentActivity() : getReactApplicationContext();
370
- return AppLovinSdkUtils.isTablet( contextToUse );
418
+ promise.resolve( AppLovinSdkUtils.isTablet( contextToUse ) );
371
419
  }
372
420
 
373
421
  @ReactMethod
@@ -382,70 +430,43 @@ public class AppLovinMAXModule
382
430
  sdk.showMediationDebugger();
383
431
  }
384
432
 
385
- @ReactMethod()
386
- public void showConsentDialog(final Callback callback)
387
- {
388
- if ( sdk == null )
389
- {
390
- logUninitializedAccessError( "showConsentDialog" );
391
- return;
392
- }
393
-
394
- sdk.getUserService().showConsentDialog( maybeGetCurrentActivity(), new AppLovinUserService.OnConsentDialogDismissListener()
395
- {
396
- @Override
397
- public void onDismiss()
398
- {
399
- callback.invoke();
400
- }
401
- } );
402
- }
403
-
404
- @ReactMethod(isBlockingSynchronousMethod = true)
405
- public int getConsentDialogState()
406
- {
407
- if ( !isInitialized() ) return AppLovinSdkConfiguration.ConsentDialogState.UNKNOWN.ordinal();
408
-
409
- return sdkConfiguration.getConsentDialogState().ordinal();
410
- }
411
-
412
- @ReactMethod()
413
- public void setHasUserConsent(boolean hasUserConsent)
433
+ @ReactMethod
434
+ public void setHasUserConsent(final boolean hasUserConsent)
414
435
  {
415
436
  AppLovinPrivacySettings.setHasUserConsent( hasUserConsent, maybeGetCurrentActivity() );
416
437
  }
417
438
 
418
- @ReactMethod(isBlockingSynchronousMethod = true)
419
- public boolean hasUserConsent()
439
+ @ReactMethod
440
+ public void hasUserConsent(final Promise promise)
420
441
  {
421
- return AppLovinPrivacySettings.hasUserConsent( maybeGetCurrentActivity() );
442
+ promise.resolve( AppLovinPrivacySettings.hasUserConsent( maybeGetCurrentActivity() ) );
422
443
  }
423
444
 
424
- @ReactMethod()
425
- public void setIsAgeRestrictedUser(boolean isAgeRestrictedUser)
445
+ @ReactMethod
446
+ public void setIsAgeRestrictedUser(final boolean isAgeRestrictedUser)
426
447
  {
427
448
  AppLovinPrivacySettings.setIsAgeRestrictedUser( isAgeRestrictedUser, maybeGetCurrentActivity() );
428
449
  }
429
450
 
430
- @ReactMethod(isBlockingSynchronousMethod = true)
431
- public boolean isAgeRestrictedUser()
451
+ @ReactMethod
452
+ public void isAgeRestrictedUser(final Promise promise)
432
453
  {
433
- return AppLovinPrivacySettings.isAgeRestrictedUser( maybeGetCurrentActivity() );
454
+ promise.resolve( AppLovinPrivacySettings.isAgeRestrictedUser( maybeGetCurrentActivity() ) );
434
455
  }
435
456
 
436
- @ReactMethod()
457
+ @ReactMethod
437
458
  public void setDoNotSell(final boolean doNotSell)
438
459
  {
439
460
  AppLovinPrivacySettings.setDoNotSell( doNotSell, maybeGetCurrentActivity() );
440
461
  }
441
462
 
442
- @ReactMethod(isBlockingSynchronousMethod = true)
443
- public boolean isDoNotSell()
463
+ @ReactMethod
464
+ public void isDoNotSell(final Promise promise)
444
465
  {
445
- return AppLovinPrivacySettings.isDoNotSell( maybeGetCurrentActivity() );
466
+ promise.resolve( AppLovinPrivacySettings.isDoNotSell( maybeGetCurrentActivity() ) );
446
467
  }
447
468
 
448
- @ReactMethod()
469
+ @ReactMethod
449
470
  public void setUserId(String userId)
450
471
  {
451
472
  if ( isPluginInitialized )
@@ -459,7 +480,7 @@ public class AppLovinMAXModule
459
480
  }
460
481
  }
461
482
 
462
- @ReactMethod()
483
+ @ReactMethod
463
484
  public void setMuted(final boolean muted)
464
485
  {
465
486
  if ( !isPluginInitialized ) return;
@@ -467,15 +488,13 @@ public class AppLovinMAXModule
467
488
  sdk.getSettings().setMuted( muted );
468
489
  }
469
490
 
470
- @ReactMethod(isBlockingSynchronousMethod = true)
471
- public boolean isMuted()
491
+ @ReactMethod
492
+ public void isMuted(final Promise promise)
472
493
  {
473
- if ( !isPluginInitialized ) return false;
474
-
475
- return sdk.getSettings().isMuted();
494
+ promise.resolve( isPluginInitialized ? sdk.getSettings().isMuted() : false );
476
495
  }
477
496
 
478
- @ReactMethod()
497
+ @ReactMethod
479
498
  public void setVerboseLogging(final boolean enabled)
480
499
  {
481
500
  if ( isPluginInitialized )
@@ -489,7 +508,7 @@ public class AppLovinMAXModule
489
508
  }
490
509
  }
491
510
 
492
- @ReactMethod()
511
+ @ReactMethod
493
512
  public void setCreativeDebuggerEnabled(final boolean enabled)
494
513
  {
495
514
  if ( isPluginInitialized )
@@ -503,7 +522,7 @@ public class AppLovinMAXModule
503
522
  }
504
523
  }
505
524
 
506
- @ReactMethod()
525
+ @ReactMethod
507
526
  public void setTestDeviceAdvertisingIds(final ReadableArray rawAdvertisingIds)
508
527
  {
509
528
  List<String> advertisingIds = new ArrayList<>( rawAdvertisingIds.size() );
@@ -525,7 +544,7 @@ public class AppLovinMAXModule
525
544
  }
526
545
  }
527
546
 
528
- @ReactMethod()
547
+ @ReactMethod
529
548
  public void setExtraParameter(final String key, @Nullable final String value)
530
549
  {
531
550
  if ( TextUtils.isEmpty( key ) )
@@ -546,18 +565,18 @@ public class AppLovinMAXModule
546
565
  }
547
566
  }
548
567
 
549
- @ReactMethod()
568
+ @ReactMethod
550
569
  public void setConsentFlowEnabled(final boolean enabled) { }
551
570
 
552
- @ReactMethod()
571
+ @ReactMethod
553
572
  public void setPrivacyPolicyUrl(final String urlString) { }
554
573
 
555
- @ReactMethod()
574
+ @ReactMethod
556
575
  public void setTermsOfServiceUrl(final String urlString) { }
557
576
 
558
577
  // Data Passing
559
578
 
560
- @ReactMethod()
579
+ @ReactMethod
561
580
  public void setTargetingDataYearOfBirth(final int yearOfBirth)
562
581
  {
563
582
  if ( sdk == null )
@@ -569,7 +588,20 @@ public class AppLovinMAXModule
569
588
  sdk.getTargetingData().setYearOfBirth( yearOfBirth <= 0 ? null : yearOfBirth );
570
589
  }
571
590
 
572
- @ReactMethod()
591
+ @ReactMethod
592
+ public void getTargetingDataYearOfBirth(final Promise promise)
593
+ {
594
+ if ( sdk == null )
595
+ {
596
+ promise.resolve( targetingYearOfBirthToSet == null ? 0 : targetingYearOfBirthToSet );
597
+ return;
598
+ }
599
+
600
+ Integer yearOfBirth = sdk.getTargetingData().getYearOfBirth();
601
+ promise.resolve( yearOfBirth != null ? yearOfBirth : 0 );
602
+ }
603
+
604
+ @ReactMethod
573
605
  public void setTargetingDataGender(@Nullable final String gender)
574
606
  {
575
607
  if ( sdk == null )
@@ -581,7 +613,26 @@ public class AppLovinMAXModule
581
613
  sdk.getTargetingData().setGender( getAppLovinGender( gender ) );
582
614
  }
583
615
 
584
- @ReactMethod()
616
+ @ReactMethod
617
+ public void getTargetingDataGender(final Promise promise)
618
+ {
619
+ if ( sdk == null )
620
+ {
621
+ promise.resolve( targetingGenderToSet == null ? "U" : targetingGenderToSet );
622
+ return;
623
+ }
624
+
625
+ if ( sdk.getTargetingData().getGender() == null )
626
+ {
627
+ promise.resolve( "U" );
628
+ }
629
+ else
630
+ {
631
+ promise.resolve( getRawAppLovinGender( sdk.getTargetingData().getGender() ) );
632
+ }
633
+ }
634
+
635
+ @ReactMethod
585
636
  public void setTargetingDataMaximumAdContentRating(final int maximumAdContentRating)
586
637
  {
587
638
  if ( sdk == null )
@@ -593,7 +644,26 @@ public class AppLovinMAXModule
593
644
  sdk.getTargetingData().setMaximumAdContentRating( getAppLovinAdContentRating( maximumAdContentRating ) );
594
645
  }
595
646
 
596
- @ReactMethod()
647
+ @ReactMethod
648
+ public void getTargetingDataMaximumAdContentRating(final Promise promise)
649
+ {
650
+ if ( sdk == null )
651
+ {
652
+ promise.resolve( targetingMaximumAdContentRatingToSet == null ? 0 : targetingMaximumAdContentRatingToSet );
653
+ return;
654
+ }
655
+
656
+ if ( sdk.getTargetingData().getMaximumAdContentRating() == null )
657
+ {
658
+ promise.resolve( 0 );
659
+ }
660
+ else
661
+ {
662
+ promise.resolve( sdk.getTargetingData().getMaximumAdContentRating().ordinal() );
663
+ }
664
+ }
665
+
666
+ @ReactMethod
597
667
  public void setTargetingDataEmail(@Nullable final String email)
598
668
  {
599
669
  if ( sdk == null )
@@ -605,7 +675,19 @@ public class AppLovinMAXModule
605
675
  sdk.getTargetingData().setEmail( email );
606
676
  }
607
677
 
608
- @ReactMethod()
678
+ @ReactMethod
679
+ public void getTargetingDataEmail(final Promise promise)
680
+ {
681
+ if ( sdk == null )
682
+ {
683
+ promise.resolve( targetingEmailToSet );
684
+ return;
685
+ }
686
+
687
+ promise.resolve( sdk.getTargetingData().getEmail() );
688
+ }
689
+
690
+ @ReactMethod
609
691
  public void setTargetingDataPhoneNumber(@Nullable final String phoneNumber)
610
692
  {
611
693
  if ( sdk == null )
@@ -617,31 +699,99 @@ public class AppLovinMAXModule
617
699
  sdk.getTargetingData().setPhoneNumber( phoneNumber );
618
700
  }
619
701
 
620
- @ReactMethod()
702
+ @ReactMethod
703
+ public void getTargetingDataPhoneNumber(final Promise promise)
704
+ {
705
+ if ( sdk == null )
706
+ {
707
+ promise.resolve( targetingPhoneNumberToSet );
708
+ return;
709
+ }
710
+
711
+ promise.resolve( sdk.getTargetingData().getPhoneNumber() );
712
+ }
713
+
714
+ @ReactMethod
621
715
  public void setTargetingDataKeywords(@Nullable final ReadableArray rawKeywords)
622
716
  {
623
717
  if ( sdk == null )
624
718
  {
625
- targetingKeywordsToSet = rawKeywords;
719
+ targetingKeywordsToSet = Arguments.toList( rawKeywords );
626
720
  return;
627
721
  }
628
722
 
629
- sdk.getTargetingData().setKeywords( getStringArrayList( rawKeywords ) );
723
+ sdk.getTargetingData().setKeywords( Arguments.toList( rawKeywords ) );
724
+ }
725
+
726
+ @ReactMethod
727
+ public void getTargetingDataKeywords(final Promise promise)
728
+ {
729
+ if ( sdk == null )
730
+ {
731
+ if ( targetingKeywordsToSet == null || targetingKeywordsToSet.size() == 0 )
732
+ {
733
+ promise.resolve( null );
734
+ }
735
+ else
736
+ {
737
+ promise.resolve( Arguments.fromList( targetingKeywordsToSet ) );
738
+ }
739
+ return;
740
+ }
741
+
742
+ List<String> keywords = sdk.getTargetingData().getKeywords();
743
+
744
+ if ( keywords == null || keywords.size() == 0 )
745
+ {
746
+ promise.resolve( null );
747
+ }
748
+ else
749
+ {
750
+ promise.resolve( Arguments.makeNativeArray( keywords ) );
751
+ }
630
752
  }
631
753
 
632
- @ReactMethod()
754
+ @ReactMethod
633
755
  public void setTargetingDataInterests(@Nullable final ReadableArray rawInterests)
634
756
  {
635
757
  if ( sdk == null )
636
758
  {
637
- targetingInterestsToSet = rawInterests;
759
+ targetingKeywordsToSet = Arguments.toList( rawInterests );
638
760
  return;
639
761
  }
640
762
 
641
- sdk.getTargetingData().setInterests( getStringArrayList( rawInterests ) );
763
+ sdk.getTargetingData().setInterests( Arguments.toList( rawInterests ) );
642
764
  }
643
765
 
644
- @ReactMethod()
766
+ @ReactMethod
767
+ public void getTargetingDataInterests(final Promise promise)
768
+ {
769
+ if ( sdk == null )
770
+ {
771
+ if ( targetingInterestsToSet == null || targetingInterestsToSet.size() == 0 )
772
+ {
773
+ promise.resolve( null );
774
+ }
775
+ else
776
+ {
777
+ promise.resolve( Arguments.fromList( targetingInterestsToSet ) );
778
+ }
779
+ return;
780
+ }
781
+
782
+ List<String> interests = sdk.getTargetingData().getInterests();
783
+
784
+ if ( interests == null || interests.size() == 0 )
785
+ {
786
+ promise.resolve( null );
787
+ }
788
+ else
789
+ {
790
+ promise.resolve( Arguments.makeNativeArray( interests ) );
791
+ }
792
+ }
793
+
794
+ @ReactMethod
645
795
  public void clearAllTargetingData()
646
796
  {
647
797
  if ( sdk == null )
@@ -659,7 +809,7 @@ public class AppLovinMAXModule
659
809
  sdk.getTargetingData().clearAll();
660
810
  }
661
811
 
662
- @ReactMethod()
812
+ @ReactMethod
663
813
  public void setLocationCollectionEnabled(final boolean enabled)
664
814
  {
665
815
  if ( isPluginInitialized )
@@ -675,7 +825,7 @@ public class AppLovinMAXModule
675
825
 
676
826
  // EVENT TRACKING
677
827
 
678
- @ReactMethod()
828
+ @ReactMethod
679
829
  public void trackEvent(final String event, final ReadableMap parameters)
680
830
  {
681
831
  // Convert Map<String, Object> type of `parameters.toHashMap()` to Map<String, String>
@@ -694,254 +844,506 @@ public class AppLovinMAXModule
694
844
 
695
845
  // BANNERS
696
846
 
697
- @ReactMethod()
847
+ @ReactMethod
698
848
  public void createBanner(final String adUnitId, final String bannerPosition)
699
849
  {
850
+ if ( sdk == null )
851
+ {
852
+ logUninitializedAccessError( "createBanner" );
853
+ return;
854
+ }
855
+
700
856
  createAdView( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), bannerPosition, DEFAULT_AD_VIEW_OFFSET );
701
857
  }
702
858
 
703
- @ReactMethod() // NOTE: No function overloading in JS so we need new method signature
859
+ @ReactMethod // NOTE: No function overloading in JS so we need new method signature
704
860
  public void createBannerWithOffsets(final String adUnitId, final String bannerPosition, final float x, final float y)
705
861
  {
862
+ if ( sdk == null )
863
+ {
864
+ logUninitializedAccessError( "createBannerWithOffsets" );
865
+ return;
866
+ }
867
+
706
868
  createAdView( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), bannerPosition, getOffsetPixels( x, y, getCurrentActivity() ) );
707
869
  }
708
870
 
709
- @ReactMethod()
871
+ @ReactMethod
710
872
  public void setBannerBackgroundColor(final String adUnitId, final String hexColorCode)
711
873
  {
874
+ if ( sdk == null )
875
+ {
876
+ logUninitializedAccessError( "setBannerBackgroundColor" );
877
+ return;
878
+ }
879
+
712
880
  setAdViewBackgroundColor( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), hexColorCode );
713
881
  }
714
882
 
715
- @ReactMethod()
883
+ @ReactMethod
716
884
  public void setBannerPlacement(final String adUnitId, final String placement)
717
885
  {
886
+ if ( sdk == null )
887
+ {
888
+ logUninitializedAccessError( "setBannerPlacement" );
889
+ return;
890
+ }
891
+
718
892
  setAdViewPlacement( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), placement );
719
893
  }
720
894
 
721
- @ReactMethod()
895
+ @ReactMethod
722
896
  public void setBannerCustomData(final String adUnitId, final String customData)
723
897
  {
898
+ if ( sdk == null )
899
+ {
900
+ logUninitializedAccessError( "setBannerCustomData" );
901
+ return;
902
+ }
903
+
724
904
  setAdViewCustomData( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), customData );
725
905
  }
726
906
 
727
- @ReactMethod()
907
+ @ReactMethod
728
908
  public void setBannerWidth(final String adUnitId, final int widthDp)
729
909
  {
910
+ if ( sdk == null )
911
+ {
912
+ logUninitializedAccessError( "setBannerWidth" );
913
+ return;
914
+ }
915
+
730
916
  setAdViewWidth( adUnitId, widthDp, getDeviceSpecificBannerAdViewAdFormat() );
731
917
  }
732
918
 
733
- @ReactMethod()
919
+ @ReactMethod
734
920
  public void updateBannerPosition(final String adUnitId, final String bannerPosition)
735
921
  {
922
+ if ( sdk == null )
923
+ {
924
+ logUninitializedAccessError( "updateBannerPosition" );
925
+ return;
926
+ }
927
+
736
928
  updateAdViewPosition( adUnitId, bannerPosition, DEFAULT_AD_VIEW_OFFSET, getDeviceSpecificBannerAdViewAdFormat() );
737
929
  }
738
930
 
739
- @ReactMethod()
931
+ @ReactMethod
740
932
  public void updateBannerOffsets(final String adUnitId, final float x, final float y)
741
933
  {
934
+ if ( sdk == null )
935
+ {
936
+ logUninitializedAccessError( "updateBannerOffsets" );
937
+ return;
938
+ }
939
+
742
940
  updateAdViewPosition( adUnitId, mAdViewPositions.get( adUnitId ), getOffsetPixels( x, y, getCurrentActivity() ), getDeviceSpecificBannerAdViewAdFormat() );
743
941
  }
744
942
 
745
- @ReactMethod()
943
+ @ReactMethod
746
944
  public void setBannerExtraParameter(final String adUnitId, final String key, final String value)
747
945
  {
946
+ if ( sdk == null )
947
+ {
948
+ logUninitializedAccessError( "setBannerExtraParameter" );
949
+ return;
950
+ }
951
+
748
952
  setAdViewExtraParameters( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), key, value );
749
953
  }
750
954
 
751
- @ReactMethod()
955
+ @ReactMethod
956
+ public void setBannerLocalExtraParameter(final String adUnitId, final String key, final String value)
957
+ {
958
+ setAdViewLocalExtraParameters( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), key, value );
959
+ }
960
+
961
+ @ReactMethod
752
962
  public void startBannerAutoRefresh(final String adUnitId)
753
963
  {
964
+ if ( sdk == null )
965
+ {
966
+ logUninitializedAccessError( "startBannerAutoRefresh" );
967
+ return;
968
+ }
969
+
754
970
  startAutoRefresh( adUnitId, getDeviceSpecificBannerAdViewAdFormat() );
755
971
  }
756
972
 
757
- @ReactMethod()
973
+ @ReactMethod
758
974
  public void stopBannerAutoRefresh(final String adUnitId)
759
975
  {
976
+ if ( sdk == null )
977
+ {
978
+ logUninitializedAccessError( "stopBannerAutoRefresh" );
979
+ return;
980
+ }
981
+
760
982
  stopAutoRefresh( adUnitId, getDeviceSpecificBannerAdViewAdFormat() );
761
983
  }
762
984
 
763
- @ReactMethod()
985
+ @ReactMethod
764
986
  public void showBanner(final String adUnitId)
765
987
  {
988
+ if ( sdk == null )
989
+ {
990
+ logUninitializedAccessError( "showBanner" );
991
+ return;
992
+ }
993
+
766
994
  showAdView( adUnitId, getDeviceSpecificBannerAdViewAdFormat() );
767
995
  }
768
996
 
769
- @ReactMethod()
997
+ @ReactMethod
770
998
  public void hideBanner(final String adUnitId)
771
999
  {
1000
+ if ( sdk == null )
1001
+ {
1002
+ logUninitializedAccessError( "hideBanner" );
1003
+ return;
1004
+ }
1005
+
772
1006
  hideAdView( adUnitId, getDeviceSpecificBannerAdViewAdFormat() );
773
1007
  }
774
1008
 
775
- @ReactMethod()
1009
+ @ReactMethod
776
1010
  public void destroyBanner(final String adUnitId)
777
1011
  {
1012
+ if ( sdk == null )
1013
+ {
1014
+ logUninitializedAccessError( "destroyBanner" );
1015
+ return;
1016
+ }
1017
+
778
1018
  destroyAdView( adUnitId, getDeviceSpecificBannerAdViewAdFormat() );
779
1019
  }
780
1020
 
781
- @ReactMethod(isBlockingSynchronousMethod = true)
782
- public float getAdaptiveBannerHeightForWidth(final float width)
1021
+ @ReactMethod
1022
+ public void getAdaptiveBannerHeightForWidth(final float width, final Promise promise)
783
1023
  {
784
- return getDeviceSpecificBannerAdViewAdFormat().getAdaptiveSize( (int) width, getCurrentActivity() ).getHeight();
1024
+ promise.resolve( getDeviceSpecificBannerAdViewAdFormat().getAdaptiveSize( (int) width, getCurrentActivity() ).getHeight() );
785
1025
  }
786
1026
 
787
1027
  // MRECS
788
1028
 
789
- @ReactMethod()
1029
+ @ReactMethod
790
1030
  public void createMRec(final String adUnitId, final String mrecPosition)
791
1031
  {
1032
+ if ( sdk == null )
1033
+ {
1034
+ logUninitializedAccessError( "createMRec" );
1035
+ return;
1036
+ }
1037
+
792
1038
  createAdView( adUnitId, MaxAdFormat.MREC, mrecPosition, DEFAULT_AD_VIEW_OFFSET );
793
1039
  }
794
1040
 
795
- @ReactMethod()
1041
+ @ReactMethod
796
1042
  public void setMRecPlacement(final String adUnitId, final String placement)
797
1043
  {
1044
+ if ( sdk == null )
1045
+ {
1046
+ logUninitializedAccessError( "setMRecPlacement" );
1047
+ return;
1048
+ }
1049
+
798
1050
  setAdViewPlacement( adUnitId, MaxAdFormat.MREC, placement );
799
1051
  }
800
1052
 
801
- @ReactMethod()
1053
+ @ReactMethod
802
1054
  public void setMRecCustomData(final String adUnitId, final String customData)
803
1055
  {
1056
+ if ( sdk == null )
1057
+ {
1058
+ logUninitializedAccessError( "setMRecCustomData" );
1059
+ return;
1060
+ }
1061
+
804
1062
  setAdViewCustomData( adUnitId, MaxAdFormat.MREC, customData );
805
1063
  }
806
1064
 
807
- @ReactMethod()
1065
+ @ReactMethod
808
1066
  public void updateMRecPosition(final String adUnitId, final String mrecPosition)
809
1067
  {
1068
+ if ( sdk == null )
1069
+ {
1070
+ logUninitializedAccessError( "updateMRecPosition" );
1071
+ return;
1072
+ }
1073
+
810
1074
  updateAdViewPosition( adUnitId, mrecPosition, DEFAULT_AD_VIEW_OFFSET, MaxAdFormat.MREC );
811
1075
  }
812
1076
 
813
- @ReactMethod()
1077
+ @ReactMethod
1078
+ public void setMRecExtraParameter(final String adUnitId, final String key, final String value)
1079
+ {
1080
+ setAdViewExtraParameters( adUnitId, MaxAdFormat.MREC, key, value );
1081
+ }
1082
+
1083
+ @ReactMethod
1084
+ public void setMRecLocalExtraParameter(final String adUnitId, final String key, final String value)
1085
+ {
1086
+ setAdViewLocalExtraParameters( adUnitId, MaxAdFormat.MREC, key, value );
1087
+ }
1088
+
1089
+ @ReactMethod
814
1090
  public void startMRecAutoRefresh(final String adUnitId)
815
1091
  {
1092
+ if ( sdk == null )
1093
+ {
1094
+ logUninitializedAccessError( "startMRecAutoRefresh" );
1095
+ return;
1096
+ }
1097
+
816
1098
  startAutoRefresh( adUnitId, MaxAdFormat.MREC );
817
1099
  }
818
1100
 
819
- @ReactMethod()
1101
+ @ReactMethod
820
1102
  public void stopMRecAutoRefresh(final String adUnitId)
821
1103
  {
1104
+ if ( sdk == null )
1105
+ {
1106
+ logUninitializedAccessError( "stopMRecAutoRefresh" );
1107
+ return;
1108
+ }
1109
+
822
1110
  stopAutoRefresh( adUnitId, MaxAdFormat.MREC );
823
1111
  }
824
1112
 
825
- @ReactMethod()
1113
+ @ReactMethod
826
1114
  public void showMRec(final String adUnitId)
827
1115
  {
1116
+ if ( sdk == null )
1117
+ {
1118
+ logUninitializedAccessError( "showMRec" );
1119
+ return;
1120
+ }
1121
+
828
1122
  showAdView( adUnitId, MaxAdFormat.MREC );
829
1123
  }
830
1124
 
831
- @ReactMethod()
1125
+ @ReactMethod
832
1126
  public void hideMRec(final String adUnitId)
833
1127
  {
1128
+ if ( sdk == null )
1129
+ {
1130
+ logUninitializedAccessError( "hideMRec" );
1131
+ return;
1132
+ }
1133
+
834
1134
  hideAdView( adUnitId, MaxAdFormat.MREC );
835
1135
  }
836
1136
 
837
- @ReactMethod()
1137
+ @ReactMethod
838
1138
  public void destroyMRec(final String adUnitId)
839
1139
  {
1140
+ if ( sdk == null )
1141
+ {
1142
+ logUninitializedAccessError( "destroyMRec" );
1143
+ return;
1144
+ }
1145
+
840
1146
  destroyAdView( adUnitId, MaxAdFormat.MREC );
841
1147
  }
842
1148
 
843
1149
  // INTERSTITIALS
844
1150
 
845
- @ReactMethod()
1151
+ @ReactMethod
846
1152
  public void loadInterstitial(final String adUnitId)
847
1153
  {
1154
+ if ( sdk == null )
1155
+ {
1156
+ logUninitializedAccessError( "loadInterstitial" );
1157
+ return;
1158
+ }
1159
+
848
1160
  MaxInterstitialAd interstitial = retrieveInterstitial( adUnitId );
849
1161
  if ( interstitial == null )
850
1162
  {
851
- sendReactNativeEventForAdLoadFailed( "OnInterstitialLoadFailedEvent", adUnitId, null );
1163
+ sendReactNativeEventForAdLoadFailed( ON_INTERSTITIAL_LOAD_FAILED_EVENT, adUnitId, null );
852
1164
  return;
853
1165
  }
854
1166
 
855
1167
  interstitial.loadAd();
856
1168
  }
857
1169
 
858
- @ReactMethod(isBlockingSynchronousMethod = true)
859
- public boolean isInterstitialReady(final String adUnitId)
1170
+ @ReactMethod
1171
+ public void isInterstitialReady(final String adUnitId, final Promise promise)
860
1172
  {
1173
+ if ( sdk == null )
1174
+ {
1175
+ logUninitializedAccessError( "isInterstitialReady" );
1176
+ promise.resolve( false );
1177
+ return;
1178
+ }
1179
+
861
1180
  MaxInterstitialAd interstitial = retrieveInterstitial( adUnitId );
862
- return interstitial.isReady();
1181
+ promise.resolve( interstitial.isReady() );
863
1182
  }
864
1183
 
865
- @ReactMethod()
1184
+ @ReactMethod
866
1185
  public void showInterstitial(final String adUnitId, final String placement, final String customData)
867
1186
  {
1187
+ if ( sdk == null )
1188
+ {
1189
+ logUninitializedAccessError( "showInterstitial" );
1190
+ return;
1191
+ }
1192
+
868
1193
  MaxInterstitialAd interstitial = retrieveInterstitial( adUnitId );
869
1194
  interstitial.showAd( placement, customData );
870
1195
  }
871
1196
 
872
- @ReactMethod()
1197
+ @ReactMethod
873
1198
  public void setInterstitialExtraParameter(final String adUnitId, final String key, final String value)
874
1199
  {
1200
+ if ( sdk == null )
1201
+ {
1202
+ logUninitializedAccessError( "setInterstitialExtraParameter" );
1203
+ return;
1204
+ }
1205
+
875
1206
  MaxInterstitialAd interstitial = retrieveInterstitial( adUnitId );
876
1207
  interstitial.setExtraParameter( key, value );
877
1208
  }
878
1209
 
1210
+ @ReactMethod
1211
+ public void setInterstitialLocalExtraParameter(final String adUnitId, final String key, final String value)
1212
+ {
1213
+ MaxInterstitialAd interstitial = retrieveInterstitial( adUnitId );
1214
+ interstitial.setLocalExtraParameter( key, value );
1215
+ }
1216
+
879
1217
  // REWARDED
880
1218
 
881
- @ReactMethod()
1219
+ @ReactMethod
882
1220
  public void loadRewardedAd(final String adUnitId)
883
1221
  {
1222
+ if ( sdk == null )
1223
+ {
1224
+ logUninitializedAccessError( "loadRewardedAd" );
1225
+ return;
1226
+ }
1227
+
884
1228
  MaxRewardedAd rewardedAd = retrieveRewardedAd( adUnitId );
885
1229
  if ( rewardedAd == null )
886
1230
  {
887
- sendReactNativeEventForAdLoadFailed( "OnRewardedAdLoadFailedEvent", adUnitId, null );
1231
+ sendReactNativeEventForAdLoadFailed( ON_REWARDED_AD_LOAD_FAILED_EVENT, adUnitId, null );
888
1232
  return;
889
1233
  }
890
1234
 
891
1235
  rewardedAd.loadAd();
892
1236
  }
893
1237
 
894
- @ReactMethod(isBlockingSynchronousMethod = true)
895
- public boolean isRewardedAdReady(final String adUnitId)
1238
+ @ReactMethod
1239
+ public void isRewardedAdReady(final String adUnitId, final Promise promise)
896
1240
  {
1241
+ if ( sdk == null )
1242
+ {
1243
+ logUninitializedAccessError( "isRewardedAdReady" );
1244
+ promise.resolve( false );
1245
+ return;
1246
+ }
1247
+
897
1248
  MaxRewardedAd rewardedAd = retrieveRewardedAd( adUnitId );
898
- return rewardedAd.isReady();
1249
+ promise.resolve( rewardedAd.isReady() );
899
1250
  }
900
1251
 
901
- @ReactMethod()
1252
+ @ReactMethod
902
1253
  public void showRewardedAd(final String adUnitId, final String placement, final String customData)
903
1254
  {
1255
+ if ( sdk == null )
1256
+ {
1257
+ logUninitializedAccessError( "showRewardedAd" );
1258
+ return;
1259
+ }
1260
+
904
1261
  MaxRewardedAd rewardedAd = retrieveRewardedAd( adUnitId );
905
1262
  rewardedAd.showAd( placement, customData );
906
1263
  }
907
1264
 
908
- @ReactMethod()
1265
+ @ReactMethod
909
1266
  public void setRewardedAdExtraParameter(final String adUnitId, final String key, final String value)
910
1267
  {
1268
+ if ( sdk == null )
1269
+ {
1270
+ logUninitializedAccessError( "setRewardedAdExtraParameter" );
1271
+ return;
1272
+ }
1273
+
911
1274
  MaxRewardedAd rewardedAd = retrieveRewardedAd( adUnitId );
912
1275
  rewardedAd.setExtraParameter( key, value );
913
1276
  }
914
1277
 
1278
+ @ReactMethod
1279
+ public void setRewardedAdLocalExtraParameter(final String adUnitId, final String key, final String value)
1280
+ {
1281
+ MaxRewardedAd rewardedAd = retrieveRewardedAd( adUnitId );
1282
+ rewardedAd.setLocalExtraParameter( key, value );
1283
+ }
1284
+
915
1285
  // APP OPEN AD
916
1286
 
917
- @ReactMethod()
1287
+ @ReactMethod
918
1288
  public void loadAppOpenAd(final String adUnitId)
919
1289
  {
1290
+ if ( sdk == null )
1291
+ {
1292
+ logUninitializedAccessError( "loadAppOpenAd" );
1293
+ return;
1294
+ }
1295
+
920
1296
  MaxAppOpenAd appOpenAd = retrieveAppOpenAd( adUnitId );
921
1297
  appOpenAd.loadAd();
922
1298
  }
923
1299
 
924
- @ReactMethod(isBlockingSynchronousMethod = true)
925
- public boolean isAppOpenAdReady(final String adUnitId)
1300
+ @ReactMethod
1301
+ public void isAppOpenAdReady(final String adUnitId, final Promise promise)
926
1302
  {
1303
+ if ( sdk == null )
1304
+ {
1305
+ logUninitializedAccessError( "isAppOpenAdReady" );
1306
+ promise.resolve( false );
1307
+ return;
1308
+ }
1309
+
927
1310
  MaxAppOpenAd appOpenAd = retrieveAppOpenAd( adUnitId );
928
- return appOpenAd.isReady();
1311
+ promise.resolve( appOpenAd.isReady() );
929
1312
  }
930
1313
 
931
- @ReactMethod()
1314
+ @ReactMethod
932
1315
  public void showAppOpenAd(final String adUnitId, @Nullable final String placement, @Nullable final String customData)
933
1316
  {
1317
+ if ( sdk == null )
1318
+ {
1319
+ logUninitializedAccessError( "showAppOpenAd" );
1320
+ return;
1321
+ }
1322
+
934
1323
  MaxAppOpenAd appOpenAd = retrieveAppOpenAd( adUnitId );
935
1324
  appOpenAd.showAd( placement, customData );
936
1325
  }
937
1326
 
938
- @ReactMethod()
1327
+ @ReactMethod
939
1328
  public void setAppOpenAdExtraParameter(final String adUnitId, final String key, final String value)
940
1329
  {
1330
+ if ( sdk == null )
1331
+ {
1332
+ logUninitializedAccessError( "setAppOpenAdExtraParameter" );
1333
+ return;
1334
+ }
1335
+
941
1336
  MaxAppOpenAd appOpenAd = retrieveAppOpenAd( adUnitId );
942
1337
  appOpenAd.setExtraParameter( key, value );
943
1338
  }
944
1339
 
1340
+ @ReactMethod
1341
+ public void setAppOpenAdLocalExtraParameter(final String adUnitId, final String key, final String value)
1342
+ {
1343
+ MaxAppOpenAd appOpenAd = retrieveAppOpenAd( adUnitId );
1344
+ appOpenAd.setLocalExtraParameter( key, value );
1345
+ }
1346
+
945
1347
  // AD CALLBACKS
946
1348
 
947
1349
  @Override
@@ -951,7 +1353,7 @@ public class AppLovinMAXModule
951
1353
  MaxAdFormat adFormat = ad.getFormat();
952
1354
  if ( MaxAdFormat.BANNER == adFormat || MaxAdFormat.LEADER == adFormat || MaxAdFormat.MREC == adFormat )
953
1355
  {
954
- name = ( MaxAdFormat.MREC == adFormat ) ? "OnMRecAdLoadedEvent" : "OnBannerAdLoadedEvent";
1356
+ name = ( MaxAdFormat.MREC == adFormat ) ? ON_MREC_AD_LOADED_EVENT : ON_BANNER_AD_LOADED_EVENT;
955
1357
 
956
1358
  String adViewPosition = mAdViewPositions.get( ad.getAdUnitId() );
957
1359
  if ( !TextUtils.isEmpty( adViewPosition ) )
@@ -970,19 +1372,15 @@ public class AppLovinMAXModule
970
1372
  }
971
1373
  else if ( MaxAdFormat.INTERSTITIAL == adFormat )
972
1374
  {
973
- name = "OnInterstitialLoadedEvent";
1375
+ name = ON_INTERSTITIAL_LOADED_EVENT;
974
1376
  }
975
1377
  else if ( MaxAdFormat.REWARDED == adFormat )
976
1378
  {
977
- name = "OnRewardedAdLoadedEvent";
978
- }
979
- else if ( MaxAdFormat.NATIVE == adFormat )
980
- {
981
- name = "OnNativeAdLoadedEvent";
1379
+ name = ON_REWARDED_AD_LOADED_EVENT;
982
1380
  }
983
1381
  else if ( MaxAdFormat.APP_OPEN == adFormat )
984
1382
  {
985
- name = "OnAppOpenAdLoadedEvent";
1383
+ name = ON_APPOPEN_AD_LOADED_EVENT;
986
1384
  }
987
1385
  else
988
1386
  {
@@ -1005,19 +1403,19 @@ public class AppLovinMAXModule
1005
1403
  String name;
1006
1404
  if ( mAdViews.containsKey( adUnitId ) )
1007
1405
  {
1008
- name = ( MaxAdFormat.MREC == mAdViewAdFormats.get( adUnitId ) ) ? "OnMRecAdLoadFailedEvent" : "OnBannerAdLoadFailedEvent";
1406
+ name = ( MaxAdFormat.MREC == mAdViewAdFormats.get( adUnitId ) ) ? ON_MREC_AD_LOAD_FAILED_EVENT : ON_BANNER_AD_LOAD_FAILED_EVENT;
1009
1407
  }
1010
1408
  else if ( mInterstitials.containsKey( adUnitId ) )
1011
1409
  {
1012
- name = "OnInterstitialLoadFailedEvent";
1410
+ name = ON_INTERSTITIAL_LOAD_FAILED_EVENT;
1013
1411
  }
1014
1412
  else if ( mRewardedAds.containsKey( adUnitId ) )
1015
1413
  {
1016
- name = "OnRewardedAdLoadFailedEvent";
1414
+ name = ON_REWARDED_AD_LOAD_FAILED_EVENT;
1017
1415
  }
1018
1416
  else if ( mAppOpenAds.containsKey( adUnitId ) )
1019
1417
  {
1020
- name = "OnAppOpenAdLoadFailedEvent";
1418
+ name = ON_APPOPEN_AD_LOAD_FAILED_EVENT;
1021
1419
  }
1022
1420
  else
1023
1421
  {
@@ -1028,24 +1426,9 @@ public class AppLovinMAXModule
1028
1426
  sendReactNativeEventForAdLoadFailed( name, adUnitId, error );
1029
1427
  }
1030
1428
 
1031
- public void sendReactNativeEventForAdLoadFailed(final String name, final String adUnitId, final @Nullable MaxError error)
1429
+ void sendReactNativeEventForAdLoadFailed(final String name, final String adUnitId, @Nullable final MaxError error)
1032
1430
  {
1033
- WritableMap params = Arguments.createMap();
1034
- params.putString( "adUnitId", adUnitId );
1035
-
1036
- if ( error != null )
1037
- {
1038
- params.putInt( "code", error.getCode() );
1039
- params.putString( "message", error.getMessage() );
1040
- params.putString( "adLoadFailureInfo", error.getAdLoadFailureInfo() );
1041
- params.putMap( "waterfall", createAdWaterfallInfo( error.getWaterfall() ) );
1042
- }
1043
- else
1044
- {
1045
- params.putInt( "code", MaxErrorCode.UNSPECIFIED );
1046
- }
1047
-
1048
- sendReactNativeEvent( name, params );
1431
+ sendReactNativeEvent( name, getAdLoadFailedInfo( adUnitId, error ) );
1049
1432
  }
1050
1433
 
1051
1434
  @Override
@@ -1055,27 +1438,23 @@ public class AppLovinMAXModule
1055
1438
  final String name;
1056
1439
  if ( MaxAdFormat.BANNER == adFormat || MaxAdFormat.LEADER == adFormat )
1057
1440
  {
1058
- name = "OnBannerAdClickedEvent";
1441
+ name = ON_BANNER_AD_CLICKED_EVENT;
1059
1442
  }
1060
1443
  else if ( MaxAdFormat.MREC == adFormat )
1061
1444
  {
1062
- name = "OnMRecAdClickedEvent";
1445
+ name = ON_MREC_AD_CLICKED_EVENT;
1063
1446
  }
1064
1447
  else if ( MaxAdFormat.INTERSTITIAL == adFormat )
1065
1448
  {
1066
- name = "OnInterstitialClickedEvent";
1449
+ name = ON_INTERSTITIAL_CLICKED_EVENT;
1067
1450
  }
1068
1451
  else if ( MaxAdFormat.REWARDED == adFormat )
1069
1452
  {
1070
- name = "OnRewardedAdClickedEvent";
1071
- }
1072
- else if ( MaxAdFormat.NATIVE == adFormat )
1073
- {
1074
- name = "OnNativeAdClickedEvent";
1453
+ name = ON_REWARDED_AD_CLICKED_EVENT;
1075
1454
  }
1076
1455
  else if ( MaxAdFormat.APP_OPEN == adFormat )
1077
1456
  {
1078
- name = "OnAppOpenAdClickedEvent";
1457
+ name = ON_APPOPEN_AD_CLICKED_EVENT;
1079
1458
  }
1080
1459
  else
1081
1460
  {
@@ -1096,15 +1475,15 @@ public class AppLovinMAXModule
1096
1475
  final String name;
1097
1476
  if ( MaxAdFormat.INTERSTITIAL == adFormat )
1098
1477
  {
1099
- name = "OnInterstitialDisplayedEvent";
1478
+ name = ON_INTERSTITIAL_DISPLAYED_EVENT;
1100
1479
  }
1101
1480
  else if ( MaxAdFormat.REWARDED == adFormat )
1102
1481
  {
1103
- name = "OnRewardedAdDisplayedEvent";
1482
+ name = ON_REWARDED_AD_DISPLAYED_EVENT;
1104
1483
  }
1105
1484
  else // APP OPEN
1106
1485
  {
1107
- name = "OnAppOpenAdDisplayedEvent";
1486
+ name = ON_APPOPEN_AD_DISPLAYED_EVENT;
1108
1487
  }
1109
1488
 
1110
1489
  sendReactNativeEvent( name, getAdInfo( ad ) );
@@ -1120,22 +1499,18 @@ public class AppLovinMAXModule
1120
1499
  final String name;
1121
1500
  if ( MaxAdFormat.INTERSTITIAL == adFormat )
1122
1501
  {
1123
- name = "OnInterstitialAdFailedToDisplayEvent";
1502
+ name = ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT;
1124
1503
  }
1125
1504
  else if ( MaxAdFormat.REWARDED == adFormat )
1126
1505
  {
1127
- name = "OnRewardedAdFailedToDisplayEvent";
1506
+ name = ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT;
1128
1507
  }
1129
1508
  else // APP OPEN
1130
1509
  {
1131
- name = "OnAppOpenAdFailedToDisplayEvent";
1510
+ name = ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT;
1132
1511
  }
1133
1512
 
1134
- WritableMap params = getAdInfo( ad );
1135
- params.putInt( "code", error.getCode() );
1136
- params.putString( "message", error.getMessage() );
1137
-
1138
- sendReactNativeEvent( name, params );
1513
+ sendReactNativeEvent( name, getAdDisplayFailedInfo( ad, error ) );
1139
1514
  }
1140
1515
 
1141
1516
  @Override
@@ -1148,15 +1523,15 @@ public class AppLovinMAXModule
1148
1523
  String name;
1149
1524
  if ( MaxAdFormat.INTERSTITIAL == adFormat )
1150
1525
  {
1151
- name = "OnInterstitialHiddenEvent";
1526
+ name = ON_INTERSTITIAL_HIDDEN_EVENT;
1152
1527
  }
1153
1528
  else if ( MaxAdFormat.REWARDED == adFormat )
1154
1529
  {
1155
- name = "OnRewardedAdHiddenEvent";
1530
+ name = ON_REWARDED_AD_HIDDEN_EVENT;
1156
1531
  }
1157
1532
  else // APP OPEN
1158
1533
  {
1159
- name = "OnAppOpenAdHiddenEvent";
1534
+ name = ON_APPOPEN_AD_HIDDEN_EVENT;
1160
1535
  }
1161
1536
 
1162
1537
  sendReactNativeEvent( name, getAdInfo( ad ) );
@@ -1172,7 +1547,7 @@ public class AppLovinMAXModule
1172
1547
  return;
1173
1548
  }
1174
1549
 
1175
- sendReactNativeEvent( ( MaxAdFormat.MREC == adFormat ) ? "OnMRecAdExpandedEvent" : "OnBannerAdExpandedEvent", getAdInfo( ad ) );
1550
+ sendReactNativeEvent( ( MaxAdFormat.MREC == adFormat ) ? ON_MREC_AD_EXPANDED_EVENT : ON_BANNER_AD_EXPANDED_EVENT, getAdInfo( ad ) );
1176
1551
  }
1177
1552
 
1178
1553
  @Override
@@ -1185,7 +1560,7 @@ public class AppLovinMAXModule
1185
1560
  return;
1186
1561
  }
1187
1562
 
1188
- sendReactNativeEvent( ( MaxAdFormat.MREC == adFormat ) ? "OnMRecAdCollapsedEvent" : "OnBannerAdCollapsedEvent", getAdInfo( ad ) );
1563
+ sendReactNativeEvent( ( MaxAdFormat.MREC == adFormat ) ? ON_MREC_AD_COLLAPSED_EVENT : ON_BANNER_AD_COLLAPSED_EVENT, getAdInfo( ad ) );
1189
1564
  }
1190
1565
 
1191
1566
  @Override
@@ -1195,27 +1570,23 @@ public class AppLovinMAXModule
1195
1570
  final String name;
1196
1571
  if ( MaxAdFormat.BANNER == adFormat || MaxAdFormat.LEADER == adFormat )
1197
1572
  {
1198
- name = "OnBannerAdRevenuePaid";
1573
+ name = ON_BANNER_AD_REVENUE_PAID;
1199
1574
  }
1200
1575
  else if ( MaxAdFormat.MREC == adFormat )
1201
1576
  {
1202
- name = "OnMRecAdRevenuePaid";
1577
+ name = ON_MREC_AD_REVENUE_PAID;
1203
1578
  }
1204
1579
  else if ( MaxAdFormat.INTERSTITIAL == adFormat )
1205
1580
  {
1206
- name = "OnInterstitialAdRevenuePaid";
1581
+ name = ON_INTERSTITIAL_AD_REVENUE_PAID;
1207
1582
  }
1208
1583
  else if ( MaxAdFormat.REWARDED == adFormat )
1209
1584
  {
1210
- name = "OnRewardedAdRevenuePaid";
1211
- }
1212
- else if ( MaxAdFormat.NATIVE == adFormat )
1213
- {
1214
- name = "OnNativeAdRevenuePaid";
1585
+ name = ON_REWARDED_AD_REVENUE_PAID;
1215
1586
  }
1216
1587
  else if ( MaxAdFormat.APP_OPEN == adFormat )
1217
1588
  {
1218
- name = "OnAppOpenAdRevenuePaid";
1589
+ name = ON_APPOPEN_AD_REVENUE_PAID;
1219
1590
  }
1220
1591
  else
1221
1592
  {
@@ -1223,12 +1594,7 @@ public class AppLovinMAXModule
1223
1594
  return;
1224
1595
  }
1225
1596
 
1226
- WritableMap adInfo = getAdInfo( ad );
1227
- adInfo.putString( "networkPlacement", ad.getNetworkPlacement() );
1228
- adInfo.putString( "revenuePrecision", ad.getRevenuePrecision() );
1229
- adInfo.putString( "countryCode", sdkConfiguration.getCountryCode() );
1230
-
1231
- sendReactNativeEvent( name, adInfo );
1597
+ sendReactNativeEvent( name, getAdRevenueInfo( ad ) );
1232
1598
  }
1233
1599
 
1234
1600
  @Override
@@ -1555,6 +1921,28 @@ public class AppLovinMAXModule
1555
1921
  } );
1556
1922
  }
1557
1923
 
1924
+ private void setAdViewLocalExtraParameters(final String adUnitId, final MaxAdFormat adFormat, final String key, final String value)
1925
+ {
1926
+ getReactApplicationContext().runOnUiQueueThread( new Runnable()
1927
+ {
1928
+ @Override
1929
+ public void run()
1930
+ {
1931
+ d( "Setting " + adFormat.getLabel() + " local extra with key: \"" + key + "\" value: " + value );
1932
+
1933
+ // Retrieve ad view from the map
1934
+ final MaxAdView adView = retrieveAdView( adUnitId, adFormat );
1935
+ if ( adView == null )
1936
+ {
1937
+ e( adFormat.getLabel() + " does not exist" );
1938
+ return;
1939
+ }
1940
+
1941
+ adView.setLocalExtraParameter( key, value );
1942
+ }
1943
+ } );
1944
+ }
1945
+
1558
1946
  private void startAutoRefresh(final String adUnitId, final MaxAdFormat adFormat)
1559
1947
  {
1560
1948
  getReactApplicationContext().runOnUiQueueThread( new Runnable()
@@ -1712,7 +2100,7 @@ public class AppLovinMAXModule
1712
2100
  adViewWidthDp = mAdViewWidths.get( adUnitId );
1713
2101
  }
1714
2102
  // Top center / bottom center stretches full screen
1715
- else if ( "top_center".equalsIgnoreCase( adViewPosition ) || "bottom_center".equalsIgnoreCase( adViewPosition ) )
2103
+ else if ( TOP_CENTER.equalsIgnoreCase( adViewPosition ) || BOTTOM_CENTER.equalsIgnoreCase( adViewPosition ) )
1716
2104
  {
1717
2105
  int adViewWidthPx = windowRect.width();
1718
2106
  adViewWidthDp = AppLovinSdkUtils.pxToDp( getCurrentActivity(), adViewWidthPx );
@@ -1752,7 +2140,7 @@ public class AppLovinMAXModule
1752
2140
  adView.setTranslationX( 0 );
1753
2141
  params.setMargins( 0, 0, 0, 0 );
1754
2142
 
1755
- if ( "centered".equalsIgnoreCase( adViewPosition ) )
2143
+ if ( CENTERED.equalsIgnoreCase( adViewPosition ) )
1756
2144
  {
1757
2145
  gravity = Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL;
1758
2146
 
@@ -1834,7 +2222,7 @@ public class AppLovinMAXModule
1834
2222
  e( Log.getStackTraceString( e ) );
1835
2223
  }
1836
2224
 
1837
- private static void logUninitializedAccessError(final String callingMethod)
2225
+ public static void logUninitializedAccessError(final String callingMethod)
1838
2226
  {
1839
2227
  e( "ERROR: Failed to execute " + callingMethod + "() - please ensure the AppLovin MAX React Native module has been initialized by calling 'AppLovinMAX.initialize(...);'!" );
1840
2228
  }
@@ -1904,7 +2292,7 @@ public class AppLovinMAXModule
1904
2292
  return new Point( AppLovinSdkUtils.dpToPx( context, (int) xDp ), AppLovinSdkUtils.dpToPx( context, (int) yDp ) );
1905
2293
  }
1906
2294
 
1907
- private static AppLovinGender getAppLovinGender(@Nullable String gender)
2295
+ private static AppLovinGender getAppLovinGender(@Nullable final String gender)
1908
2296
  {
1909
2297
  if ( gender != null )
1910
2298
  {
@@ -1925,7 +2313,25 @@ public class AppLovinMAXModule
1925
2313
  return AppLovinGender.UNKNOWN;
1926
2314
  }
1927
2315
 
1928
- private static AppLovinAdContentRating getAppLovinAdContentRating(int maximumAdContentRating)
2316
+ private static String getRawAppLovinGender(final AppLovinGender gender)
2317
+ {
2318
+ if ( gender == AppLovinGender.FEMALE )
2319
+ {
2320
+ return "F";
2321
+ }
2322
+ else if ( gender == AppLovinGender.MALE )
2323
+ {
2324
+ return "M";
2325
+ }
2326
+ else if ( gender == AppLovinGender.OTHER )
2327
+ {
2328
+ return "O";
2329
+ }
2330
+
2331
+ return "U";
2332
+ }
2333
+
2334
+ private static AppLovinAdContentRating getAppLovinAdContentRating(final int maximumAdContentRating)
1929
2335
  {
1930
2336
  if ( maximumAdContentRating == 1 )
1931
2337
  {
@@ -1943,23 +2349,9 @@ public class AppLovinMAXModule
1943
2349
  return AppLovinAdContentRating.NONE;
1944
2350
  }
1945
2351
 
1946
- private List<String> getStringArrayList(@Nullable ReadableArray readableArray)
1947
- {
1948
- if ( readableArray == null ) return null;
1949
-
1950
- List<String> list = new ArrayList<>( readableArray.size() );
1951
-
1952
- for ( Object item : readableArray.toArrayList() )
1953
- {
1954
- list.add( (String) item );
1955
- }
1956
-
1957
- return list;
1958
- }
1959
-
1960
2352
  // AD INFO
1961
2353
 
1962
- private WritableMap getAdInfo(final MaxAd ad)
2354
+ public WritableMap getAdInfo(final MaxAd ad)
1963
2355
  {
1964
2356
  WritableMap adInfo = Arguments.createMap();
1965
2357
  adInfo.putString( "adUnitId", ad.getAdUnitId() );
@@ -1973,6 +2365,43 @@ public class AppLovinMAXModule
1973
2365
  return adInfo;
1974
2366
  }
1975
2367
 
2368
+ public WritableMap getAdLoadFailedInfo(final String adUnitId, @Nullable final MaxError error)
2369
+ {
2370
+ WritableMap errInfo = Arguments.createMap();
2371
+ errInfo.putString( "adUnitId", adUnitId );
2372
+
2373
+ if ( error != null )
2374
+ {
2375
+ errInfo.putInt( "code", error.getCode() );
2376
+ errInfo.putString( "message", error.getMessage() );
2377
+ errInfo.putString( "adLoadFailureInfo", error.getAdLoadFailureInfo() );
2378
+ errInfo.putMap( "waterfall", createAdWaterfallInfo( error.getWaterfall() ) );
2379
+ }
2380
+ else
2381
+ {
2382
+ errInfo.putInt( "code", MaxErrorCode.UNSPECIFIED );
2383
+ }
2384
+
2385
+ return errInfo;
2386
+ }
2387
+
2388
+ public WritableMap getAdDisplayFailedInfo(final MaxAd ad, final MaxError error)
2389
+ {
2390
+ WritableMap params = getAdInfo( ad );
2391
+ params.putInt( "code", error.getCode() );
2392
+ params.putString( "message", error.getMessage() );
2393
+ return params;
2394
+ }
2395
+
2396
+ public WritableMap getAdRevenueInfo(final MaxAd ad)
2397
+ {
2398
+ WritableMap adInfo = getAdInfo( ad );
2399
+ adInfo.putString( "networkPlacement", ad.getNetworkPlacement() );
2400
+ adInfo.putString( "revenuePrecision", ad.getRevenuePrecision() );
2401
+ adInfo.putString( "countryCode", sdkConfiguration.getCountryCode() );
2402
+ return adInfo;
2403
+ }
2404
+
1976
2405
  // AD WATERFALL INFO
1977
2406
 
1978
2407
  private WritableMap createAdWaterfallInfo(final MaxAdWaterfallInfo waterfallInfo)
@@ -2096,6 +2525,60 @@ public class AppLovinMAXModule
2096
2525
  @Nullable
2097
2526
  public Map<String, Object> getConstants()
2098
2527
  {
2099
- return super.getConstants();
2528
+ final Map<String, Object> constants = new HashMap<>();
2529
+
2530
+ constants.put( "ON_MREC_AD_LOADED_EVENT", ON_MREC_AD_LOADED_EVENT );
2531
+ constants.put( "ON_MREC_AD_LOAD_FAILED_EVENT", ON_MREC_AD_LOAD_FAILED_EVENT );
2532
+ constants.put( "ON_MREC_AD_CLICKED_EVENT", ON_MREC_AD_CLICKED_EVENT );
2533
+ constants.put( "ON_MREC_AD_COLLAPSED_EVENT", ON_MREC_AD_COLLAPSED_EVENT );
2534
+ constants.put( "ON_MREC_AD_EXPANDED_EVENT", ON_MREC_AD_EXPANDED_EVENT );
2535
+ constants.put( "ON_MREC_AD_REVENUE_PAID", ON_MREC_AD_REVENUE_PAID );
2536
+
2537
+ constants.put( "ON_BANNER_AD_LOADED_EVENT", ON_BANNER_AD_LOADED_EVENT );
2538
+ constants.put( "ON_BANNER_AD_LOAD_FAILED_EVENT", ON_BANNER_AD_LOAD_FAILED_EVENT );
2539
+ constants.put( "ON_BANNER_AD_CLICKED_EVENT", ON_BANNER_AD_CLICKED_EVENT );
2540
+ constants.put( "ON_BANNER_AD_COLLAPSED_EVENT", ON_BANNER_AD_COLLAPSED_EVENT );
2541
+ constants.put( "ON_BANNER_AD_EXPANDED_EVENT", ON_BANNER_AD_EXPANDED_EVENT );
2542
+ constants.put( "ON_BANNER_AD_REVENUE_PAID", ON_BANNER_AD_REVENUE_PAID );
2543
+
2544
+ constants.put( "ON_INTERSTITIAL_LOADED_EVENT", ON_INTERSTITIAL_LOADED_EVENT );
2545
+ constants.put( "ON_INTERSTITIAL_LOAD_FAILED_EVENT", ON_INTERSTITIAL_LOAD_FAILED_EVENT );
2546
+ constants.put( "ON_INTERSTITIAL_CLICKED_EVENT", ON_INTERSTITIAL_CLICKED_EVENT );
2547
+ constants.put( "ON_INTERSTITIAL_DISPLAYED_EVENT", ON_INTERSTITIAL_DISPLAYED_EVENT );
2548
+ constants.put( "ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT", ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT );
2549
+ constants.put( "ON_INTERSTITIAL_HIDDEN_EVENT", ON_INTERSTITIAL_HIDDEN_EVENT );
2550
+ constants.put( "ON_INTERSTITIAL_AD_REVENUE_PAID", ON_INTERSTITIAL_AD_REVENUE_PAID );
2551
+
2552
+ constants.put( "ON_REWARDED_AD_LOADED_EVENT", ON_REWARDED_AD_LOADED_EVENT );
2553
+ constants.put( "ON_REWARDED_AD_LOAD_FAILED_EVENT", ON_REWARDED_AD_LOAD_FAILED_EVENT );
2554
+ constants.put( "ON_REWARDED_AD_CLICKED_EVENT", ON_REWARDED_AD_CLICKED_EVENT );
2555
+ constants.put( "ON_REWARDED_AD_DISPLAYED_EVENT", ON_REWARDED_AD_DISPLAYED_EVENT );
2556
+ constants.put( "ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT", ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT );
2557
+ constants.put( "ON_REWARDED_AD_HIDDEN_EVENT", ON_REWARDED_AD_HIDDEN_EVENT );
2558
+ constants.put( "ON_REWARDED_AD_RECEIVED_REWARD_EVENT", ON_REWARDED_AD_RECEIVED_REWARD_EVENT );
2559
+ constants.put( "ON_REWARDED_AD_REVENUE_PAID", ON_REWARDED_AD_REVENUE_PAID );
2560
+
2561
+ constants.put( "ON_APPOPEN_AD_LOADED_EVENT", ON_APPOPEN_AD_LOADED_EVENT );
2562
+ constants.put( "ON_APPOPEN_AD_LOAD_FAILED_EVENT", ON_APPOPEN_AD_LOAD_FAILED_EVENT );
2563
+ constants.put( "ON_APPOPEN_AD_CLICKED_EVENT", ON_APPOPEN_AD_CLICKED_EVENT );
2564
+ constants.put( "ON_APPOPEN_AD_DISPLAYED_EVENT", ON_APPOPEN_AD_DISPLAYED_EVENT );
2565
+ constants.put( "ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT", ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT );
2566
+ constants.put( "ON_APPOPEN_AD_HIDDEN_EVENT", ON_APPOPEN_AD_HIDDEN_EVENT );
2567
+ constants.put( "ON_APPOPEN_AD_REVENUE_PAID", ON_APPOPEN_AD_REVENUE_PAID );
2568
+
2569
+ constants.put( "TOP_CENTER_POSITION", TOP_CENTER );
2570
+ constants.put( "TOP_LEFT_POSITION", TOP_LEFT );
2571
+ constants.put( "TOP_RIGHT_POSITION", TOP_RIGHT );
2572
+ constants.put( "CENTERED_POSITION", CENTERED );
2573
+ constants.put( "CENTER_LEFT_POSITION", CENTER_LEFT );
2574
+ constants.put( "CENTER_RIGHT_POSITION", CENTER_RIGHT );
2575
+ constants.put( "BOTTOM_LEFT_POSITION", BOTTOM_LEFT );
2576
+ constants.put( "BOTTOM_CENTER_POSITION", BOTTOM_CENTER );
2577
+ constants.put( "BOTTOM_RIGHT_POSITION", BOTTOM_RIGHT );
2578
+
2579
+ constants.put( "BANNER_AD_FORMAT_LABEL", MaxAdFormat.BANNER.getLabel() );
2580
+ constants.put( "MREC_AD_FORMAT_LABEL", MaxAdFormat.MREC.getLabel() );
2581
+
2582
+ return constants;
2100
2583
  }
2101
2584
  }