react-native-applovin-max 9.1.0 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdView.java +3 -9
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewUiComponent.java +17 -8
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXModuleImpl.java +35 -14
- package/android/src/newarch/com/applovin/reactnative/AppLovinMAXModule.java +6 -6
- package/android/src/oldarch/com/applovin/reactnative/AppLovinMAXModule.java +6 -6
- package/ios/AppLovinMAX.mm +35 -13
- package/ios/AppLovinMAXAdView.h +1 -0
- package/ios/AppLovinMAXAdView.mm +3 -9
- package/ios/AppLovinMAXAdViewUIComponent.h +1 -2
- package/ios/AppLovinMAXAdViewUIComponent.mm +18 -10
- package/lib/commonjs/AdView.js +3 -3
- package/lib/commonjs/AdView.js.map +1 -1
- package/lib/commonjs/AppLovinMAX.js +1 -1
- package/lib/commonjs/BannerAd.js +2 -3
- package/lib/commonjs/BannerAd.js.map +1 -1
- package/lib/commonjs/index.js +1 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdView.js +1 -2
- package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js +1 -2
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js +1 -2
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js.map +1 -1
- package/lib/commonjs/specs/NativeAppLovinMAXModule.js.map +1 -1
- package/lib/module/AdView.js +2 -1
- package/lib/module/AdView.js.map +1 -1
- package/lib/module/AppLovinMAX.js +1 -1
- package/lib/module/BannerAd.js +2 -3
- package/lib/module/BannerAd.js.map +1 -1
- package/lib/module/specs/NativeAppLovinMAXModule.js.map +1 -1
- package/lib/typescript/src/BannerAd.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeAppLovinMAXModule.d.ts +3 -3
- package/lib/typescript/src/specs/NativeAppLovinMAXModule.d.ts.map +1 -1
- package/lib/typescript/src/types/AdViewProps.d.ts +4 -0
- package/lib/typescript/src/types/AdViewProps.d.ts.map +1 -1
- package/lib/typescript/src/types/BannerAd.d.ts +2 -1
- package/lib/typescript/src/types/BannerAd.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-applovin-max.podspec +2 -2
- package/src/AdView.tsx +2 -2
- package/src/AppLovinMAX.ts +1 -1
- package/src/BannerAd.ts +2 -3
- package/src/specs/NativeAppLovinMAXModule.ts +3 -2
- package/src/types/AdViewProps.ts +5 -0
- package/src/types/BannerAd.ts +2 -1
package/android/build.gradle
CHANGED
|
@@ -53,8 +53,8 @@ android {
|
|
|
53
53
|
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
54
54
|
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
55
55
|
|
|
56
|
-
buildConfigField("int", "VERSION_CODE", "
|
|
57
|
-
buildConfigField("String", "VERSION_NAME", "\"9.
|
|
56
|
+
buildConfigField("int", "VERSION_CODE", "9020000")
|
|
57
|
+
buildConfigField("String", "VERSION_NAME", "\"9.2.0\"")
|
|
58
58
|
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -96,6 +96,6 @@ dependencies {
|
|
|
96
96
|
//noinspection GradleDynamicVersion
|
|
97
97
|
implementation "com.facebook.react:react-native:0.75.4"
|
|
98
98
|
|
|
99
|
-
implementation "com.applovin:applovin-sdk:13.
|
|
99
|
+
implementation "com.applovin:applovin-sdk:13.3.0"
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -76,6 +76,7 @@ public class AppLovinMAXAdView
|
|
|
76
76
|
|
|
77
77
|
public static void preloadNativeUIComponentAdView(final String adUnitId,
|
|
78
78
|
final MaxAdFormat adFormat,
|
|
79
|
+
final boolean isAdaptive,
|
|
79
80
|
@Nullable final String placement,
|
|
80
81
|
@Nullable final String customData,
|
|
81
82
|
@Nullable final Map<String, Object> extraParameters,
|
|
@@ -83,7 +84,7 @@ public class AppLovinMAXAdView
|
|
|
83
84
|
final Promise promise,
|
|
84
85
|
final ReactContext context)
|
|
85
86
|
{
|
|
86
|
-
AppLovinMAXAdViewUiComponent preloadedUiComponent = new AppLovinMAXAdViewUiComponent( adUnitId, adFormat, context );
|
|
87
|
+
AppLovinMAXAdViewUiComponent preloadedUiComponent = new AppLovinMAXAdViewUiComponent( adUnitId, adFormat, isAdaptive, context );
|
|
87
88
|
preloadedUiComponentInstances.put( preloadedUiComponent.hashCode(), preloadedUiComponent );
|
|
88
89
|
|
|
89
90
|
preloadedUiComponent.setPlacement( placement );
|
|
@@ -189,11 +190,6 @@ public class AppLovinMAXAdView
|
|
|
189
190
|
public void setAdaptiveBannerEnabled(final boolean enabled)
|
|
190
191
|
{
|
|
191
192
|
adaptiveBannerEnabled = enabled;
|
|
192
|
-
|
|
193
|
-
if ( uiComponent != null )
|
|
194
|
-
{
|
|
195
|
-
uiComponent.setAdaptiveBannerEnabled( adaptiveBannerEnabled );
|
|
196
|
-
}
|
|
197
193
|
}
|
|
198
194
|
|
|
199
195
|
public void setAutoRefreshEnabled(final boolean enabled)
|
|
@@ -314,14 +310,13 @@ public class AppLovinMAXAdView
|
|
|
314
310
|
{
|
|
315
311
|
AppLovinMAXModuleImpl.d( "Mounting the preloaded AdView (" + adViewId + ") for Ad Unit ID " + adUnitId );
|
|
316
312
|
|
|
317
|
-
uiComponent.setAdaptiveBannerEnabled( adaptiveBannerEnabled );
|
|
318
313
|
uiComponent.setAutoRefreshEnabled( autoRefreshEnabled );
|
|
319
314
|
uiComponent.attachAdView( AppLovinMAXAdView.this );
|
|
320
315
|
return;
|
|
321
316
|
}
|
|
322
317
|
}
|
|
323
318
|
|
|
324
|
-
uiComponent = new AppLovinMAXAdViewUiComponent( adUnitId, adFormat, reactContext );
|
|
319
|
+
uiComponent = new AppLovinMAXAdViewUiComponent( adUnitId, adFormat, adaptiveBannerEnabled, reactContext );
|
|
325
320
|
adViewId = uiComponent.hashCode();
|
|
326
321
|
uiComponentInstances.put( adViewId, uiComponent );
|
|
327
322
|
|
|
@@ -331,7 +326,6 @@ public class AppLovinMAXAdView
|
|
|
331
326
|
uiComponent.setCustomData( customData );
|
|
332
327
|
uiComponent.setExtraParameters( extraParameters );
|
|
333
328
|
uiComponent.setLocalExtraParameters( localExtraParameters );
|
|
334
|
-
uiComponent.setAdaptiveBannerEnabled( adaptiveBannerEnabled );
|
|
335
329
|
uiComponent.setAutoRefreshEnabled( autoRefreshEnabled );
|
|
336
330
|
|
|
337
331
|
uiComponent.attachAdView( AppLovinMAXAdView.this );
|
|
@@ -7,6 +7,7 @@ import com.applovin.mediation.MaxAdFormat;
|
|
|
7
7
|
import com.applovin.mediation.MaxAdListener;
|
|
8
8
|
import com.applovin.mediation.MaxAdRevenueListener;
|
|
9
9
|
import com.applovin.mediation.MaxAdViewAdListener;
|
|
10
|
+
import com.applovin.mediation.MaxAdViewConfiguration;
|
|
10
11
|
import com.applovin.mediation.MaxError;
|
|
11
12
|
import com.applovin.mediation.ads.MaxAdView;
|
|
12
13
|
import com.facebook.react.bridge.ReactContext;
|
|
@@ -28,15 +29,28 @@ class AppLovinMAXAdViewUiComponent
|
|
|
28
29
|
@Nullable
|
|
29
30
|
private AppLovinMAXAdView containerView;
|
|
30
31
|
|
|
31
|
-
public AppLovinMAXAdViewUiComponent(final String adUnitId, final MaxAdFormat adFormat, final ReactContext context)
|
|
32
|
+
public AppLovinMAXAdViewUiComponent(final String adUnitId, final MaxAdFormat adFormat, final boolean isAdaptive, final ReactContext context)
|
|
32
33
|
{
|
|
33
34
|
reactContext = context;
|
|
34
35
|
surfaceId = UIManagerHelper.getSurfaceId( context );
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
MaxAdViewConfiguration.Builder builder = MaxAdViewConfiguration.builder();
|
|
38
|
+
|
|
39
|
+
if ( adFormat.isBannerOrLeaderAd() )
|
|
40
|
+
{
|
|
41
|
+
if ( isAdaptive )
|
|
42
|
+
{
|
|
43
|
+
builder.setAdaptiveType( MaxAdViewConfiguration.AdaptiveType.ANCHORED );
|
|
44
|
+
}
|
|
45
|
+
else
|
|
46
|
+
{
|
|
47
|
+
builder.setAdaptiveType( MaxAdViewConfiguration.AdaptiveType.NONE );
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
adView = new MaxAdView( adUnitId, adFormat, builder.build() );
|
|
37
52
|
adView.setListener( this );
|
|
38
53
|
adView.setRevenueListener( this );
|
|
39
|
-
adView.setExtraParameter( "adaptive_banner", "true" );
|
|
40
54
|
|
|
41
55
|
// Set this extra parameter to work around a SDK bug that ignores calls to stopAutoRefresh()
|
|
42
56
|
adView.setExtraParameter( "allow_pause_auto_refresh_immediately", "true" );
|
|
@@ -64,11 +78,6 @@ class AppLovinMAXAdViewUiComponent
|
|
|
64
78
|
adView.setCustomData( value );
|
|
65
79
|
}
|
|
66
80
|
|
|
67
|
-
public void setAdaptiveBannerEnabled(final boolean enabled)
|
|
68
|
-
{
|
|
69
|
-
adView.setExtraParameter( "adaptive_banner", Boolean.toString( enabled ) );
|
|
70
|
-
}
|
|
71
|
-
|
|
72
81
|
public void setAutoRefreshEnabled(final boolean enabled)
|
|
73
82
|
{
|
|
74
83
|
if ( enabled )
|
|
@@ -23,6 +23,7 @@ import com.applovin.mediation.MaxAdFormat;
|
|
|
23
23
|
import com.applovin.mediation.MaxAdListener;
|
|
24
24
|
import com.applovin.mediation.MaxAdRevenueListener;
|
|
25
25
|
import com.applovin.mediation.MaxAdViewAdListener;
|
|
26
|
+
import com.applovin.mediation.MaxAdViewConfiguration;
|
|
26
27
|
import com.applovin.mediation.MaxAdWaterfallInfo;
|
|
27
28
|
import com.applovin.mediation.MaxError;
|
|
28
29
|
import com.applovin.mediation.MaxErrorCode;
|
|
@@ -78,7 +79,7 @@ public class AppLovinMAXModuleImpl
|
|
|
78
79
|
{
|
|
79
80
|
private static final String SDK_TAG = "AppLovinSdk";
|
|
80
81
|
private static final String TAG = "AppLovinMAXModule";
|
|
81
|
-
private static final String PLUGIN_VERSION = "9.
|
|
82
|
+
private static final String PLUGIN_VERSION = "9.2.0";
|
|
82
83
|
|
|
83
84
|
private static final String USER_GEOGRAPHY_GDPR = "G";
|
|
84
85
|
private static final String USER_GEOGRAPHY_OTHER = "O";
|
|
@@ -100,6 +101,7 @@ public class AppLovinMAXModuleImpl
|
|
|
100
101
|
|
|
101
102
|
static
|
|
102
103
|
{
|
|
104
|
+
ALCompatibleNativeSdkVersions.put( "9.2.0", "13.3.0" );
|
|
103
105
|
ALCompatibleNativeSdkVersions.put( "9.1.0", "13.2.0" );
|
|
104
106
|
ALCompatibleNativeSdkVersions.put( "9.0.0", "13.0.1" );
|
|
105
107
|
ALCompatibleNativeSdkVersions.put( "8.2.0", "13.0.1" );
|
|
@@ -525,7 +527,7 @@ public class AppLovinMAXModuleImpl
|
|
|
525
527
|
|
|
526
528
|
// BANNERS
|
|
527
529
|
|
|
528
|
-
public void createBanner(final String adUnitId, final String bannerPosition)
|
|
530
|
+
public void createBanner(final String adUnitId, final String bannerPosition, final boolean isAdaptive)
|
|
529
531
|
{
|
|
530
532
|
if ( sdk == null )
|
|
531
533
|
{
|
|
@@ -533,11 +535,11 @@ public class AppLovinMAXModuleImpl
|
|
|
533
535
|
return;
|
|
534
536
|
}
|
|
535
537
|
|
|
536
|
-
createAdView( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), bannerPosition, DEFAULT_AD_VIEW_OFFSET );
|
|
538
|
+
createAdView( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), bannerPosition, DEFAULT_AD_VIEW_OFFSET, isAdaptive );
|
|
537
539
|
}
|
|
538
540
|
|
|
539
541
|
// NOTE: No function overloading in JS so we need new method signature
|
|
540
|
-
public void createBannerWithOffsets(final String adUnitId, final String bannerPosition, final float x, final float y)
|
|
542
|
+
public void createBannerWithOffsets(final String adUnitId, final String bannerPosition, final float x, final float y, final boolean isAdaptive)
|
|
541
543
|
{
|
|
542
544
|
if ( sdk == null )
|
|
543
545
|
{
|
|
@@ -545,7 +547,7 @@ public class AppLovinMAXModuleImpl
|
|
|
545
547
|
return;
|
|
546
548
|
}
|
|
547
549
|
|
|
548
|
-
createAdView( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), bannerPosition, getOffsetPixels( x, y, reactContext ) );
|
|
550
|
+
createAdView( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), bannerPosition, getOffsetPixels( x, y, reactContext ), isAdaptive );
|
|
549
551
|
}
|
|
550
552
|
|
|
551
553
|
public void setBannerBackgroundColor(final String adUnitId, final String hexColorCode)
|
|
@@ -701,7 +703,7 @@ public class AppLovinMAXModuleImpl
|
|
|
701
703
|
return;
|
|
702
704
|
}
|
|
703
705
|
|
|
704
|
-
createAdView( adUnitId, MaxAdFormat.MREC, mrecPosition, DEFAULT_AD_VIEW_OFFSET );
|
|
706
|
+
createAdView( adUnitId, MaxAdFormat.MREC, mrecPosition, DEFAULT_AD_VIEW_OFFSET, false );
|
|
705
707
|
}
|
|
706
708
|
|
|
707
709
|
public void setMRecPlacement(final String adUnitId, @Nullable final String placement)
|
|
@@ -1035,7 +1037,7 @@ public class AppLovinMAXModuleImpl
|
|
|
1035
1037
|
|
|
1036
1038
|
// ADVIEW PRELOADING
|
|
1037
1039
|
|
|
1038
|
-
public void preloadNativeUIComponentAdView(final String adUnitId, final String adFormatStr, @Nullable final String placement, @Nullable final String customData, @Nullable final ReadableMap extraParameterMap, @Nullable final ReadableMap localExtraParameterMap, final Promise promise)
|
|
1040
|
+
public void preloadNativeUIComponentAdView(final String adUnitId, final String adFormatStr, final boolean isAdaptive, @Nullable final String placement, @Nullable final String customData, @Nullable final ReadableMap extraParameterMap, @Nullable final ReadableMap localExtraParameterMap, final Promise promise)
|
|
1039
1041
|
{
|
|
1040
1042
|
MaxAdFormat adFormat;
|
|
1041
1043
|
|
|
@@ -1059,6 +1061,7 @@ public class AppLovinMAXModuleImpl
|
|
|
1059
1061
|
|
|
1060
1062
|
reactContext.runOnUiQueueThread( () -> AppLovinMAXAdView.preloadNativeUIComponentAdView( adUnitId,
|
|
1061
1063
|
finalAdFormat,
|
|
1064
|
+
isAdaptive,
|
|
1062
1065
|
placement,
|
|
1063
1066
|
customData,
|
|
1064
1067
|
extraParameters,
|
|
@@ -1347,7 +1350,7 @@ public class AppLovinMAXModuleImpl
|
|
|
1347
1350
|
|
|
1348
1351
|
// INTERNAL METHODS
|
|
1349
1352
|
|
|
1350
|
-
private void createAdView(final String adUnitId, final MaxAdFormat adFormat, final String adViewPosition, final Point adViewOffsetPixels)
|
|
1353
|
+
private void createAdView(final String adUnitId, final MaxAdFormat adFormat, final String adViewPosition, final Point adViewOffsetPixels, final boolean isAdaptive)
|
|
1351
1354
|
{
|
|
1352
1355
|
// Run on main thread to ensure there are no concurrency issues with other ad view methods
|
|
1353
1356
|
reactContext.runOnUiQueueThread( () -> {
|
|
@@ -1355,7 +1358,7 @@ public class AppLovinMAXModuleImpl
|
|
|
1355
1358
|
d( "Creating " + adFormat.getLabel() + " with ad unit id \"" + adUnitId + "\", position: \"" + adViewPosition + "\", and offset: " + adViewOffsetPixels );
|
|
1356
1359
|
|
|
1357
1360
|
// Retrieve ad view from the map
|
|
1358
|
-
final MaxAdView adView = retrieveAdView( adUnitId, adFormat, adViewPosition, adViewOffsetPixels );
|
|
1361
|
+
final MaxAdView adView = retrieveAdView( adUnitId, adFormat, adViewPosition, adViewOffsetPixels, isAdaptive );
|
|
1359
1362
|
if ( adView == null )
|
|
1360
1363
|
{
|
|
1361
1364
|
e( adFormat.getLabel() + " does not exist" );
|
|
@@ -1390,7 +1393,7 @@ public class AppLovinMAXModuleImpl
|
|
|
1390
1393
|
|
|
1391
1394
|
d( "Setting placement \"" + placement + "\" for " + adFormat.getLabel() + " with ad unit id \"" + adUnitId + "\"" );
|
|
1392
1395
|
|
|
1393
|
-
final MaxAdView adView = retrieveAdView( adUnitId, adFormat, "", DEFAULT_AD_VIEW_OFFSET );
|
|
1396
|
+
final MaxAdView adView = retrieveAdView( adUnitId, adFormat, "", DEFAULT_AD_VIEW_OFFSET, true );
|
|
1394
1397
|
if ( adView == null )
|
|
1395
1398
|
{
|
|
1396
1399
|
e( adFormat.getLabel() + " does not exist" );
|
|
@@ -1407,7 +1410,7 @@ public class AppLovinMAXModuleImpl
|
|
|
1407
1410
|
|
|
1408
1411
|
d( "Setting custom data \"" + customData + "\" for " + adFormat.getLabel() + " with ad unit id \"" + adUnitId + "\"" );
|
|
1409
1412
|
|
|
1410
|
-
final MaxAdView adView = retrieveAdView( adUnitId, adFormat, "", DEFAULT_AD_VIEW_OFFSET );
|
|
1413
|
+
final MaxAdView adView = retrieveAdView( adUnitId, adFormat, "", DEFAULT_AD_VIEW_OFFSET, true );
|
|
1411
1414
|
if ( adView == null )
|
|
1412
1415
|
{
|
|
1413
1416
|
e( adFormat.getLabel() + " does not exist" );
|
|
@@ -1581,6 +1584,8 @@ public class AppLovinMAXModuleImpl
|
|
|
1581
1584
|
}
|
|
1582
1585
|
else if ( "adaptive_banner".equalsIgnoreCase( key ) )
|
|
1583
1586
|
{
|
|
1587
|
+
e( "Setting adaptive banners via extra parameters is deprecated and will be removed in a future plugin version. Please use the BannerAd.createAd(adUnitId: string, position: AdViewPosition, xOffset: number, yOffset: number, isAdaptive: boolean) API to properly configure adaptive banners." );
|
|
1588
|
+
|
|
1584
1589
|
boolean useAdaptiveBannerAdSize = Boolean.parseBoolean( value );
|
|
1585
1590
|
if ( useAdaptiveBannerAdSize )
|
|
1586
1591
|
{
|
|
@@ -1727,15 +1732,31 @@ public class AppLovinMAXModuleImpl
|
|
|
1727
1732
|
|
|
1728
1733
|
private MaxAdView retrieveAdView(String adUnitId, MaxAdFormat adFormat)
|
|
1729
1734
|
{
|
|
1730
|
-
return retrieveAdView( adUnitId, adFormat, null, DEFAULT_AD_VIEW_OFFSET );
|
|
1735
|
+
return retrieveAdView( adUnitId, adFormat, null, DEFAULT_AD_VIEW_OFFSET, true );
|
|
1731
1736
|
}
|
|
1732
1737
|
|
|
1733
|
-
private MaxAdView retrieveAdView(String adUnitId, MaxAdFormat adFormat, String adViewPosition, Point adViewOffsetPixels)
|
|
1738
|
+
private MaxAdView retrieveAdView(String adUnitId, MaxAdFormat adFormat, String adViewPosition, Point adViewOffsetPixels, final boolean isAdaptive)
|
|
1734
1739
|
{
|
|
1735
1740
|
MaxAdView result = adViews.get( adUnitId );
|
|
1736
1741
|
if ( result == null && adViewPosition != null && adViewOffsetPixels != null )
|
|
1737
1742
|
{
|
|
1738
|
-
|
|
1743
|
+
MaxAdViewConfiguration.Builder builder = MaxAdViewConfiguration.builder();
|
|
1744
|
+
|
|
1745
|
+
// Set adaptive type only for banner ads. If adaptive is enabled, use ANCHORED; otherwise, fall back to NONE.
|
|
1746
|
+
if ( adFormat.isBannerOrLeaderAd() )
|
|
1747
|
+
{
|
|
1748
|
+
if ( isAdaptive )
|
|
1749
|
+
{
|
|
1750
|
+
builder.setAdaptiveType( MaxAdViewConfiguration.AdaptiveType.ANCHORED );
|
|
1751
|
+
}
|
|
1752
|
+
else
|
|
1753
|
+
{
|
|
1754
|
+
builder.setAdaptiveType( MaxAdViewConfiguration.AdaptiveType.NONE );
|
|
1755
|
+
disabledAdaptiveBannerAdUnitIds.add( adUnitId );
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
result = new MaxAdView( adUnitId, adFormat, builder.build() );
|
|
1739
1760
|
result.setListener( this );
|
|
1740
1761
|
result.setRevenueListener( this );
|
|
1741
1762
|
|
|
@@ -175,15 +175,15 @@ public class AppLovinMAXModule
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
@Override
|
|
178
|
-
public void createBanner(final String adUnitId, final String position)
|
|
178
|
+
public void createBanner(final String adUnitId, final String position, final boolean isAdaptive)
|
|
179
179
|
{
|
|
180
|
-
impl.createBanner( adUnitId, position );
|
|
180
|
+
impl.createBanner( adUnitId, position, isAdaptive );
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
@Override
|
|
184
|
-
public void createBannerWithOffsets(final String adUnitId, final String position, final double xOffset, final double yOffset)
|
|
184
|
+
public void createBannerWithOffsets(final String adUnitId, final String position, final double xOffset, final double yOffset, final boolean isAdaptive)
|
|
185
185
|
{
|
|
186
|
-
impl.createBannerWithOffsets( adUnitId, position, (float) xOffset, (float) yOffset );
|
|
186
|
+
impl.createBannerWithOffsets( adUnitId, position, (float) xOffset, (float) yOffset, isAdaptive );
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
@Override
|
|
@@ -427,9 +427,9 @@ public class AppLovinMAXModule
|
|
|
427
427
|
}
|
|
428
428
|
|
|
429
429
|
@Override
|
|
430
|
-
public void preloadNativeUIComponentAdView(final String adUnitId, final String adFormat, @Nullable final String placement, @Nullable final String customData, @Nullable final ReadableMap extraParameters, @Nullable final ReadableMap localExtraParameters, final Promise promise)
|
|
430
|
+
public void preloadNativeUIComponentAdView(final String adUnitId, final String adFormat, final boolean isAdaptive, @Nullable final String placement, @Nullable final String customData, @Nullable final ReadableMap extraParameters, @Nullable final ReadableMap localExtraParameters, final Promise promise)
|
|
431
431
|
{
|
|
432
|
-
impl.preloadNativeUIComponentAdView( adUnitId, adFormat, placement, customData, extraParameters, localExtraParameters, promise );
|
|
432
|
+
impl.preloadNativeUIComponentAdView( adUnitId, adFormat, isAdaptive, placement, customData, extraParameters, localExtraParameters, promise );
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
@Override
|
|
@@ -175,15 +175,15 @@ public class AppLovinMAXModule
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
@ReactMethod
|
|
178
|
-
public void createBanner(final String adUnitId, final String position)
|
|
178
|
+
public void createBanner(final String adUnitId, final String position, final boolean isAdaptive)
|
|
179
179
|
{
|
|
180
|
-
impl.createBanner( adUnitId, position );
|
|
180
|
+
impl.createBanner( adUnitId, position, isAdaptive );
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
@ReactMethod
|
|
184
|
-
public void createBannerWithOffsets(final String adUnitId, final String position, final double xOffset, final double yOffset)
|
|
184
|
+
public void createBannerWithOffsets(final String adUnitId, final String position, final double xOffset, final double yOffset, final boolean isAdaptive)
|
|
185
185
|
{
|
|
186
|
-
impl.createBannerWithOffsets( adUnitId, position, (float) xOffset, (float) yOffset );
|
|
186
|
+
impl.createBannerWithOffsets( adUnitId, position, (float) xOffset, (float) yOffset, isAdaptive );
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
@ReactMethod
|
|
@@ -427,9 +427,9 @@ public class AppLovinMAXModule
|
|
|
427
427
|
}
|
|
428
428
|
|
|
429
429
|
@ReactMethod
|
|
430
|
-
public void preloadNativeUIComponentAdView(final String adUnitId, final String adFormat, @Nullable final String placement, @Nullable final String customData, @Nullable final ReadableMap extraParameters, @Nullable final ReadableMap localExtraParameters, final Promise promise)
|
|
430
|
+
public void preloadNativeUIComponentAdView(final String adUnitId, final String adFormat, final boolean isAdaptive, @Nullable final String placement, @Nullable final String customData, @Nullable final ReadableMap extraParameters, @Nullable final ReadableMap localExtraParameters, final Promise promise)
|
|
431
431
|
{
|
|
432
|
-
impl.preloadNativeUIComponentAdView( adUnitId, adFormat, placement, customData, extraParameters, localExtraParameters, promise );
|
|
432
|
+
impl.preloadNativeUIComponentAdView( adUnitId, adFormat, isAdaptive, placement, customData, extraParameters, localExtraParameters, promise );
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
@ReactMethod
|
package/ios/AppLovinMAX.mm
CHANGED
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
@implementation AppLovinMAX
|
|
74
74
|
static NSString *const SDK_TAG = @"AppLovinSdk";
|
|
75
75
|
static NSString *const TAG = @"AppLovinMAX";
|
|
76
|
-
static NSString *const PLUGIN_VERSION = @"9.
|
|
76
|
+
static NSString *const PLUGIN_VERSION = @"9.2.0";
|
|
77
77
|
|
|
78
78
|
static NSString *const USER_GEOGRAPHY_GDPR = @"G";
|
|
79
79
|
static NSString *const USER_GEOGRAPHY_OTHER = @"O";
|
|
@@ -149,6 +149,7 @@ RCT_EXPORT_MODULE()
|
|
|
149
149
|
[super initialize];
|
|
150
150
|
|
|
151
151
|
ALCompatibleNativeSDKVersions = @{
|
|
152
|
+
@"9.2.0" : @"13.3.0",
|
|
152
153
|
@"9.1.0" : @"13.2.0",
|
|
153
154
|
@"9.0.0" : @"13.0.1",
|
|
154
155
|
@"8.2.0" : @"13.0.1",
|
|
@@ -485,7 +486,7 @@ RCT_EXPORT_METHOD(trackEvent:(NSString *)event :(NSDictionary<NSString *, id> *)
|
|
|
485
486
|
|
|
486
487
|
#pragma mark - Banners
|
|
487
488
|
|
|
488
|
-
RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition)
|
|
489
|
+
RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition isAdaptive:(BOOL)isAdaptive)
|
|
489
490
|
{
|
|
490
491
|
if ( !self.sdk )
|
|
491
492
|
{
|
|
@@ -493,11 +494,11 @@ RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier position:(NSString *
|
|
|
493
494
|
return;
|
|
494
495
|
}
|
|
495
496
|
|
|
496
|
-
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT atPosition: bannerPosition withOffset: CGPointZero];
|
|
497
|
+
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT atPosition: bannerPosition withOffset: CGPointZero isAdaptive: isAdaptive];
|
|
497
498
|
}
|
|
498
499
|
|
|
499
500
|
// NOTE: No function overloading in JS so we need new method signature
|
|
500
|
-
RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition xOffset:(double)xOffset yOffset:(double)yOffset)
|
|
501
|
+
RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition xOffset:(double)xOffset yOffset:(double)yOffset isAdaptive:(BOOL)isAdaptive)
|
|
501
502
|
{
|
|
502
503
|
if ( !self.sdk )
|
|
503
504
|
{
|
|
@@ -505,7 +506,7 @@ RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier position:
|
|
|
505
506
|
return;
|
|
506
507
|
}
|
|
507
508
|
|
|
508
|
-
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT atPosition: bannerPosition withOffset: CGPointMake(xOffset, yOffset)];
|
|
509
|
+
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT atPosition: bannerPosition withOffset: CGPointMake(xOffset, yOffset) isAdaptive: isAdaptive];
|
|
509
510
|
}
|
|
510
511
|
|
|
511
512
|
RCT_EXPORT_METHOD(setBannerBackgroundColor:(NSString *)adUnitIdentifier hexColorCode:(NSString *)hexColorCode)
|
|
@@ -664,7 +665,7 @@ RCT_EXPORT_METHOD(createMRec:(NSString *)adUnitIdentifier position:(NSString *)m
|
|
|
664
665
|
return;
|
|
665
666
|
}
|
|
666
667
|
|
|
667
|
-
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec atPosition: mrecPosition withOffset: CGPointZero];
|
|
668
|
+
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec atPosition: mrecPosition withOffset: CGPointZero isAdaptive: NO];
|
|
668
669
|
}
|
|
669
670
|
|
|
670
671
|
RCT_EXPORT_METHOD(setMRecPlacement:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement)
|
|
@@ -956,6 +957,7 @@ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier p
|
|
|
956
957
|
|
|
957
958
|
RCT_EXPORT_METHOD(preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
958
959
|
adFormat:(NSString *)adFormatStr
|
|
960
|
+
isAdaptive:(BOOL)isAdaptive
|
|
959
961
|
placement:(nullable NSString *)placement
|
|
960
962
|
customData:(nullable NSString *)customData
|
|
961
963
|
extraParameters:(nullable NSDictionary<NSString *, id> *)extraParameterDict
|
|
@@ -981,6 +983,7 @@ RCT_EXPORT_METHOD(preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
|
981
983
|
|
|
982
984
|
[AppLovinMAXAdView preloadNativeUIComponentAdView: adUnitIdentifier
|
|
983
985
|
adFormat: adFormat
|
|
986
|
+
isAdaptive: isAdaptive
|
|
984
987
|
placement: placement
|
|
985
988
|
customData: customData
|
|
986
989
|
extraParameters: extraParameterDict
|
|
@@ -1268,14 +1271,14 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(double)adViewId
|
|
|
1268
1271
|
|
|
1269
1272
|
#pragma mark - Internal Methods
|
|
1270
1273
|
|
|
1271
|
-
- (void)createAdViewWithAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat atPosition:(NSString *)adViewPosition withOffset:(CGPoint)offset
|
|
1274
|
+
- (void)createAdViewWithAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat atPosition:(NSString *)adViewPosition withOffset:(CGPoint)offset isAdaptive:(BOOL)isAdaptive
|
|
1272
1275
|
{
|
|
1273
1276
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
1274
1277
|
|
|
1275
1278
|
[self log: @"Creating %@ with ad unit identifier \"%@\", position: \"%@\", and offset: %@", adFormat, adUnitIdentifier, adViewPosition, NSStringFromCGPoint(offset)];
|
|
1276
1279
|
|
|
1277
1280
|
// Retrieve ad view from the map
|
|
1278
|
-
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: adViewPosition withOffset: offset];
|
|
1281
|
+
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: adViewPosition withOffset: offset isAdaptive: isAdaptive];
|
|
1279
1282
|
adView.hidden = YES;
|
|
1280
1283
|
self.safeAreaBackground.hidden = YES;
|
|
1281
1284
|
|
|
@@ -1323,7 +1326,7 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(double)adViewId
|
|
|
1323
1326
|
|
|
1324
1327
|
[self log: @"Setting placement \"%@\" for \"%@\" with ad unit identifier \"%@\"", placement, adFormat, adUnitIdentifier];
|
|
1325
1328
|
|
|
1326
|
-
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: @"" withOffset: CGPointZero];
|
|
1329
|
+
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: @"" withOffset: CGPointZero isAdaptive: YES];
|
|
1327
1330
|
adView.placement = placement;
|
|
1328
1331
|
});
|
|
1329
1332
|
}
|
|
@@ -1334,7 +1337,7 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(double)adViewId
|
|
|
1334
1337
|
|
|
1335
1338
|
[self log: @"Setting custom data \"%@\" for \"%@\" with ad unit identifier \"%@\"", customData, adFormat, adUnitIdentifier];
|
|
1336
1339
|
|
|
1337
|
-
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: @"" withOffset: CGPointZero];
|
|
1340
|
+
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: @"" withOffset: CGPointZero isAdaptive: YES];
|
|
1338
1341
|
adView.customData = customData;
|
|
1339
1342
|
});
|
|
1340
1343
|
}
|
|
@@ -1393,6 +1396,8 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(double)adViewId
|
|
|
1393
1396
|
}
|
|
1394
1397
|
else if ( [@"adaptive_banner" isEqualToString: key] )
|
|
1395
1398
|
{
|
|
1399
|
+
[self log: @"Setting adaptive banners via extra parameters is deprecated and will be removed in a future plugin version. Please use the BannerAd.createAd(adUnitId: string, position: AdViewPosition, xOffset: number, yOffset: number, isAdaptive: boolean) API to properly configure adaptive banners."];
|
|
1400
|
+
|
|
1396
1401
|
BOOL shouldUseAdaptiveBanner = [NSNumber al_numberWithString: value].boolValue;
|
|
1397
1402
|
if ( shouldUseAdaptiveBanner )
|
|
1398
1403
|
{
|
|
@@ -1545,15 +1550,32 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(double)adViewId
|
|
|
1545
1550
|
|
|
1546
1551
|
- (MAAdView *)retrieveAdViewForAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat
|
|
1547
1552
|
{
|
|
1548
|
-
return [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: nil withOffset: CGPointZero];
|
|
1553
|
+
return [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: nil withOffset: CGPointZero isAdaptive: YES];
|
|
1549
1554
|
}
|
|
1550
1555
|
|
|
1551
|
-
- (MAAdView *)retrieveAdViewForAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat atPosition:(NSString *)adViewPosition withOffset:(CGPoint)offset
|
|
1556
|
+
- (MAAdView *)retrieveAdViewForAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat atPosition:(NSString *)adViewPosition withOffset:(CGPoint)offset isAdaptive:(BOOL)isAdaptive
|
|
1552
1557
|
{
|
|
1553
1558
|
MAAdView *result = self.adViews[adUnitIdentifier];
|
|
1554
1559
|
if ( !result && adViewPosition )
|
|
1555
1560
|
{
|
|
1556
|
-
|
|
1561
|
+
MAAdViewConfiguration *config = [MAAdViewConfiguration configurationWithBuilderBlock:^(MAAdViewConfigurationBuilder *builder) {
|
|
1562
|
+
|
|
1563
|
+
// Set adaptive type only for banner ads. If adaptive is enabled, use ANCHORED; otherwise, fall back to NONE.
|
|
1564
|
+
if ( [adFormat isBannerOrLeaderAd] )
|
|
1565
|
+
{
|
|
1566
|
+
if ( isAdaptive )
|
|
1567
|
+
{
|
|
1568
|
+
builder.adaptiveType = MAAdViewAdaptiveTypeAnchored;
|
|
1569
|
+
}
|
|
1570
|
+
else
|
|
1571
|
+
{
|
|
1572
|
+
builder.adaptiveType = MAAdViewAdaptiveTypeNone;
|
|
1573
|
+
[self.disabledAdaptiveBannerAdUnitIdentifiers addObject: adUnitIdentifier];
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
}];
|
|
1577
|
+
|
|
1578
|
+
result = [[MAAdView alloc] initWithAdUnitIdentifier: adUnitIdentifier adFormat: adFormat configuration: config];
|
|
1557
1579
|
result.delegate = self;
|
|
1558
1580
|
result.revenueDelegate = self;
|
|
1559
1581
|
result.userInteractionEnabled = NO;
|
package/ios/AppLovinMAXAdView.h
CHANGED
|
@@ -32,6 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
32
32
|
|
|
33
33
|
+ (void)preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
34
34
|
adFormat:(MAAdFormat *)adFormat
|
|
35
|
+
isAdaptive:(BOOL)isAdaptive
|
|
35
36
|
placement:(nullable NSString *)placement
|
|
36
37
|
customData:(nullable NSString *)customData
|
|
37
38
|
extraParameters:(nullable NSDictionary<NSString *, id> *)extraParameters
|
package/ios/AppLovinMAXAdView.mm
CHANGED
|
@@ -87,6 +87,7 @@ static NSMutableDictionary<NSNumber *, AppLovinMAXAdViewUIComponent *> *preloade
|
|
|
87
87
|
|
|
88
88
|
+ (void)preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
89
89
|
adFormat:(MAAdFormat *)adFormat
|
|
90
|
+
isAdaptive:(BOOL)isAdaptive
|
|
90
91
|
placement:(nullable NSString *)placement
|
|
91
92
|
customData:(nullable NSString *)customData
|
|
92
93
|
extraParameters:(nullable NSDictionary<NSString *, id> *)extraParameters
|
|
@@ -94,7 +95,7 @@ static NSMutableDictionary<NSNumber *, AppLovinMAXAdViewUIComponent *> *preloade
|
|
|
94
95
|
withPromiseResolver:(RCTPromiseResolveBlock)resolve
|
|
95
96
|
withPromiseRejecter:(RCTPromiseRejectBlock)reject
|
|
96
97
|
{
|
|
97
|
-
AppLovinMAXAdViewUIComponent *preloadedUIComponent = [[AppLovinMAXAdViewUIComponent alloc] initWithAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
|
98
|
+
AppLovinMAXAdViewUIComponent *preloadedUIComponent = [[AppLovinMAXAdViewUIComponent alloc] initWithAdUnitIdentifier: adUnitIdentifier adFormat: adFormat isAdaptive: isAdaptive];
|
|
98
99
|
preloadedUIComponentInstances[@(preloadedUIComponent.hash)] = preloadedUIComponent;
|
|
99
100
|
|
|
100
101
|
preloadedUIComponent.placement = placement;
|
|
@@ -548,11 +549,6 @@ static NSMutableDictionary<NSNumber *, AppLovinMAXAdViewUIComponent *> *preloade
|
|
|
548
549
|
- (void)setAdaptiveBannerEnabled:(BOOL)adaptiveBannerEnabled
|
|
549
550
|
{
|
|
550
551
|
_adaptiveBannerEnabled = adaptiveBannerEnabled;
|
|
551
|
-
|
|
552
|
-
if ( self.uiComponent )
|
|
553
|
-
{
|
|
554
|
-
self.uiComponent.adaptiveBannerEnabled = adaptiveBannerEnabled;
|
|
555
|
-
}
|
|
556
552
|
}
|
|
557
553
|
|
|
558
554
|
- (void)setAutoRefresh:(BOOL)autoRefresh
|
|
@@ -640,14 +636,13 @@ static NSMutableDictionary<NSNumber *, AppLovinMAXAdViewUIComponent *> *preloade
|
|
|
640
636
|
{
|
|
641
637
|
[[AppLovinMAX shared] log: @"Mounting the preloaded AdView (%@) for Ad Unit ID %@", self.adViewId, self.adUnitId];
|
|
642
638
|
|
|
643
|
-
self.uiComponent.adaptiveBannerEnabled = [self isAdaptiveBannerEnabled];
|
|
644
639
|
self.uiComponent.autoRefreshEnabled = [self isAutoRefreshEnabled];
|
|
645
640
|
[self.uiComponent attachAdView: self];
|
|
646
641
|
return;
|
|
647
642
|
}
|
|
648
643
|
}
|
|
649
644
|
|
|
650
|
-
self.uiComponent = [[AppLovinMAXAdViewUIComponent alloc] initWithAdUnitIdentifier: adUnitId adFormat: adFormat];
|
|
645
|
+
self.uiComponent = [[AppLovinMAXAdViewUIComponent alloc] initWithAdUnitIdentifier: adUnitId adFormat: adFormat isAdaptive: [self isAdaptiveBannerEnabled]];
|
|
651
646
|
self.adViewId = @(self.uiComponent.hash);
|
|
652
647
|
uiComponentInstances[self.adViewId] = self.uiComponent;
|
|
653
648
|
|
|
@@ -677,7 +672,6 @@ static NSMutableDictionary<NSNumber *, AppLovinMAXAdViewUIComponent *> *preloade
|
|
|
677
672
|
self.uiComponent.customData = self.customData;
|
|
678
673
|
self.uiComponent.extraParameters = flattenedExtraParameters;
|
|
679
674
|
self.uiComponent.localExtraParameters = flattenedLocalExtraParameters;
|
|
680
|
-
self.uiComponent.adaptiveBannerEnabled = [self isAdaptiveBannerEnabled];
|
|
681
675
|
self.uiComponent.autoRefreshEnabled = [self isAutoRefreshEnabled];
|
|
682
676
|
|
|
683
677
|
[self.uiComponent attachAdView: self];
|
|
@@ -14,7 +14,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
14
14
|
@property (nonatomic, copy, nullable) NSString *customData;
|
|
15
15
|
@property (nonatomic, copy, nullable) NSDictionary<NSString *, id> *extraParameters;
|
|
16
16
|
@property (nonatomic, copy, nullable) NSDictionary<NSString *, id> *localExtraParameters;
|
|
17
|
-
@property (nonatomic, assign, getter=isAdaptiveBannerEnabled) BOOL adaptiveBannerEnabled;
|
|
18
17
|
@property (nonatomic, assign, getter=isAutoRefreshEnabled) BOOL autoRefreshEnabled;
|
|
19
18
|
|
|
20
19
|
- (void)loadAd;
|
|
@@ -22,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
22
21
|
- (void)detachAdView;
|
|
23
22
|
- (void)destroy;
|
|
24
23
|
|
|
25
|
-
- (instancetype)initWithAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat;
|
|
24
|
+
- (instancetype)initWithAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat isAdaptive:(BOOL)isAdaptive;
|
|
26
25
|
|
|
27
26
|
@end
|
|
28
27
|
|
|
@@ -13,17 +13,30 @@
|
|
|
13
13
|
|
|
14
14
|
@implementation AppLovinMAXAdViewUIComponent
|
|
15
15
|
|
|
16
|
-
- (instancetype)initWithAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat
|
|
16
|
+
- (instancetype)initWithAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat isAdaptive:(BOOL)isAdaptive
|
|
17
17
|
{
|
|
18
18
|
self = [super init];
|
|
19
19
|
if ( self )
|
|
20
20
|
{
|
|
21
|
-
|
|
21
|
+
MAAdViewConfiguration *config = [MAAdViewConfiguration configurationWithBuilderBlock:^(MAAdViewConfigurationBuilder *builder) {
|
|
22
|
+
|
|
23
|
+
if ( [adFormat isBannerOrLeaderAd] )
|
|
24
|
+
{
|
|
25
|
+
if ( isAdaptive )
|
|
26
|
+
{
|
|
27
|
+
builder.adaptiveType = MAAdViewAdaptiveTypeAnchored;
|
|
28
|
+
}
|
|
29
|
+
else
|
|
30
|
+
{
|
|
31
|
+
builder.adaptiveType = MAAdViewAdaptiveTypeNone;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}];
|
|
35
|
+
|
|
36
|
+
self.adView = [[MAAdView alloc] initWithAdUnitIdentifier: adUnitIdentifier adFormat: adFormat configuration: config];
|
|
22
37
|
self.adView.delegate = self;
|
|
23
38
|
self.adView.revenueDelegate = self;
|
|
24
|
-
|
|
25
|
-
[self.adView setExtraParameterForKey: @"adaptive_banner" value: @"true"];
|
|
26
|
-
|
|
39
|
+
|
|
27
40
|
// Set this extra parameter to work around a SDK bug that ignores calls to stopAutoRefresh()
|
|
28
41
|
[self.adView setExtraParameterForKey: @"allow_pause_auto_refresh_immediately" value: @"true"];
|
|
29
42
|
|
|
@@ -50,11 +63,6 @@
|
|
|
50
63
|
self.adView.customData = customData;
|
|
51
64
|
}
|
|
52
65
|
|
|
53
|
-
- (void)setAdaptiveBannerEnabled:(BOOL)adaptiveBannerEnabled
|
|
54
|
-
{
|
|
55
|
-
[self.adView setExtraParameterForKey: @"adaptive_banner" value: adaptiveBannerEnabled ? @"true" : @"false"];
|
|
56
|
-
}
|
|
57
|
-
|
|
58
66
|
- (void)setAutoRefreshEnabled:(BOOL)autoRefresh
|
|
59
67
|
{
|
|
60
68
|
if ( autoRefresh )
|