react-native-applovin-max 9.1.0 → 9.2.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 +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 +36 -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 +36 -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.1
|
|
56
|
+
buildConfigField("int", "VERSION_CODE", "9020100")
|
|
57
|
+
buildConfigField("String", "VERSION_NAME", "\"9.2.1\"")
|
|
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.1"
|
|
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.1
|
|
82
|
+
private static final String PLUGIN_VERSION = "9.2.1";
|
|
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,8 @@ public class AppLovinMAXModuleImpl
|
|
|
100
101
|
|
|
101
102
|
static
|
|
102
103
|
{
|
|
104
|
+
ALCompatibleNativeSdkVersions.put( "9.2.1", "13.3.1" );
|
|
105
|
+
ALCompatibleNativeSdkVersions.put( "9.2.0", "13.3.0" );
|
|
103
106
|
ALCompatibleNativeSdkVersions.put( "9.1.0", "13.2.0" );
|
|
104
107
|
ALCompatibleNativeSdkVersions.put( "9.0.0", "13.0.1" );
|
|
105
108
|
ALCompatibleNativeSdkVersions.put( "8.2.0", "13.0.1" );
|
|
@@ -525,7 +528,7 @@ public class AppLovinMAXModuleImpl
|
|
|
525
528
|
|
|
526
529
|
// BANNERS
|
|
527
530
|
|
|
528
|
-
public void createBanner(final String adUnitId, final String bannerPosition)
|
|
531
|
+
public void createBanner(final String adUnitId, final String bannerPosition, final boolean isAdaptive)
|
|
529
532
|
{
|
|
530
533
|
if ( sdk == null )
|
|
531
534
|
{
|
|
@@ -533,11 +536,11 @@ public class AppLovinMAXModuleImpl
|
|
|
533
536
|
return;
|
|
534
537
|
}
|
|
535
538
|
|
|
536
|
-
createAdView( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), bannerPosition, DEFAULT_AD_VIEW_OFFSET );
|
|
539
|
+
createAdView( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), bannerPosition, DEFAULT_AD_VIEW_OFFSET, isAdaptive );
|
|
537
540
|
}
|
|
538
541
|
|
|
539
542
|
// 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)
|
|
543
|
+
public void createBannerWithOffsets(final String adUnitId, final String bannerPosition, final float x, final float y, final boolean isAdaptive)
|
|
541
544
|
{
|
|
542
545
|
if ( sdk == null )
|
|
543
546
|
{
|
|
@@ -545,7 +548,7 @@ public class AppLovinMAXModuleImpl
|
|
|
545
548
|
return;
|
|
546
549
|
}
|
|
547
550
|
|
|
548
|
-
createAdView( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), bannerPosition, getOffsetPixels( x, y, reactContext ) );
|
|
551
|
+
createAdView( adUnitId, getDeviceSpecificBannerAdViewAdFormat(), bannerPosition, getOffsetPixels( x, y, reactContext ), isAdaptive );
|
|
549
552
|
}
|
|
550
553
|
|
|
551
554
|
public void setBannerBackgroundColor(final String adUnitId, final String hexColorCode)
|
|
@@ -701,7 +704,7 @@ public class AppLovinMAXModuleImpl
|
|
|
701
704
|
return;
|
|
702
705
|
}
|
|
703
706
|
|
|
704
|
-
createAdView( adUnitId, MaxAdFormat.MREC, mrecPosition, DEFAULT_AD_VIEW_OFFSET );
|
|
707
|
+
createAdView( adUnitId, MaxAdFormat.MREC, mrecPosition, DEFAULT_AD_VIEW_OFFSET, false );
|
|
705
708
|
}
|
|
706
709
|
|
|
707
710
|
public void setMRecPlacement(final String adUnitId, @Nullable final String placement)
|
|
@@ -1035,7 +1038,7 @@ public class AppLovinMAXModuleImpl
|
|
|
1035
1038
|
|
|
1036
1039
|
// ADVIEW PRELOADING
|
|
1037
1040
|
|
|
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)
|
|
1041
|
+
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
1042
|
{
|
|
1040
1043
|
MaxAdFormat adFormat;
|
|
1041
1044
|
|
|
@@ -1059,6 +1062,7 @@ public class AppLovinMAXModuleImpl
|
|
|
1059
1062
|
|
|
1060
1063
|
reactContext.runOnUiQueueThread( () -> AppLovinMAXAdView.preloadNativeUIComponentAdView( adUnitId,
|
|
1061
1064
|
finalAdFormat,
|
|
1065
|
+
isAdaptive,
|
|
1062
1066
|
placement,
|
|
1063
1067
|
customData,
|
|
1064
1068
|
extraParameters,
|
|
@@ -1347,7 +1351,7 @@ public class AppLovinMAXModuleImpl
|
|
|
1347
1351
|
|
|
1348
1352
|
// INTERNAL METHODS
|
|
1349
1353
|
|
|
1350
|
-
private void createAdView(final String adUnitId, final MaxAdFormat adFormat, final String adViewPosition, final Point adViewOffsetPixels)
|
|
1354
|
+
private void createAdView(final String adUnitId, final MaxAdFormat adFormat, final String adViewPosition, final Point adViewOffsetPixels, final boolean isAdaptive)
|
|
1351
1355
|
{
|
|
1352
1356
|
// Run on main thread to ensure there are no concurrency issues with other ad view methods
|
|
1353
1357
|
reactContext.runOnUiQueueThread( () -> {
|
|
@@ -1355,7 +1359,7 @@ public class AppLovinMAXModuleImpl
|
|
|
1355
1359
|
d( "Creating " + adFormat.getLabel() + " with ad unit id \"" + adUnitId + "\", position: \"" + adViewPosition + "\", and offset: " + adViewOffsetPixels );
|
|
1356
1360
|
|
|
1357
1361
|
// Retrieve ad view from the map
|
|
1358
|
-
final MaxAdView adView = retrieveAdView( adUnitId, adFormat, adViewPosition, adViewOffsetPixels );
|
|
1362
|
+
final MaxAdView adView = retrieveAdView( adUnitId, adFormat, adViewPosition, adViewOffsetPixels, isAdaptive );
|
|
1359
1363
|
if ( adView == null )
|
|
1360
1364
|
{
|
|
1361
1365
|
e( adFormat.getLabel() + " does not exist" );
|
|
@@ -1390,7 +1394,7 @@ public class AppLovinMAXModuleImpl
|
|
|
1390
1394
|
|
|
1391
1395
|
d( "Setting placement \"" + placement + "\" for " + adFormat.getLabel() + " with ad unit id \"" + adUnitId + "\"" );
|
|
1392
1396
|
|
|
1393
|
-
final MaxAdView adView = retrieveAdView( adUnitId, adFormat, "", DEFAULT_AD_VIEW_OFFSET );
|
|
1397
|
+
final MaxAdView adView = retrieveAdView( adUnitId, adFormat, "", DEFAULT_AD_VIEW_OFFSET, true );
|
|
1394
1398
|
if ( adView == null )
|
|
1395
1399
|
{
|
|
1396
1400
|
e( adFormat.getLabel() + " does not exist" );
|
|
@@ -1407,7 +1411,7 @@ public class AppLovinMAXModuleImpl
|
|
|
1407
1411
|
|
|
1408
1412
|
d( "Setting custom data \"" + customData + "\" for " + adFormat.getLabel() + " with ad unit id \"" + adUnitId + "\"" );
|
|
1409
1413
|
|
|
1410
|
-
final MaxAdView adView = retrieveAdView( adUnitId, adFormat, "", DEFAULT_AD_VIEW_OFFSET );
|
|
1414
|
+
final MaxAdView adView = retrieveAdView( adUnitId, adFormat, "", DEFAULT_AD_VIEW_OFFSET, true );
|
|
1411
1415
|
if ( adView == null )
|
|
1412
1416
|
{
|
|
1413
1417
|
e( adFormat.getLabel() + " does not exist" );
|
|
@@ -1581,6 +1585,8 @@ public class AppLovinMAXModuleImpl
|
|
|
1581
1585
|
}
|
|
1582
1586
|
else if ( "adaptive_banner".equalsIgnoreCase( key ) )
|
|
1583
1587
|
{
|
|
1588
|
+
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." );
|
|
1589
|
+
|
|
1584
1590
|
boolean useAdaptiveBannerAdSize = Boolean.parseBoolean( value );
|
|
1585
1591
|
if ( useAdaptiveBannerAdSize )
|
|
1586
1592
|
{
|
|
@@ -1727,15 +1733,31 @@ public class AppLovinMAXModuleImpl
|
|
|
1727
1733
|
|
|
1728
1734
|
private MaxAdView retrieveAdView(String adUnitId, MaxAdFormat adFormat)
|
|
1729
1735
|
{
|
|
1730
|
-
return retrieveAdView( adUnitId, adFormat, null, DEFAULT_AD_VIEW_OFFSET );
|
|
1736
|
+
return retrieveAdView( adUnitId, adFormat, null, DEFAULT_AD_VIEW_OFFSET, true );
|
|
1731
1737
|
}
|
|
1732
1738
|
|
|
1733
|
-
private MaxAdView retrieveAdView(String adUnitId, MaxAdFormat adFormat, String adViewPosition, Point adViewOffsetPixels)
|
|
1739
|
+
private MaxAdView retrieveAdView(String adUnitId, MaxAdFormat adFormat, String adViewPosition, Point adViewOffsetPixels, final boolean isAdaptive)
|
|
1734
1740
|
{
|
|
1735
1741
|
MaxAdView result = adViews.get( adUnitId );
|
|
1736
1742
|
if ( result == null && adViewPosition != null && adViewOffsetPixels != null )
|
|
1737
1743
|
{
|
|
1738
|
-
|
|
1744
|
+
MaxAdViewConfiguration.Builder builder = MaxAdViewConfiguration.builder();
|
|
1745
|
+
|
|
1746
|
+
// Set adaptive type only for banner ads. If adaptive is enabled, use ANCHORED; otherwise, fall back to NONE.
|
|
1747
|
+
if ( adFormat.isBannerOrLeaderAd() )
|
|
1748
|
+
{
|
|
1749
|
+
if ( isAdaptive )
|
|
1750
|
+
{
|
|
1751
|
+
builder.setAdaptiveType( MaxAdViewConfiguration.AdaptiveType.ANCHORED );
|
|
1752
|
+
}
|
|
1753
|
+
else
|
|
1754
|
+
{
|
|
1755
|
+
builder.setAdaptiveType( MaxAdViewConfiguration.AdaptiveType.NONE );
|
|
1756
|
+
disabledAdaptiveBannerAdUnitIds.add( adUnitId );
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
result = new MaxAdView( adUnitId, adFormat, builder.build() );
|
|
1739
1761
|
result.setListener( this );
|
|
1740
1762
|
result.setRevenueListener( this );
|
|
1741
1763
|
|
|
@@ -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.1
|
|
76
|
+
static NSString *const PLUGIN_VERSION = @"9.2.1";
|
|
77
77
|
|
|
78
78
|
static NSString *const USER_GEOGRAPHY_GDPR = @"G";
|
|
79
79
|
static NSString *const USER_GEOGRAPHY_OTHER = @"O";
|
|
@@ -149,6 +149,8 @@ RCT_EXPORT_MODULE()
|
|
|
149
149
|
[super initialize];
|
|
150
150
|
|
|
151
151
|
ALCompatibleNativeSDKVersions = @{
|
|
152
|
+
@"9.2.1" : @"13.3.1",
|
|
153
|
+
@"9.2.0" : @"13.3.0",
|
|
152
154
|
@"9.1.0" : @"13.2.0",
|
|
153
155
|
@"9.0.0" : @"13.0.1",
|
|
154
156
|
@"8.2.0" : @"13.0.1",
|
|
@@ -485,7 +487,7 @@ RCT_EXPORT_METHOD(trackEvent:(NSString *)event :(NSDictionary<NSString *, id> *)
|
|
|
485
487
|
|
|
486
488
|
#pragma mark - Banners
|
|
487
489
|
|
|
488
|
-
RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition)
|
|
490
|
+
RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition isAdaptive:(BOOL)isAdaptive)
|
|
489
491
|
{
|
|
490
492
|
if ( !self.sdk )
|
|
491
493
|
{
|
|
@@ -493,11 +495,11 @@ RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier position:(NSString *
|
|
|
493
495
|
return;
|
|
494
496
|
}
|
|
495
497
|
|
|
496
|
-
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT atPosition: bannerPosition withOffset: CGPointZero];
|
|
498
|
+
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT atPosition: bannerPosition withOffset: CGPointZero isAdaptive: isAdaptive];
|
|
497
499
|
}
|
|
498
500
|
|
|
499
501
|
// 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)
|
|
502
|
+
RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition xOffset:(double)xOffset yOffset:(double)yOffset isAdaptive:(BOOL)isAdaptive)
|
|
501
503
|
{
|
|
502
504
|
if ( !self.sdk )
|
|
503
505
|
{
|
|
@@ -505,7 +507,7 @@ RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier position:
|
|
|
505
507
|
return;
|
|
506
508
|
}
|
|
507
509
|
|
|
508
|
-
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT atPosition: bannerPosition withOffset: CGPointMake(xOffset, yOffset)];
|
|
510
|
+
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT atPosition: bannerPosition withOffset: CGPointMake(xOffset, yOffset) isAdaptive: isAdaptive];
|
|
509
511
|
}
|
|
510
512
|
|
|
511
513
|
RCT_EXPORT_METHOD(setBannerBackgroundColor:(NSString *)adUnitIdentifier hexColorCode:(NSString *)hexColorCode)
|
|
@@ -664,7 +666,7 @@ RCT_EXPORT_METHOD(createMRec:(NSString *)adUnitIdentifier position:(NSString *)m
|
|
|
664
666
|
return;
|
|
665
667
|
}
|
|
666
668
|
|
|
667
|
-
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec atPosition: mrecPosition withOffset: CGPointZero];
|
|
669
|
+
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec atPosition: mrecPosition withOffset: CGPointZero isAdaptive: NO];
|
|
668
670
|
}
|
|
669
671
|
|
|
670
672
|
RCT_EXPORT_METHOD(setMRecPlacement:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement)
|
|
@@ -956,6 +958,7 @@ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier p
|
|
|
956
958
|
|
|
957
959
|
RCT_EXPORT_METHOD(preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
958
960
|
adFormat:(NSString *)adFormatStr
|
|
961
|
+
isAdaptive:(BOOL)isAdaptive
|
|
959
962
|
placement:(nullable NSString *)placement
|
|
960
963
|
customData:(nullable NSString *)customData
|
|
961
964
|
extraParameters:(nullable NSDictionary<NSString *, id> *)extraParameterDict
|
|
@@ -981,6 +984,7 @@ RCT_EXPORT_METHOD(preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
|
981
984
|
|
|
982
985
|
[AppLovinMAXAdView preloadNativeUIComponentAdView: adUnitIdentifier
|
|
983
986
|
adFormat: adFormat
|
|
987
|
+
isAdaptive: isAdaptive
|
|
984
988
|
placement: placement
|
|
985
989
|
customData: customData
|
|
986
990
|
extraParameters: extraParameterDict
|
|
@@ -1268,14 +1272,14 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(double)adViewId
|
|
|
1268
1272
|
|
|
1269
1273
|
#pragma mark - Internal Methods
|
|
1270
1274
|
|
|
1271
|
-
- (void)createAdViewWithAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat atPosition:(NSString *)adViewPosition withOffset:(CGPoint)offset
|
|
1275
|
+
- (void)createAdViewWithAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat atPosition:(NSString *)adViewPosition withOffset:(CGPoint)offset isAdaptive:(BOOL)isAdaptive
|
|
1272
1276
|
{
|
|
1273
1277
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
1274
1278
|
|
|
1275
1279
|
[self log: @"Creating %@ with ad unit identifier \"%@\", position: \"%@\", and offset: %@", adFormat, adUnitIdentifier, adViewPosition, NSStringFromCGPoint(offset)];
|
|
1276
1280
|
|
|
1277
1281
|
// Retrieve ad view from the map
|
|
1278
|
-
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: adViewPosition withOffset: offset];
|
|
1282
|
+
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: adViewPosition withOffset: offset isAdaptive: isAdaptive];
|
|
1279
1283
|
adView.hidden = YES;
|
|
1280
1284
|
self.safeAreaBackground.hidden = YES;
|
|
1281
1285
|
|
|
@@ -1323,7 +1327,7 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(double)adViewId
|
|
|
1323
1327
|
|
|
1324
1328
|
[self log: @"Setting placement \"%@\" for \"%@\" with ad unit identifier \"%@\"", placement, adFormat, adUnitIdentifier];
|
|
1325
1329
|
|
|
1326
|
-
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: @"" withOffset: CGPointZero];
|
|
1330
|
+
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: @"" withOffset: CGPointZero isAdaptive: YES];
|
|
1327
1331
|
adView.placement = placement;
|
|
1328
1332
|
});
|
|
1329
1333
|
}
|
|
@@ -1334,7 +1338,7 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(double)adViewId
|
|
|
1334
1338
|
|
|
1335
1339
|
[self log: @"Setting custom data \"%@\" for \"%@\" with ad unit identifier \"%@\"", customData, adFormat, adUnitIdentifier];
|
|
1336
1340
|
|
|
1337
|
-
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: @"" withOffset: CGPointZero];
|
|
1341
|
+
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: @"" withOffset: CGPointZero isAdaptive: YES];
|
|
1338
1342
|
adView.customData = customData;
|
|
1339
1343
|
});
|
|
1340
1344
|
}
|
|
@@ -1393,6 +1397,8 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(double)adViewId
|
|
|
1393
1397
|
}
|
|
1394
1398
|
else if ( [@"adaptive_banner" isEqualToString: key] )
|
|
1395
1399
|
{
|
|
1400
|
+
[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."];
|
|
1401
|
+
|
|
1396
1402
|
BOOL shouldUseAdaptiveBanner = [NSNumber al_numberWithString: value].boolValue;
|
|
1397
1403
|
if ( shouldUseAdaptiveBanner )
|
|
1398
1404
|
{
|
|
@@ -1545,15 +1551,32 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(double)adViewId
|
|
|
1545
1551
|
|
|
1546
1552
|
- (MAAdView *)retrieveAdViewForAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat
|
|
1547
1553
|
{
|
|
1548
|
-
return [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: nil withOffset: CGPointZero];
|
|
1554
|
+
return [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: nil withOffset: CGPointZero isAdaptive: YES];
|
|
1549
1555
|
}
|
|
1550
1556
|
|
|
1551
|
-
- (MAAdView *)retrieveAdViewForAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat atPosition:(NSString *)adViewPosition withOffset:(CGPoint)offset
|
|
1557
|
+
- (MAAdView *)retrieveAdViewForAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat atPosition:(NSString *)adViewPosition withOffset:(CGPoint)offset isAdaptive:(BOOL)isAdaptive
|
|
1552
1558
|
{
|
|
1553
1559
|
MAAdView *result = self.adViews[adUnitIdentifier];
|
|
1554
1560
|
if ( !result && adViewPosition )
|
|
1555
1561
|
{
|
|
1556
|
-
|
|
1562
|
+
MAAdViewConfiguration *config = [MAAdViewConfiguration configurationWithBuilderBlock:^(MAAdViewConfigurationBuilder *builder) {
|
|
1563
|
+
|
|
1564
|
+
// Set adaptive type only for banner ads. If adaptive is enabled, use ANCHORED; otherwise, fall back to NONE.
|
|
1565
|
+
if ( [adFormat isBannerOrLeaderAd] )
|
|
1566
|
+
{
|
|
1567
|
+
if ( isAdaptive )
|
|
1568
|
+
{
|
|
1569
|
+
builder.adaptiveType = MAAdViewAdaptiveTypeAnchored;
|
|
1570
|
+
}
|
|
1571
|
+
else
|
|
1572
|
+
{
|
|
1573
|
+
builder.adaptiveType = MAAdViewAdaptiveTypeNone;
|
|
1574
|
+
[self.disabledAdaptiveBannerAdUnitIdentifiers addObject: adUnitIdentifier];
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
}];
|
|
1578
|
+
|
|
1579
|
+
result = [[MAAdView alloc] initWithAdUnitIdentifier: adUnitIdentifier adFormat: adFormat configuration: config];
|
|
1557
1580
|
result.delegate = self;
|
|
1558
1581
|
result.revenueDelegate = self;
|
|
1559
1582
|
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 )
|