react-native-applovin-max 8.2.0 → 9.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.
- package/android/build.gradle +13 -2
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdView.java +33 -26
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewManagerImpl.java +110 -0
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewUiComponent.java +15 -13
- package/android/src/main/java/com/applovin/reactnative/{AppLovinMAXModule.java → AppLovinMAXModuleImpl.java} +107 -168
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXNativeAdView.java +84 -56
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXNativeAdViewManagerImpl.java +101 -0
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXPackage.java +44 -11
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXUtils.java +56 -0
- package/android/src/newarch/com/applovin/reactnative/AppLovinMAXAdViewManager.java +151 -0
- package/android/src/newarch/com/applovin/reactnative/AppLovinMAXModule.java +453 -0
- package/android/src/newarch/com/applovin/reactnative/AppLovinMAXNativeAdViewManager.java +130 -0
- package/android/src/oldarch/com/applovin/reactnative/AppLovinMAXAdViewManager.java +128 -0
- package/android/src/oldarch/com/applovin/reactnative/AppLovinMAXModule.java +453 -0
- package/android/src/oldarch/com/applovin/reactnative/AppLovinMAXNativeAdViewManager.java +93 -0
- package/ios/AppLovinMAX.h +8 -3
- package/ios/{AppLovinMAX.m → AppLovinMAX.mm} +66 -53
- package/ios/AppLovinMAXAdView.h +7 -2
- package/ios/AppLovinMAXAdView.mm +747 -0
- package/ios/{AppLovinMAXAdViewManager.m → AppLovinMAXAdViewManager.mm} +3 -2
- package/ios/{AppLovinMAXAdViewUIComponent.m → AppLovinMAXAdViewUIComponent.mm} +2 -1
- package/ios/AppLovinMAXNativeAdView.h +15 -4
- package/ios/AppLovinMAXNativeAdView.mm +745 -0
- package/ios/AppLovinMAXNativeAdViewManager.mm +116 -0
- package/lib/commonjs/AdView.js +61 -85
- package/lib/commonjs/AdView.js.map +1 -1
- package/lib/commonjs/AppLovinMAX.js +11 -10
- package/lib/commonjs/AppLovinMAX.js.map +1 -1
- package/lib/commonjs/AppOpenAd.js +8 -10
- package/lib/commonjs/AppOpenAd.js.map +1 -1
- package/lib/commonjs/BannerAd.js +19 -21
- package/lib/commonjs/BannerAd.js.map +1 -1
- package/lib/commonjs/ErrorCode.js +3 -5
- package/lib/commonjs/ErrorCode.js.map +1 -1
- package/lib/commonjs/EventEmitter.js +3 -5
- package/lib/commonjs/EventEmitter.js.map +1 -1
- package/lib/commonjs/InterstitialAd.js +8 -10
- package/lib/commonjs/InterstitialAd.js.map +1 -1
- package/lib/commonjs/MRecAd.js +14 -16
- package/lib/commonjs/MRecAd.js.map +1 -1
- package/lib/commonjs/Privacy.js +3 -5
- package/lib/commonjs/Privacy.js.map +1 -1
- package/lib/commonjs/RewardedAd.js +8 -10
- package/lib/commonjs/RewardedAd.js.map +1 -1
- package/lib/commonjs/Utils.js +25 -0
- package/lib/commonjs/Utils.js.map +1 -0
- package/lib/commonjs/nativeAd/NativeAdView.js +65 -42
- package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js +51 -47
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js +38 -8
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js.map +1 -1
- package/lib/commonjs/nativeAd/img/blank_icon.png +0 -0
- package/lib/commonjs/specs/AppLovinMAXAdViewNativeComponent.js +14 -0
- package/lib/commonjs/specs/AppLovinMAXAdViewNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/AppLovinMAXNativeAdViewNativeComponent.js +14 -0
- package/lib/commonjs/specs/AppLovinMAXNativeAdViewNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/NativeAppLovinMAXModule.js +9 -0
- package/lib/commonjs/specs/NativeAppLovinMAXModule.js.map +1 -0
- package/lib/module/AdView.js +56 -81
- package/lib/module/AdView.js.map +1 -1
- package/lib/module/AppLovinMAX.js +7 -7
- package/lib/module/AppLovinMAX.js.map +1 -1
- package/lib/module/AppOpenAd.js +1 -4
- package/lib/module/AppOpenAd.js.map +1 -1
- package/lib/module/BannerAd.js +1 -4
- package/lib/module/BannerAd.js.map +1 -1
- package/lib/module/ErrorCode.js +1 -4
- package/lib/module/ErrorCode.js.map +1 -1
- package/lib/module/EventEmitter.js +2 -4
- package/lib/module/EventEmitter.js.map +1 -1
- package/lib/module/InterstitialAd.js +2 -5
- package/lib/module/InterstitialAd.js.map +1 -1
- package/lib/module/MRecAd.js +1 -4
- package/lib/module/MRecAd.js.map +1 -1
- package/lib/module/Privacy.js +1 -4
- package/lib/module/Privacy.js.map +1 -1
- package/lib/module/RewardedAd.js +2 -5
- package/lib/module/RewardedAd.js.map +1 -1
- package/lib/module/Utils.js +17 -0
- package/lib/module/Utils.js.map +1 -0
- package/lib/module/nativeAd/NativeAdView.js +63 -40
- package/lib/module/nativeAd/NativeAdView.js.map +1 -1
- package/lib/module/nativeAd/NativeAdViewComponents.js +53 -49
- package/lib/module/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/module/nativeAd/NativeAdViewProvider.js +39 -9
- package/lib/module/nativeAd/NativeAdViewProvider.js.map +1 -1
- package/lib/module/nativeAd/img/blank_icon.png +0 -0
- package/lib/module/specs/AppLovinMAXAdViewNativeComponent.js +7 -0
- package/lib/module/specs/AppLovinMAXAdViewNativeComponent.js.map +1 -0
- package/lib/module/specs/AppLovinMAXNativeAdViewNativeComponent.js +7 -0
- package/lib/module/specs/AppLovinMAXNativeAdViewNativeComponent.js.map +1 -0
- package/lib/module/specs/NativeAppLovinMAXModule.js +3 -0
- package/lib/module/specs/NativeAppLovinMAXModule.js.map +1 -0
- package/lib/typescript/src/AdView.d.ts +11 -11
- package/lib/typescript/src/AdView.d.ts.map +1 -1
- package/lib/typescript/src/AppLovinMAX.d.ts.map +1 -1
- package/lib/typescript/src/AppOpenAd.d.ts.map +1 -1
- package/lib/typescript/src/BannerAd.d.ts.map +1 -1
- package/lib/typescript/src/ErrorCode.d.ts.map +1 -1
- package/lib/typescript/src/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/src/InterstitialAd.d.ts.map +1 -1
- package/lib/typescript/src/MRecAd.d.ts.map +1 -1
- package/lib/typescript/src/Privacy.d.ts.map +1 -1
- package/lib/typescript/src/RewardedAd.d.ts.map +1 -1
- package/lib/typescript/src/Utils.d.ts +16 -0
- package/lib/typescript/src/Utils.d.ts.map +1 -0
- package/lib/typescript/src/nativeAd/NativeAdView.d.ts.map +1 -1
- package/lib/typescript/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
- package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts +14 -5
- package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
- package/lib/typescript/src/specs/AppLovinMAXAdViewNativeComponent.d.ts +86 -0
- package/lib/typescript/src/specs/AppLovinMAXAdViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/AppLovinMAXNativeAdViewNativeComponent.d.ts +80 -0
- package/lib/typescript/src/specs/AppLovinMAXNativeAdViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeAppLovinMAXModule.d.ts +132 -0
- package/lib/typescript/src/specs/NativeAppLovinMAXModule.d.ts.map +1 -0
- package/lib/typescript/src/types/AdInfo.d.ts +1 -1
- package/lib/typescript/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/src/types/AdProps.d.ts +2 -2
- package/lib/typescript/src/types/AdProps.d.ts.map +1 -1
- package/lib/typescript/src/types/NativeAd.d.ts +4 -0
- package/lib/typescript/src/types/NativeAd.d.ts.map +1 -1
- package/package.json +9 -1
- package/react-native-applovin-max.podspec +2 -2
- package/src/AdView.tsx +56 -121
- package/src/AppLovinMAX.ts +7 -8
- package/src/AppOpenAd.ts +1 -3
- package/src/BannerAd.ts +1 -3
- package/src/ErrorCode.ts +1 -3
- package/src/EventEmitter.ts +2 -3
- package/src/InterstitialAd.ts +2 -4
- package/src/MRecAd.ts +1 -3
- package/src/Privacy.ts +1 -3
- package/src/RewardedAd.ts +2 -4
- package/src/Utils.ts +26 -0
- package/src/nativeAd/NativeAdView.tsx +65 -65
- package/src/nativeAd/NativeAdViewComponents.tsx +32 -60
- package/src/nativeAd/NativeAdViewProvider.tsx +37 -12
- package/src/nativeAd/img/blank_icon.png +0 -0
- package/src/specs/AppLovinMAXAdViewNativeComponent.ts +96 -0
- package/src/specs/AppLovinMAXNativeAdViewNativeComponent.ts +89 -0
- package/src/specs/NativeAppLovinMAXModule.ts +208 -0
- package/src/types/AdInfo.ts +1 -1
- package/src/types/AdProps.ts +2 -2
- package/src/types/NativeAd.ts +5 -0
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewManager.java +0 -149
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXNativeAdViewManager.java +0 -163
- package/ios/AppLovinMAXAdView.m +0 -325
- package/ios/AppLovinMAXNativeAdView.m +0 -432
- package/ios/AppLovinMAXNativeAdViewManager.m +0 -64
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
package com.applovin.reactnative;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
4
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
5
|
+
import com.facebook.react.uimanager.ViewGroupManager;
|
|
6
|
+
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
7
|
+
|
|
8
|
+
import java.util.Map;
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.NonNull;
|
|
11
|
+
import androidx.annotation.Nullable;
|
|
12
|
+
|
|
13
|
+
public class AppLovinMAXNativeAdViewManager
|
|
14
|
+
extends ViewGroupManager<AppLovinMAXNativeAdView>
|
|
15
|
+
{
|
|
16
|
+
@NonNull
|
|
17
|
+
@Override
|
|
18
|
+
protected AppLovinMAXNativeAdView createViewInstance(@NonNull final ThemedReactContext reactContext)
|
|
19
|
+
{
|
|
20
|
+
return AppLovinMAXNativeAdViewManagerImpl.createViewInstance( reactContext );
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@NonNull
|
|
24
|
+
@Override
|
|
25
|
+
public String getName()
|
|
26
|
+
{
|
|
27
|
+
return AppLovinMAXNativeAdViewManagerImpl.NAME;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@Nullable
|
|
31
|
+
@Override
|
|
32
|
+
public Map<String, Object> getExportedCustomDirectEventTypeConstants()
|
|
33
|
+
{
|
|
34
|
+
return AppLovinMAXNativeAdViewManagerImpl.getExportedCustomDirectEventTypeConstants();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@Override
|
|
38
|
+
public void receiveCommand(@NonNull final AppLovinMAXNativeAdView view, final String commandId, @Nullable final ReadableArray args)
|
|
39
|
+
{
|
|
40
|
+
super.receiveCommand( view, commandId, args );
|
|
41
|
+
AppLovinMAXNativeAdViewManagerImpl.receiveCommand( view, commandId, args );
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@ReactProp(name = "adUnitId")
|
|
45
|
+
public void setAdUnitId(final AppLovinMAXNativeAdView view, final String value)
|
|
46
|
+
{
|
|
47
|
+
AppLovinMAXNativeAdViewManagerImpl.setAdUnitId( view, value );
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@ReactProp(name = "placement")
|
|
51
|
+
public void setPlacement(final AppLovinMAXNativeAdView view, @Nullable final String value)
|
|
52
|
+
{
|
|
53
|
+
AppLovinMAXNativeAdViewManagerImpl.setPlacement( view, value );
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@ReactProp(name = "customData")
|
|
57
|
+
public void setCustomData(final AppLovinMAXNativeAdView view, @Nullable final String value)
|
|
58
|
+
{
|
|
59
|
+
AppLovinMAXNativeAdViewManagerImpl.setCustomData( view, value );
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@ReactProp(name = "extraParameters")
|
|
63
|
+
public void setExtraParameters(final AppLovinMAXNativeAdView view, @Nullable final ReadableArray value)
|
|
64
|
+
{
|
|
65
|
+
AppLovinMAXNativeAdViewManagerImpl.setExtraParameters( view, value );
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@ReactProp(name = "strLocalExtraParameters")
|
|
69
|
+
public void setStrLocalExtraParameters(final AppLovinMAXNativeAdView view, @Nullable final ReadableArray value)
|
|
70
|
+
{
|
|
71
|
+
AppLovinMAXNativeAdViewManagerImpl.setLocalExtraParameters( view, value );
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@ReactProp(name = "boolLocalExtraParameters")
|
|
75
|
+
public void setBoolLocalExtraParameters(final AppLovinMAXNativeAdView view, @Nullable final ReadableArray value)
|
|
76
|
+
{
|
|
77
|
+
AppLovinMAXNativeAdViewManagerImpl.setLocalExtraParameters( view, value );
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@Override
|
|
81
|
+
public void onAfterUpdateTransaction(@NonNull final AppLovinMAXNativeAdView view)
|
|
82
|
+
{
|
|
83
|
+
super.onAfterUpdateTransaction( view );
|
|
84
|
+
AppLovinMAXNativeAdViewManagerImpl.onSetProps( view );
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@Override
|
|
88
|
+
public void onDropViewInstance(@NonNull final AppLovinMAXNativeAdView view)
|
|
89
|
+
{
|
|
90
|
+
AppLovinMAXNativeAdViewManagerImpl.destroy( view );
|
|
91
|
+
super.onDropViewInstance( view );
|
|
92
|
+
}
|
|
93
|
+
}
|
package/ios/AppLovinMAX.h
CHANGED
|
@@ -7,19 +7,24 @@
|
|
|
7
7
|
//
|
|
8
8
|
|
|
9
9
|
#import <Foundation/Foundation.h>
|
|
10
|
-
#import <React/RCTBridgeModule.h>
|
|
11
10
|
#import <React/RCTEventEmitter.h>
|
|
12
11
|
#import <AppLovinSDK/AppLovinSDK.h>
|
|
13
12
|
|
|
14
13
|
#define KEY_WINDOW [UIApplication sharedApplication].keyWindow
|
|
15
14
|
#define DEVICE_SPECIFIC_ADVIEW_AD_FORMAT ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) ? MAAdFormat.leader : MAAdFormat.banner
|
|
16
15
|
|
|
17
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
18
|
-
|
|
19
16
|
/**
|
|
20
17
|
* The primary bridge between JS <-> native code for the AppLovin MAX React Native module.
|
|
21
18
|
*/
|
|
19
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
20
|
+
#import <RNAppLovinMAXSpec/RNAppLovinMAXSpec.h>
|
|
21
|
+
@interface AppLovinMAX : RCTEventEmitter<NativeAppLovinMAXModuleSpec, MAAdDelegate, MARewardedAdDelegate, MAAdViewAdDelegate, MAAdRevenueDelegate>
|
|
22
|
+
#else
|
|
23
|
+
#import <React/RCTBridgeModule.h>
|
|
22
24
|
@interface AppLovinMAX : RCTEventEmitter<RCTBridgeModule, MAAdDelegate, MARewardedAdDelegate, MAAdViewAdDelegate, MAAdRevenueDelegate>
|
|
25
|
+
#endif
|
|
26
|
+
|
|
27
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
23
28
|
|
|
24
29
|
extern NSString *const ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT;
|
|
25
30
|
extern NSString *const ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT;
|
|
@@ -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 = @"
|
|
76
|
+
static NSString *const PLUGIN_VERSION = @"9.0.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.0.0" : @"13.0.1",
|
|
152
153
|
@"8.2.0" : @"13.0.1",
|
|
153
154
|
@"8.1.1" : @"13.0.1",
|
|
154
155
|
@"8.1.0" : @"13.0.1",
|
|
@@ -221,12 +222,12 @@ RCT_EXPORT_MODULE()
|
|
|
221
222
|
return self;
|
|
222
223
|
}
|
|
223
224
|
|
|
224
|
-
RCT_EXPORT_METHOD(isInitialized:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
225
|
+
RCT_EXPORT_METHOD(isInitialized:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
225
226
|
{
|
|
226
227
|
resolve(@([self isPluginInitialized] && [self isSDKInitialized]));
|
|
227
228
|
}
|
|
228
229
|
|
|
229
|
-
RCT_EXPORT_METHOD(initialize:(NSString *)pluginVersion :(NSString *)sdkKey :(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
230
|
+
RCT_EXPORT_METHOD(initialize:(NSString *)pluginVersion sdkKey:(NSString *)sdkKey resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
230
231
|
{
|
|
231
232
|
// Guard against running init logic multiple times
|
|
232
233
|
if ( [self isPluginInitialized] )
|
|
@@ -291,7 +292,7 @@ RCT_EXPORT_METHOD(initialize:(NSString *)pluginVersion :(NSString *)sdkKey :(RCT
|
|
|
291
292
|
|
|
292
293
|
#pragma mark - General Public API
|
|
293
294
|
|
|
294
|
-
RCT_EXPORT_METHOD(isTablet:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
295
|
+
RCT_EXPORT_METHOD(isTablet:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
295
296
|
{
|
|
296
297
|
resolve(@([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad));
|
|
297
298
|
}
|
|
@@ -312,7 +313,7 @@ RCT_EXPORT_METHOD(setHasUserConsent:(BOOL)hasUserConsent)
|
|
|
312
313
|
[ALPrivacySettings setHasUserConsent: hasUserConsent];
|
|
313
314
|
}
|
|
314
315
|
|
|
315
|
-
RCT_EXPORT_METHOD(hasUserConsent:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
316
|
+
RCT_EXPORT_METHOD(hasUserConsent:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
316
317
|
{
|
|
317
318
|
resolve(@([ALPrivacySettings hasUserConsent]));
|
|
318
319
|
}
|
|
@@ -322,7 +323,7 @@ RCT_EXPORT_METHOD(setDoNotSell:(BOOL)doNotSell)
|
|
|
322
323
|
[ALPrivacySettings setDoNotSell: doNotSell];
|
|
323
324
|
}
|
|
324
325
|
|
|
325
|
-
RCT_EXPORT_METHOD(isDoNotSell:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
326
|
+
RCT_EXPORT_METHOD(isDoNotSell:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
326
327
|
{
|
|
327
328
|
resolve(@([ALPrivacySettings isDoNotSell]));
|
|
328
329
|
}
|
|
@@ -337,7 +338,7 @@ RCT_EXPORT_METHOD(setMuted:(BOOL)muted)
|
|
|
337
338
|
self.sdk.settings.muted = muted;
|
|
338
339
|
}
|
|
339
340
|
|
|
340
|
-
RCT_EXPORT_METHOD(isMuted:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
341
|
+
RCT_EXPORT_METHOD(isMuted:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
341
342
|
{
|
|
342
343
|
resolve(@(self.sdk.settings.muted));
|
|
343
344
|
}
|
|
@@ -357,7 +358,7 @@ RCT_EXPORT_METHOD(setCreativeDebuggerEnabled:(BOOL)enabled)
|
|
|
357
358
|
self.sdk.settings.creativeDebuggerEnabled = enabled;
|
|
358
359
|
}
|
|
359
360
|
|
|
360
|
-
RCT_EXPORT_METHOD(setExtraParameter:(NSString *)key :(nullable NSString *)value)
|
|
361
|
+
RCT_EXPORT_METHOD(setExtraParameter:(NSString *)key value:(nullable NSString *)value)
|
|
361
362
|
{
|
|
362
363
|
if ( ![key al_isValidString] )
|
|
363
364
|
{
|
|
@@ -397,7 +398,7 @@ RCT_EXPORT_METHOD(setConsentFlowDebugUserGeography:(NSString *)userGeography)
|
|
|
397
398
|
self.sdk.settings.termsAndPrivacyPolicyFlowSettings.debugUserGeography = [self toAppLovinConsentFlowUserGeography: userGeography];
|
|
398
399
|
}
|
|
399
400
|
|
|
400
|
-
RCT_EXPORT_METHOD(showCmpForExistingUser:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
401
|
+
RCT_EXPORT_METHOD(showCmpForExistingUser:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
401
402
|
{
|
|
402
403
|
if ( ![self isPluginInitialized] )
|
|
403
404
|
{
|
|
@@ -420,7 +421,7 @@ RCT_EXPORT_METHOD(showCmpForExistingUser:(RCTPromiseResolveBlock)resolve :(RCTPr
|
|
|
420
421
|
}];
|
|
421
422
|
}
|
|
422
423
|
|
|
423
|
-
RCT_EXPORT_METHOD(hasSupportedCmp:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
424
|
+
RCT_EXPORT_METHOD(hasSupportedCmp:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
424
425
|
{
|
|
425
426
|
if ( ![self isPluginInitialized] )
|
|
426
427
|
{
|
|
@@ -433,7 +434,7 @@ RCT_EXPORT_METHOD(hasSupportedCmp:(RCTPromiseResolveBlock)resolve :(RCTPromiseRe
|
|
|
433
434
|
|
|
434
435
|
#pragma mark - Segment Targeting
|
|
435
436
|
|
|
436
|
-
RCT_EXPORT_METHOD(addSegment:(
|
|
437
|
+
RCT_EXPORT_METHOD(addSegment:(double)key values:(NSArray *)values resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
437
438
|
{
|
|
438
439
|
if ( [self isPluginInitialized] )
|
|
439
440
|
{
|
|
@@ -441,12 +442,12 @@ RCT_EXPORT_METHOD(addSegment:(nonnull NSNumber *)key :(NSArray<NSNumber *> *)val
|
|
|
441
442
|
return;
|
|
442
443
|
}
|
|
443
444
|
|
|
444
|
-
[self.segmentCollectionBuilder addSegment: [[MASegment alloc] initWithKey: key values: values]];
|
|
445
|
+
[self.segmentCollectionBuilder addSegment: [[MASegment alloc] initWithKey: @(key) values: values]];
|
|
445
446
|
|
|
446
447
|
resolve(nil);
|
|
447
448
|
}
|
|
448
449
|
|
|
449
|
-
RCT_EXPORT_METHOD(getSegments:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
450
|
+
RCT_EXPORT_METHOD(getSegments:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
450
451
|
{
|
|
451
452
|
if ( ![self isSDKInitialized] )
|
|
452
453
|
{
|
|
@@ -483,7 +484,7 @@ RCT_EXPORT_METHOD(trackEvent:(NSString *)event :(NSDictionary<NSString *, id> *)
|
|
|
483
484
|
|
|
484
485
|
#pragma mark - Banners
|
|
485
486
|
|
|
486
|
-
RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier :(NSString *)bannerPosition)
|
|
487
|
+
RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition)
|
|
487
488
|
{
|
|
488
489
|
if ( !self.sdk )
|
|
489
490
|
{
|
|
@@ -495,7 +496,7 @@ RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier :(NSString *)bannerP
|
|
|
495
496
|
}
|
|
496
497
|
|
|
497
498
|
// NOTE: No function overloading in JS so we need new method signature
|
|
498
|
-
RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier :(NSString *)bannerPosition :(
|
|
499
|
+
RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition xOffset:(double)xOffset yOffset:(double)yOffset)
|
|
499
500
|
{
|
|
500
501
|
if ( !self.sdk )
|
|
501
502
|
{
|
|
@@ -506,7 +507,7 @@ RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier :(NSStrin
|
|
|
506
507
|
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT atPosition: bannerPosition withOffset: CGPointMake(xOffset, yOffset)];
|
|
507
508
|
}
|
|
508
509
|
|
|
509
|
-
RCT_EXPORT_METHOD(setBannerBackgroundColor:(NSString *)adUnitIdentifier :(NSString *)hexColorCode)
|
|
510
|
+
RCT_EXPORT_METHOD(setBannerBackgroundColor:(NSString *)adUnitIdentifier hexColorCode:(NSString *)hexColorCode)
|
|
510
511
|
{
|
|
511
512
|
if ( !self.sdk )
|
|
512
513
|
{
|
|
@@ -517,7 +518,7 @@ RCT_EXPORT_METHOD(setBannerBackgroundColor:(NSString *)adUnitIdentifier :(NSStri
|
|
|
517
518
|
[self setAdViewBackgroundColorForAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT hexColorCode: hexColorCode];
|
|
518
519
|
}
|
|
519
520
|
|
|
520
|
-
RCT_EXPORT_METHOD(setBannerPlacement:(NSString *)adUnitIdentifier :(nullable NSString *)placement)
|
|
521
|
+
RCT_EXPORT_METHOD(setBannerPlacement:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement)
|
|
521
522
|
{
|
|
522
523
|
if ( !self.sdk )
|
|
523
524
|
{
|
|
@@ -528,7 +529,7 @@ RCT_EXPORT_METHOD(setBannerPlacement:(NSString *)adUnitIdentifier :(nullable NSS
|
|
|
528
529
|
[self setAdViewPlacement: placement forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
529
530
|
}
|
|
530
531
|
|
|
531
|
-
RCT_EXPORT_METHOD(setBannerCustomData:(NSString *)adUnitIdentifier :(nullable NSString *)customData)
|
|
532
|
+
RCT_EXPORT_METHOD(setBannerCustomData:(NSString *)adUnitIdentifier customData:(nullable NSString *)customData)
|
|
532
533
|
{
|
|
533
534
|
if ( !self.sdk )
|
|
534
535
|
{
|
|
@@ -539,7 +540,7 @@ RCT_EXPORT_METHOD(setBannerCustomData:(NSString *)adUnitIdentifier :(nullable NS
|
|
|
539
540
|
[self setAdViewCustomData: customData forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
540
541
|
}
|
|
541
542
|
|
|
542
|
-
RCT_EXPORT_METHOD(updateBannerPosition:(NSString *)adUnitIdentifier :(NSString *)bannerPosition)
|
|
543
|
+
RCT_EXPORT_METHOD(updateBannerPosition:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition)
|
|
543
544
|
{
|
|
544
545
|
if ( !self.sdk )
|
|
545
546
|
{
|
|
@@ -550,7 +551,7 @@ RCT_EXPORT_METHOD(updateBannerPosition:(NSString *)adUnitIdentifier :(NSString *
|
|
|
550
551
|
[self updateAdViewPosition: bannerPosition withOffset: CGPointZero forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
551
552
|
}
|
|
552
553
|
|
|
553
|
-
RCT_EXPORT_METHOD(updateBannerOffsets:(NSString *)adUnitIdentifier :(
|
|
554
|
+
RCT_EXPORT_METHOD(updateBannerOffsets:(NSString *)adUnitIdentifier xOffset:(double)xOffset yOffset:(double)yOffset)
|
|
554
555
|
{
|
|
555
556
|
if ( !self.sdk )
|
|
556
557
|
{
|
|
@@ -561,7 +562,7 @@ RCT_EXPORT_METHOD(updateBannerOffsets:(NSString *)adUnitIdentifier :(CGFloat)xOf
|
|
|
561
562
|
[self updateAdViewPosition: self.adViewPositions[adUnitIdentifier] withOffset: CGPointMake(xOffset, yOffset) forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
562
563
|
}
|
|
563
564
|
|
|
564
|
-
RCT_EXPORT_METHOD(setBannerWidth:(NSString *)adUnitIdentifier :(
|
|
565
|
+
RCT_EXPORT_METHOD(setBannerWidth:(NSString *)adUnitIdentifier width:(double)width)
|
|
565
566
|
{
|
|
566
567
|
if ( !self.sdk )
|
|
567
568
|
{
|
|
@@ -572,7 +573,7 @@ RCT_EXPORT_METHOD(setBannerWidth:(NSString *)adUnitIdentifier :(CGFloat)width)
|
|
|
572
573
|
[self setAdViewWidth: width forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
573
574
|
}
|
|
574
575
|
|
|
575
|
-
RCT_EXPORT_METHOD(setBannerExtraParameter:(NSString *)adUnitIdentifier :(NSString *)key :(nullable NSString *)value)
|
|
576
|
+
RCT_EXPORT_METHOD(setBannerExtraParameter:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value)
|
|
576
577
|
{
|
|
577
578
|
if ( !self.sdk )
|
|
578
579
|
{
|
|
@@ -584,7 +585,7 @@ RCT_EXPORT_METHOD(setBannerExtraParameter:(NSString *)adUnitIdentifier :(NSStrin
|
|
|
584
585
|
}
|
|
585
586
|
|
|
586
587
|
// NOTE: Even though iOS is ok with `id` generic types, Android is not - so we wrap it via JSON/ReadableMap
|
|
587
|
-
RCT_EXPORT_METHOD(setBannerLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
|
|
588
|
+
RCT_EXPORT_METHOD(setBannerLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
588
589
|
{
|
|
589
590
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
590
591
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -647,14 +648,14 @@ RCT_EXPORT_METHOD(destroyBanner:(NSString *)adUnitIdentifier)
|
|
|
647
648
|
[self destroyAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
648
649
|
}
|
|
649
650
|
|
|
650
|
-
RCT_EXPORT_METHOD(getAdaptiveBannerHeightForWidth:(
|
|
651
|
+
RCT_EXPORT_METHOD(getAdaptiveBannerHeightForWidth:(double)width resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
651
652
|
{
|
|
652
653
|
resolve(@([DEVICE_SPECIFIC_ADVIEW_AD_FORMAT adaptiveSizeForWidth: width].height));
|
|
653
654
|
}
|
|
654
655
|
|
|
655
656
|
#pragma mark - MRECs
|
|
656
657
|
|
|
657
|
-
RCT_EXPORT_METHOD(createMRec:(NSString *)adUnitIdentifier :(NSString *)mrecPosition)
|
|
658
|
+
RCT_EXPORT_METHOD(createMRec:(NSString *)adUnitIdentifier position:(NSString *)mrecPosition)
|
|
658
659
|
{
|
|
659
660
|
if ( !self.sdk )
|
|
660
661
|
{
|
|
@@ -665,7 +666,7 @@ RCT_EXPORT_METHOD(createMRec:(NSString *)adUnitIdentifier :(NSString *)mrecPosit
|
|
|
665
666
|
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec atPosition: mrecPosition withOffset: CGPointZero];
|
|
666
667
|
}
|
|
667
668
|
|
|
668
|
-
RCT_EXPORT_METHOD(setMRecPlacement:(NSString *)adUnitIdentifier :(nullable NSString *)placement)
|
|
669
|
+
RCT_EXPORT_METHOD(setMRecPlacement:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement)
|
|
669
670
|
{
|
|
670
671
|
if ( !self.sdk )
|
|
671
672
|
{
|
|
@@ -676,7 +677,7 @@ RCT_EXPORT_METHOD(setMRecPlacement:(NSString *)adUnitIdentifier :(nullable NSStr
|
|
|
676
677
|
[self setAdViewPlacement: placement forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
|
677
678
|
}
|
|
678
679
|
|
|
679
|
-
RCT_EXPORT_METHOD(setMRecCustomData:(NSString *)adUnitIdentifier :(nullable NSString *)customData)
|
|
680
|
+
RCT_EXPORT_METHOD(setMRecCustomData:(NSString *)adUnitIdentifier customData:(nullable NSString *)customData)
|
|
680
681
|
{
|
|
681
682
|
if ( !self.sdk )
|
|
682
683
|
{
|
|
@@ -687,7 +688,7 @@ RCT_EXPORT_METHOD(setMRecCustomData:(NSString *)adUnitIdentifier :(nullable NSSt
|
|
|
687
688
|
[self setAdViewCustomData: customData forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
|
688
689
|
}
|
|
689
690
|
|
|
690
|
-
RCT_EXPORT_METHOD(updateMRecPosition:(NSString *)
|
|
691
|
+
RCT_EXPORT_METHOD(updateMRecPosition:(NSString *)adUnitIdentifier position:(NSString *)mrecPosition)
|
|
691
692
|
{
|
|
692
693
|
if ( !self.sdk )
|
|
693
694
|
{
|
|
@@ -698,13 +699,13 @@ RCT_EXPORT_METHOD(updateMRecPosition:(NSString *)mrecPosition :(NSString *)adUni
|
|
|
698
699
|
[self updateAdViewPosition: mrecPosition withOffset: CGPointZero forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
|
699
700
|
}
|
|
700
701
|
|
|
701
|
-
RCT_EXPORT_METHOD(setMRecExtraParameter:(NSString *)adUnitIdentifier :(NSString *)key :(nullable NSString *)value)
|
|
702
|
+
RCT_EXPORT_METHOD(setMRecExtraParameter:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value)
|
|
702
703
|
{
|
|
703
704
|
[self setAdViewExtraParameterForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec key: key value: value];
|
|
704
705
|
}
|
|
705
706
|
|
|
706
707
|
// NOTE: Even though iOS is ok with `id` generic types, Android is not - so we wrap it via JSON/ReadableMap
|
|
707
|
-
RCT_EXPORT_METHOD(setMRecLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
|
|
708
|
+
RCT_EXPORT_METHOD(setMRecLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
708
709
|
{
|
|
709
710
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
710
711
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -781,7 +782,7 @@ RCT_EXPORT_METHOD(loadInterstitial:(NSString *)adUnitIdentifier)
|
|
|
781
782
|
[interstitial loadAd];
|
|
782
783
|
}
|
|
783
784
|
|
|
784
|
-
RCT_EXPORT_METHOD(isInterstitialReady:(NSString *)adUnitIdentifier :(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
785
|
+
RCT_EXPORT_METHOD(isInterstitialReady:(NSString *)adUnitIdentifier resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
785
786
|
{
|
|
786
787
|
if ( !self.sdk )
|
|
787
788
|
{
|
|
@@ -794,7 +795,7 @@ RCT_EXPORT_METHOD(isInterstitialReady:(NSString *)adUnitIdentifier :(RCTPromiseR
|
|
|
794
795
|
resolve(@([interstitial isReady]));
|
|
795
796
|
}
|
|
796
797
|
|
|
797
|
-
RCT_EXPORT_METHOD(showInterstitial:(NSString *)adUnitIdentifier :(nullable NSString *)placement :(nullable NSString *)customData)
|
|
798
|
+
RCT_EXPORT_METHOD(showInterstitial:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData)
|
|
798
799
|
{
|
|
799
800
|
if ( !self.sdk )
|
|
800
801
|
{
|
|
@@ -806,7 +807,7 @@ RCT_EXPORT_METHOD(showInterstitial:(NSString *)adUnitIdentifier :(nullable NSStr
|
|
|
806
807
|
[interstitial showAdForPlacement: placement customData: customData];
|
|
807
808
|
}
|
|
808
809
|
|
|
809
|
-
RCT_EXPORT_METHOD(setInterstitialExtraParameter:(NSString *)adUnitIdentifier :(NSString *)key :(nullable NSString *)value)
|
|
810
|
+
RCT_EXPORT_METHOD(setInterstitialExtraParameter:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value)
|
|
810
811
|
{
|
|
811
812
|
if ( !self.sdk )
|
|
812
813
|
{
|
|
@@ -819,7 +820,7 @@ RCT_EXPORT_METHOD(setInterstitialExtraParameter:(NSString *)adUnitIdentifier :(N
|
|
|
819
820
|
}
|
|
820
821
|
|
|
821
822
|
// NOTE: Even though iOS is ok with `id` generic types, Android is not - so we wrap it via JSON/ReadableMap
|
|
822
|
-
RCT_EXPORT_METHOD(setInterstitialLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
|
|
823
|
+
RCT_EXPORT_METHOD(setInterstitialLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
823
824
|
{
|
|
824
825
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
825
826
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -842,7 +843,7 @@ RCT_EXPORT_METHOD(loadRewardedAd:(NSString *)adUnitIdentifier)
|
|
|
842
843
|
[rewardedAd loadAd];
|
|
843
844
|
}
|
|
844
845
|
|
|
845
|
-
RCT_EXPORT_METHOD(isRewardedAdReady:(NSString *)adUnitIdentifier :(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
846
|
+
RCT_EXPORT_METHOD(isRewardedAdReady:(NSString *)adUnitIdentifier resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
846
847
|
{
|
|
847
848
|
if ( !self.sdk )
|
|
848
849
|
{
|
|
@@ -855,7 +856,7 @@ RCT_EXPORT_METHOD(isRewardedAdReady:(NSString *)adUnitIdentifier :(RCTPromiseRes
|
|
|
855
856
|
resolve(@([rewardedAd isReady]));
|
|
856
857
|
}
|
|
857
858
|
|
|
858
|
-
RCT_EXPORT_METHOD(showRewardedAd:(NSString *)adUnitIdentifier :(nullable NSString *)placement :(nullable NSString *)customData)
|
|
859
|
+
RCT_EXPORT_METHOD(showRewardedAd:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData)
|
|
859
860
|
{
|
|
860
861
|
if ( !self.sdk )
|
|
861
862
|
{
|
|
@@ -867,7 +868,7 @@ RCT_EXPORT_METHOD(showRewardedAd:(NSString *)adUnitIdentifier :(nullable NSStrin
|
|
|
867
868
|
[rewardedAd showAdForPlacement: placement customData: customData];
|
|
868
869
|
}
|
|
869
870
|
|
|
870
|
-
RCT_EXPORT_METHOD(setRewardedAdExtraParameter:(NSString *)adUnitIdentifier :(NSString *)key :(nullable NSString *)value)
|
|
871
|
+
RCT_EXPORT_METHOD(setRewardedAdExtraParameter:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value)
|
|
871
872
|
{
|
|
872
873
|
if ( !self.sdk )
|
|
873
874
|
{
|
|
@@ -880,7 +881,7 @@ RCT_EXPORT_METHOD(setRewardedAdExtraParameter:(NSString *)adUnitIdentifier :(NSS
|
|
|
880
881
|
}
|
|
881
882
|
|
|
882
883
|
// NOTE: Even though iOS is ok with `id` generic types, Android is not - so we wrap it via JSON/ReadableMap
|
|
883
|
-
RCT_EXPORT_METHOD(setRewardedAdLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
|
|
884
|
+
RCT_EXPORT_METHOD(setRewardedAdLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
884
885
|
{
|
|
885
886
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
886
887
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -903,7 +904,7 @@ RCT_EXPORT_METHOD(loadAppOpenAd:(NSString *)adUnitIdentifier)
|
|
|
903
904
|
[appOpenAd loadAd];
|
|
904
905
|
}
|
|
905
906
|
|
|
906
|
-
RCT_EXPORT_METHOD(isAppOpenAdReady:(NSString *)adUnitIdentifier :(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
907
|
+
RCT_EXPORT_METHOD(isAppOpenAdReady:(NSString *)adUnitIdentifier resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
907
908
|
{
|
|
908
909
|
if ( !self.sdk )
|
|
909
910
|
{
|
|
@@ -941,7 +942,7 @@ RCT_EXPORT_METHOD(setAppOpenAdExtraParameter:(NSString *)adUnitIdentifier key:(N
|
|
|
941
942
|
}
|
|
942
943
|
|
|
943
944
|
// NOTE: Even though iOS is ok with `id` generic types, Android is not - so we wrap it via JSON/ReadableMap
|
|
944
|
-
RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
|
|
945
|
+
RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
945
946
|
{
|
|
946
947
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
947
948
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -953,21 +954,21 @@ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier :
|
|
|
953
954
|
#pragma mark - AdView Preloading
|
|
954
955
|
|
|
955
956
|
RCT_EXPORT_METHOD(preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
957
|
+
adFormat:(NSString *)adFormatStr
|
|
958
|
+
placement:(nullable NSString *)placement
|
|
959
|
+
customData:(nullable NSString *)customData
|
|
960
|
+
extraParameters:(nullable NSDictionary<NSString *, id> *)extraParameterDict
|
|
961
|
+
localExtraParameters:(nullable NSDictionary<NSString *, id> *)localExtraParameterDict
|
|
962
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
963
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
963
964
|
{
|
|
964
965
|
MAAdFormat *adFormat;
|
|
965
966
|
|
|
966
|
-
if ( [
|
|
967
|
+
if ( [@"BANNER" al_isEqualToStringIgnoringCase: adFormatStr] )
|
|
967
968
|
{
|
|
968
969
|
adFormat = DEVICE_SPECIFIC_ADVIEW_AD_FORMAT;
|
|
969
970
|
}
|
|
970
|
-
else if ( [
|
|
971
|
+
else if ( [@"MREC" al_isEqualToStringIgnoringCase: adFormatStr] )
|
|
971
972
|
{
|
|
972
973
|
adFormat = MAAdFormat.mrec;
|
|
973
974
|
}
|
|
@@ -987,11 +988,11 @@ RCT_EXPORT_METHOD(preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
|
987
988
|
withPromiseRejecter: reject];
|
|
988
989
|
}
|
|
989
990
|
|
|
990
|
-
RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(
|
|
991
|
-
|
|
992
|
-
|
|
991
|
+
RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(double)adViewId
|
|
992
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
993
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
993
994
|
{
|
|
994
|
-
[AppLovinMAXAdView destroyNativeUIComponentAdView: adViewId
|
|
995
|
+
[AppLovinMAXAdView destroyNativeUIComponentAdView: @(adViewId)
|
|
995
996
|
withPromiseResolver: resolve
|
|
996
997
|
withPromiseRejecter: reject];
|
|
997
998
|
}
|
|
@@ -2172,6 +2173,11 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(nonnull NSNumber *)adViewId
|
|
|
2172
2173
|
@"MAX_ERROR_CODE_DONT_KEEP_ACTIVITIES_ENABLED" : @(-5602)};
|
|
2173
2174
|
}
|
|
2174
2175
|
|
|
2176
|
+
- (NSDictionary *)getConstants
|
|
2177
|
+
{
|
|
2178
|
+
return [self constantsToExport];
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2175
2181
|
- (void)startObserving
|
|
2176
2182
|
{
|
|
2177
2183
|
self.hasListeners = YES;
|
|
@@ -2182,4 +2188,11 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(nonnull NSNumber *)adViewId
|
|
|
2182
2188
|
self.hasListeners = NO;
|
|
2183
2189
|
}
|
|
2184
2190
|
|
|
2191
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2192
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
2193
|
+
{
|
|
2194
|
+
return std::make_shared<facebook::react::NativeAppLovinMAXModuleSpecJSI>(params);
|
|
2195
|
+
}
|
|
2196
|
+
#endif
|
|
2197
|
+
|
|
2185
2198
|
@end
|
package/ios/AppLovinMAXAdView.h
CHANGED
|
@@ -9,9 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
@class MAAdView;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
13
|
+
#import <React/RCTViewComponentView.h>
|
|
14
|
+
@interface AppLovinMAXAdView : RCTViewComponentView
|
|
15
|
+
#else
|
|
14
16
|
@interface AppLovinMAXAdView : UIView
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
15
20
|
|
|
16
21
|
@property (nonatomic, copy) RCTDirectEventBlock onAdLoadedEvent;
|
|
17
22
|
@property (nonatomic, copy) RCTDirectEventBlock onAdLoadFailedEvent;
|