react-native-applovin-max 2.5.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,8 +41,8 @@ android {
41
41
  defaultConfig {
42
42
  minSdkVersion 16
43
43
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
44
- versionCode 2050000
45
- versionName "2.5.0"
44
+ versionCode 2050100
45
+ versionName "2.5.1"
46
46
  }
47
47
 
48
48
  flavorDimensions("default")
@@ -152,6 +152,13 @@ class AppLovinMAXAdViewManager
152
152
  // NOTE: Android destroys the native MaxAdView and calls this method while iOS caches it when you remove it from screen
153
153
  adUnitIdRegistry.remove( view );
154
154
 
155
+ // HACK ALERT: Since current SDK does not respect auto-refresh APIs until _after_ `onAdLoaded()`, explicitly expose view validity to the main module
156
+ MaxAdView adView = view.getAdView();
157
+ if ( adView != null )
158
+ {
159
+ AppLovinMAXModule.sAdViewsToRemove.put( adView.getAdUnitId(), adView );
160
+ }
161
+
155
162
  super.onDropViewInstance( view );
156
163
  }
157
164
  }
@@ -45,6 +45,7 @@ import com.facebook.react.bridge.ReadableMap;
45
45
  import com.facebook.react.bridge.WritableMap;
46
46
 
47
47
  import java.util.ArrayList;
48
+ import java.util.Collections;
48
49
  import java.util.HashMap;
49
50
  import java.util.HashSet;
50
51
  import java.util.List;
@@ -98,6 +99,9 @@ public class AppLovinMAXModule
98
99
  private final List<String> mAdUnitIdsToShowAfterCreate = new ArrayList<>( 2 );
99
100
  private final Set<String> mDisabledAdaptiveBannerAdUnitIds = new HashSet<>( 2 );
100
101
 
102
+ // TODO: Remove when v11.0.0 SDKs are released
103
+ public final static Map<String, MaxAdView> sAdViewsToRemove = Collections.synchronizedMap( new HashMap<>() );
104
+
101
105
  public static AppLovinMAXModule getInstance()
102
106
  {
103
107
  return instance;
@@ -660,6 +664,12 @@ public class AppLovinMAXModule
660
664
  {
661
665
  adView.stopAutoRefresh();
662
666
  }
667
+
668
+ adView = sAdViewsToRemove.remove( ad.getAdUnitId() );
669
+ if ( adView != null )
670
+ {
671
+ adView.stopAutoRefresh();
672
+ }
663
673
  }
664
674
  else if ( MaxAdFormat.INTERSTITIAL == adFormat )
665
675
  {
@@ -1503,8 +1513,8 @@ public class AppLovinMAXModule
1503
1513
  .emit( name, params );
1504
1514
  }
1505
1515
 
1506
- @Override
1507
- @Nullable public Map<String, Object> getConstants()
1516
+ @Override @Nullable
1517
+ public Map<String, Object> getConstants()
1508
1518
  {
1509
1519
  return super.getConstants();
1510
1520
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-applovin-max",
3
3
  "author": "AppLovin Corporation",
4
- "version": "2.5.0",
4
+ "version": "2.5.1",
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,7 +11,7 @@ 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_2_5_0" }
14
+ s.source = { :git => "https://github.com/AppLovin/AppLovin-MAX-React-Native.git", :tag => "release_2_5_1" }
15
15
 
16
16
  s.source_files = "ios/AppLovinMAX*.{h,m}"
17
17
 
package/src/index.js CHANGED
@@ -3,7 +3,7 @@ import AdView from "./AppLovinMAXAdView";
3
3
 
4
4
  const { AppLovinMAX } = NativeModules;
5
5
 
6
- const VERSION = "2.5.0";
6
+ const VERSION = "2.5.1";
7
7
 
8
8
  /**
9
9
  * This enum represents whether or not the consent dialog should be shown for this user.