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.
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewManager.java +7 -0
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXModule.java +12 -2
- package/package.json +1 -1
- package/react-native-applovin-max.podspec +1 -1
- package/src/index.js +1 -1
package/android/build.gradle
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
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 => "
|
|
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
|
|