react-native-applovin-max 8.2.0 → 9.1.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 +14 -3
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdView.java +34 -27
- 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} +108 -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} +67 -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 +102 -142
- package/lib/commonjs/AdView.js.map +1 -1
- package/lib/commonjs/AppLovinMAX.js +49 -34
- 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 +27 -36
- package/lib/commonjs/ErrorCode.js.map +1 -1
- package/lib/commonjs/EventEmitter.js +24 -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 +43 -0
- package/lib/commonjs/Utils.js.map +1 -0
- package/lib/commonjs/nativeAd/NativeAdView.js +84 -50
- package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js +129 -82
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js +67 -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 +41 -0
- package/lib/commonjs/specs/AppLovinMAXAdViewNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/AppLovinMAXNativeAdViewNativeComponent.js +37 -0
- package/lib/commonjs/specs/AppLovinMAXNativeAdViewNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/NativeAppLovinMAXModule.js +16 -0
- package/lib/commonjs/specs/NativeAppLovinMAXModule.js.map +1 -0
- package/lib/commonjs/types/AdInfo.js +13 -16
- package/lib/commonjs/types/AdInfo.js.map +1 -1
- package/lib/module/AdView.js +98 -139
- package/lib/module/AdView.js.map +1 -1
- package/lib/module/AppLovinMAX.js +47 -32
- 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 +25 -35
- package/lib/module/ErrorCode.js.map +1 -1
- package/lib/module/EventEmitter.js +24 -5
- 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 +35 -0
- package/lib/module/Utils.js.map +1 -0
- package/lib/module/nativeAd/NativeAdView.js +83 -47
- package/lib/module/nativeAd/NativeAdView.js.map +1 -1
- package/lib/module/nativeAd/NativeAdViewComponents.js +134 -83
- package/lib/module/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/module/nativeAd/NativeAdViewProvider.js +69 -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 +35 -0
- package/lib/module/specs/AppLovinMAXAdViewNativeComponent.js.map +1 -0
- package/lib/module/specs/AppLovinMAXNativeAdViewNativeComponent.js +31 -0
- package/lib/module/specs/AppLovinMAXNativeAdViewNativeComponent.js.map +1 -0
- package/lib/module/specs/NativeAppLovinMAXModule.js +12 -0
- package/lib/module/specs/NativeAppLovinMAXModule.js.map +1 -0
- package/lib/module/types/AdInfo.js +13 -16
- package/lib/module/types/AdInfo.js.map +1 -1
- package/lib/typescript/src/AdView.d.ts +38 -32
- package/lib/typescript/src/AdView.d.ts.map +1 -1
- package/lib/typescript/src/AppLovinMAX.d.ts +22 -21
- 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 +24 -31
- package/lib/typescript/src/ErrorCode.d.ts.map +1 -1
- package/lib/typescript/src/EventEmitter.d.ts +16 -0
- 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 +31 -0
- package/lib/typescript/src/Utils.d.ts.map +1 -0
- package/lib/typescript/src/nativeAd/NativeAdView.d.ts +15 -7
- package/lib/typescript/src/nativeAd/NativeAdView.d.ts.map +1 -1
- package/lib/typescript/src/nativeAd/NativeAdViewComponents.d.ts +65 -1
- package/lib/typescript/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
- package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts +31 -5
- package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
- package/lib/typescript/src/specs/AppLovinMAXAdViewNativeComponent.d.ts +130 -0
- package/lib/typescript/src/specs/AppLovinMAXAdViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/AppLovinMAXNativeAdViewNativeComponent.d.ts +131 -0
- package/lib/typescript/src/specs/AppLovinMAXNativeAdViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeAppLovinMAXModule.d.ts +142 -0
- package/lib/typescript/src/specs/NativeAppLovinMAXModule.d.ts.map +1 -0
- package/lib/typescript/src/types/AdEvent.d.ts +10 -4
- package/lib/typescript/src/types/AdEvent.d.ts.map +1 -1
- package/lib/typescript/src/types/AdInfo.d.ts +79 -86
- package/lib/typescript/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/src/types/AdProps.d.ts +16 -17
- package/lib/typescript/src/types/AdProps.d.ts.map +1 -1
- package/lib/typescript/src/types/AdViewProps.d.ts +28 -29
- package/lib/typescript/src/types/AdViewProps.d.ts.map +1 -1
- package/lib/typescript/src/types/AppLovinMAX.d.ts +50 -53
- package/lib/typescript/src/types/AppLovinMAX.d.ts.map +1 -1
- package/lib/typescript/src/types/BannerAd.d.ts +22 -17
- package/lib/typescript/src/types/BannerAd.d.ts.map +1 -1
- package/lib/typescript/src/types/CMPError.d.ts +7 -4
- package/lib/typescript/src/types/CMPError.d.ts.map +1 -1
- package/lib/typescript/src/types/Configuration.d.ts +12 -14
- package/lib/typescript/src/types/Configuration.d.ts.map +1 -1
- package/lib/typescript/src/types/FullscreenAd.d.ts +39 -46
- package/lib/typescript/src/types/FullscreenAd.d.ts.map +1 -1
- package/lib/typescript/src/types/MRecAd.d.ts +7 -3
- package/lib/typescript/src/types/MRecAd.d.ts.map +1 -1
- package/lib/typescript/src/types/NativeAd.d.ts +15 -10
- package/lib/typescript/src/types/NativeAd.d.ts.map +1 -1
- package/lib/typescript/src/types/NativeAdViewProps.d.ts +4 -3
- package/lib/typescript/src/types/NativeAdViewProps.d.ts.map +1 -1
- package/lib/typescript/src/types/Privacy.d.ts +13 -6
- package/lib/typescript/src/types/Privacy.d.ts.map +1 -1
- package/lib/typescript/src/types/RewardedAd.d.ts +7 -5
- package/lib/typescript/src/types/RewardedAd.d.ts.map +1 -1
- package/lib/typescript/src/types/ViewAd.d.ts +46 -50
- package/lib/typescript/src/types/ViewAd.d.ts.map +1 -1
- package/package.json +9 -1
- package/react-native-applovin-max.podspec +3 -3
- package/src/AdView.tsx +100 -183
- package/src/AppLovinMAX.ts +42 -33
- package/src/AppOpenAd.ts +1 -3
- package/src/BannerAd.ts +1 -3
- package/src/ErrorCode.ts +25 -34
- package/src/EventEmitter.ts +22 -5
- 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 +45 -0
- package/src/nativeAd/NativeAdView.tsx +83 -73
- package/src/nativeAd/NativeAdViewComponents.tsx +120 -89
- package/src/nativeAd/NativeAdViewProvider.tsx +60 -12
- package/src/nativeAd/img/blank_icon.png +0 -0
- package/src/specs/AppLovinMAXAdViewNativeComponent.ts +157 -0
- package/src/specs/AppLovinMAXNativeAdViewNativeComponent.ts +153 -0
- package/src/specs/NativeAppLovinMAXModule.ts +228 -0
- package/src/types/AdEvent.ts +10 -4
- package/src/types/AdInfo.ts +79 -86
- package/src/types/AdProps.ts +16 -17
- package/src/types/AdViewProps.ts +28 -29
- package/src/types/AppLovinMAX.ts +50 -53
- package/src/types/BannerAd.ts +22 -17
- package/src/types/CMPError.ts +7 -4
- package/src/types/Configuration.ts +12 -14
- package/src/types/FullscreenAd.ts +39 -46
- package/src/types/MRecAd.ts +7 -3
- package/src/types/NativeAd.ts +16 -10
- package/src/types/NativeAdViewProps.ts +4 -3
- package/src/types/Privacy.ts +13 -6
- package/src/types/RewardedAd.ts +7 -5
- package/src/types/ViewAd.ts +46 -50
- 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.1.0";
|
|
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.1.0" : @"13.2.0",
|
|
153
|
+
@"9.0.0" : @"13.0.1",
|
|
152
154
|
@"8.2.0" : @"13.0.1",
|
|
153
155
|
@"8.1.1" : @"13.0.1",
|
|
154
156
|
@"8.1.0" : @"13.0.1",
|
|
@@ -221,12 +223,12 @@ RCT_EXPORT_MODULE()
|
|
|
221
223
|
return self;
|
|
222
224
|
}
|
|
223
225
|
|
|
224
|
-
RCT_EXPORT_METHOD(isInitialized:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
226
|
+
RCT_EXPORT_METHOD(isInitialized:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
225
227
|
{
|
|
226
228
|
resolve(@([self isPluginInitialized] && [self isSDKInitialized]));
|
|
227
229
|
}
|
|
228
230
|
|
|
229
|
-
RCT_EXPORT_METHOD(initialize:(NSString *)pluginVersion :(NSString *)sdkKey :(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
231
|
+
RCT_EXPORT_METHOD(initialize:(NSString *)pluginVersion sdkKey:(NSString *)sdkKey resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
230
232
|
{
|
|
231
233
|
// Guard against running init logic multiple times
|
|
232
234
|
if ( [self isPluginInitialized] )
|
|
@@ -291,7 +293,7 @@ RCT_EXPORT_METHOD(initialize:(NSString *)pluginVersion :(NSString *)sdkKey :(RCT
|
|
|
291
293
|
|
|
292
294
|
#pragma mark - General Public API
|
|
293
295
|
|
|
294
|
-
RCT_EXPORT_METHOD(isTablet:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
296
|
+
RCT_EXPORT_METHOD(isTablet:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
295
297
|
{
|
|
296
298
|
resolve(@([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad));
|
|
297
299
|
}
|
|
@@ -312,7 +314,7 @@ RCT_EXPORT_METHOD(setHasUserConsent:(BOOL)hasUserConsent)
|
|
|
312
314
|
[ALPrivacySettings setHasUserConsent: hasUserConsent];
|
|
313
315
|
}
|
|
314
316
|
|
|
315
|
-
RCT_EXPORT_METHOD(hasUserConsent:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
317
|
+
RCT_EXPORT_METHOD(hasUserConsent:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
316
318
|
{
|
|
317
319
|
resolve(@([ALPrivacySettings hasUserConsent]));
|
|
318
320
|
}
|
|
@@ -322,7 +324,7 @@ RCT_EXPORT_METHOD(setDoNotSell:(BOOL)doNotSell)
|
|
|
322
324
|
[ALPrivacySettings setDoNotSell: doNotSell];
|
|
323
325
|
}
|
|
324
326
|
|
|
325
|
-
RCT_EXPORT_METHOD(isDoNotSell:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
327
|
+
RCT_EXPORT_METHOD(isDoNotSell:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
326
328
|
{
|
|
327
329
|
resolve(@([ALPrivacySettings isDoNotSell]));
|
|
328
330
|
}
|
|
@@ -337,7 +339,7 @@ RCT_EXPORT_METHOD(setMuted:(BOOL)muted)
|
|
|
337
339
|
self.sdk.settings.muted = muted;
|
|
338
340
|
}
|
|
339
341
|
|
|
340
|
-
RCT_EXPORT_METHOD(isMuted:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
342
|
+
RCT_EXPORT_METHOD(isMuted:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
341
343
|
{
|
|
342
344
|
resolve(@(self.sdk.settings.muted));
|
|
343
345
|
}
|
|
@@ -357,7 +359,7 @@ RCT_EXPORT_METHOD(setCreativeDebuggerEnabled:(BOOL)enabled)
|
|
|
357
359
|
self.sdk.settings.creativeDebuggerEnabled = enabled;
|
|
358
360
|
}
|
|
359
361
|
|
|
360
|
-
RCT_EXPORT_METHOD(setExtraParameter:(NSString *)key :(nullable NSString *)value)
|
|
362
|
+
RCT_EXPORT_METHOD(setExtraParameter:(NSString *)key value:(nullable NSString *)value)
|
|
361
363
|
{
|
|
362
364
|
if ( ![key al_isValidString] )
|
|
363
365
|
{
|
|
@@ -397,7 +399,7 @@ RCT_EXPORT_METHOD(setConsentFlowDebugUserGeography:(NSString *)userGeography)
|
|
|
397
399
|
self.sdk.settings.termsAndPrivacyPolicyFlowSettings.debugUserGeography = [self toAppLovinConsentFlowUserGeography: userGeography];
|
|
398
400
|
}
|
|
399
401
|
|
|
400
|
-
RCT_EXPORT_METHOD(showCmpForExistingUser:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
402
|
+
RCT_EXPORT_METHOD(showCmpForExistingUser:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
401
403
|
{
|
|
402
404
|
if ( ![self isPluginInitialized] )
|
|
403
405
|
{
|
|
@@ -420,7 +422,7 @@ RCT_EXPORT_METHOD(showCmpForExistingUser:(RCTPromiseResolveBlock)resolve :(RCTPr
|
|
|
420
422
|
}];
|
|
421
423
|
}
|
|
422
424
|
|
|
423
|
-
RCT_EXPORT_METHOD(hasSupportedCmp:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
425
|
+
RCT_EXPORT_METHOD(hasSupportedCmp:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
424
426
|
{
|
|
425
427
|
if ( ![self isPluginInitialized] )
|
|
426
428
|
{
|
|
@@ -433,7 +435,7 @@ RCT_EXPORT_METHOD(hasSupportedCmp:(RCTPromiseResolveBlock)resolve :(RCTPromiseRe
|
|
|
433
435
|
|
|
434
436
|
#pragma mark - Segment Targeting
|
|
435
437
|
|
|
436
|
-
RCT_EXPORT_METHOD(addSegment:(
|
|
438
|
+
RCT_EXPORT_METHOD(addSegment:(double)key values:(NSArray *)values resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
437
439
|
{
|
|
438
440
|
if ( [self isPluginInitialized] )
|
|
439
441
|
{
|
|
@@ -441,12 +443,12 @@ RCT_EXPORT_METHOD(addSegment:(nonnull NSNumber *)key :(NSArray<NSNumber *> *)val
|
|
|
441
443
|
return;
|
|
442
444
|
}
|
|
443
445
|
|
|
444
|
-
[self.segmentCollectionBuilder addSegment: [[MASegment alloc] initWithKey: key values: values]];
|
|
446
|
+
[self.segmentCollectionBuilder addSegment: [[MASegment alloc] initWithKey: @(key) values: values]];
|
|
445
447
|
|
|
446
448
|
resolve(nil);
|
|
447
449
|
}
|
|
448
450
|
|
|
449
|
-
RCT_EXPORT_METHOD(getSegments:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
451
|
+
RCT_EXPORT_METHOD(getSegments:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
450
452
|
{
|
|
451
453
|
if ( ![self isSDKInitialized] )
|
|
452
454
|
{
|
|
@@ -483,7 +485,7 @@ RCT_EXPORT_METHOD(trackEvent:(NSString *)event :(NSDictionary<NSString *, id> *)
|
|
|
483
485
|
|
|
484
486
|
#pragma mark - Banners
|
|
485
487
|
|
|
486
|
-
RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier :(NSString *)bannerPosition)
|
|
488
|
+
RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition)
|
|
487
489
|
{
|
|
488
490
|
if ( !self.sdk )
|
|
489
491
|
{
|
|
@@ -495,7 +497,7 @@ RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier :(NSString *)bannerP
|
|
|
495
497
|
}
|
|
496
498
|
|
|
497
499
|
// NOTE: No function overloading in JS so we need new method signature
|
|
498
|
-
RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier :(NSString *)bannerPosition :(
|
|
500
|
+
RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition xOffset:(double)xOffset yOffset:(double)yOffset)
|
|
499
501
|
{
|
|
500
502
|
if ( !self.sdk )
|
|
501
503
|
{
|
|
@@ -506,7 +508,7 @@ RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier :(NSStrin
|
|
|
506
508
|
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT atPosition: bannerPosition withOffset: CGPointMake(xOffset, yOffset)];
|
|
507
509
|
}
|
|
508
510
|
|
|
509
|
-
RCT_EXPORT_METHOD(setBannerBackgroundColor:(NSString *)adUnitIdentifier :(NSString *)hexColorCode)
|
|
511
|
+
RCT_EXPORT_METHOD(setBannerBackgroundColor:(NSString *)adUnitIdentifier hexColorCode:(NSString *)hexColorCode)
|
|
510
512
|
{
|
|
511
513
|
if ( !self.sdk )
|
|
512
514
|
{
|
|
@@ -517,7 +519,7 @@ RCT_EXPORT_METHOD(setBannerBackgroundColor:(NSString *)adUnitIdentifier :(NSStri
|
|
|
517
519
|
[self setAdViewBackgroundColorForAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT hexColorCode: hexColorCode];
|
|
518
520
|
}
|
|
519
521
|
|
|
520
|
-
RCT_EXPORT_METHOD(setBannerPlacement:(NSString *)adUnitIdentifier :(nullable NSString *)placement)
|
|
522
|
+
RCT_EXPORT_METHOD(setBannerPlacement:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement)
|
|
521
523
|
{
|
|
522
524
|
if ( !self.sdk )
|
|
523
525
|
{
|
|
@@ -528,7 +530,7 @@ RCT_EXPORT_METHOD(setBannerPlacement:(NSString *)adUnitIdentifier :(nullable NSS
|
|
|
528
530
|
[self setAdViewPlacement: placement forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
529
531
|
}
|
|
530
532
|
|
|
531
|
-
RCT_EXPORT_METHOD(setBannerCustomData:(NSString *)adUnitIdentifier :(nullable NSString *)customData)
|
|
533
|
+
RCT_EXPORT_METHOD(setBannerCustomData:(NSString *)adUnitIdentifier customData:(nullable NSString *)customData)
|
|
532
534
|
{
|
|
533
535
|
if ( !self.sdk )
|
|
534
536
|
{
|
|
@@ -539,7 +541,7 @@ RCT_EXPORT_METHOD(setBannerCustomData:(NSString *)adUnitIdentifier :(nullable NS
|
|
|
539
541
|
[self setAdViewCustomData: customData forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
540
542
|
}
|
|
541
543
|
|
|
542
|
-
RCT_EXPORT_METHOD(updateBannerPosition:(NSString *)adUnitIdentifier :(NSString *)bannerPosition)
|
|
544
|
+
RCT_EXPORT_METHOD(updateBannerPosition:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition)
|
|
543
545
|
{
|
|
544
546
|
if ( !self.sdk )
|
|
545
547
|
{
|
|
@@ -550,7 +552,7 @@ RCT_EXPORT_METHOD(updateBannerPosition:(NSString *)adUnitIdentifier :(NSString *
|
|
|
550
552
|
[self updateAdViewPosition: bannerPosition withOffset: CGPointZero forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
551
553
|
}
|
|
552
554
|
|
|
553
|
-
RCT_EXPORT_METHOD(updateBannerOffsets:(NSString *)adUnitIdentifier :(
|
|
555
|
+
RCT_EXPORT_METHOD(updateBannerOffsets:(NSString *)adUnitIdentifier xOffset:(double)xOffset yOffset:(double)yOffset)
|
|
554
556
|
{
|
|
555
557
|
if ( !self.sdk )
|
|
556
558
|
{
|
|
@@ -561,7 +563,7 @@ RCT_EXPORT_METHOD(updateBannerOffsets:(NSString *)adUnitIdentifier :(CGFloat)xOf
|
|
|
561
563
|
[self updateAdViewPosition: self.adViewPositions[adUnitIdentifier] withOffset: CGPointMake(xOffset, yOffset) forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
562
564
|
}
|
|
563
565
|
|
|
564
|
-
RCT_EXPORT_METHOD(setBannerWidth:(NSString *)adUnitIdentifier :(
|
|
566
|
+
RCT_EXPORT_METHOD(setBannerWidth:(NSString *)adUnitIdentifier width:(double)width)
|
|
565
567
|
{
|
|
566
568
|
if ( !self.sdk )
|
|
567
569
|
{
|
|
@@ -572,7 +574,7 @@ RCT_EXPORT_METHOD(setBannerWidth:(NSString *)adUnitIdentifier :(CGFloat)width)
|
|
|
572
574
|
[self setAdViewWidth: width forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
573
575
|
}
|
|
574
576
|
|
|
575
|
-
RCT_EXPORT_METHOD(setBannerExtraParameter:(NSString *)adUnitIdentifier :(NSString *)key :(nullable NSString *)value)
|
|
577
|
+
RCT_EXPORT_METHOD(setBannerExtraParameter:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value)
|
|
576
578
|
{
|
|
577
579
|
if ( !self.sdk )
|
|
578
580
|
{
|
|
@@ -584,7 +586,7 @@ RCT_EXPORT_METHOD(setBannerExtraParameter:(NSString *)adUnitIdentifier :(NSStrin
|
|
|
584
586
|
}
|
|
585
587
|
|
|
586
588
|
// 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)
|
|
589
|
+
RCT_EXPORT_METHOD(setBannerLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
588
590
|
{
|
|
589
591
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
590
592
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -647,14 +649,14 @@ RCT_EXPORT_METHOD(destroyBanner:(NSString *)adUnitIdentifier)
|
|
|
647
649
|
[self destroyAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
648
650
|
}
|
|
649
651
|
|
|
650
|
-
RCT_EXPORT_METHOD(getAdaptiveBannerHeightForWidth:(
|
|
652
|
+
RCT_EXPORT_METHOD(getAdaptiveBannerHeightForWidth:(double)width resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
651
653
|
{
|
|
652
654
|
resolve(@([DEVICE_SPECIFIC_ADVIEW_AD_FORMAT adaptiveSizeForWidth: width].height));
|
|
653
655
|
}
|
|
654
656
|
|
|
655
657
|
#pragma mark - MRECs
|
|
656
658
|
|
|
657
|
-
RCT_EXPORT_METHOD(createMRec:(NSString *)adUnitIdentifier :(NSString *)mrecPosition)
|
|
659
|
+
RCT_EXPORT_METHOD(createMRec:(NSString *)adUnitIdentifier position:(NSString *)mrecPosition)
|
|
658
660
|
{
|
|
659
661
|
if ( !self.sdk )
|
|
660
662
|
{
|
|
@@ -665,7 +667,7 @@ RCT_EXPORT_METHOD(createMRec:(NSString *)adUnitIdentifier :(NSString *)mrecPosit
|
|
|
665
667
|
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec atPosition: mrecPosition withOffset: CGPointZero];
|
|
666
668
|
}
|
|
667
669
|
|
|
668
|
-
RCT_EXPORT_METHOD(setMRecPlacement:(NSString *)adUnitIdentifier :(nullable NSString *)placement)
|
|
670
|
+
RCT_EXPORT_METHOD(setMRecPlacement:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement)
|
|
669
671
|
{
|
|
670
672
|
if ( !self.sdk )
|
|
671
673
|
{
|
|
@@ -676,7 +678,7 @@ RCT_EXPORT_METHOD(setMRecPlacement:(NSString *)adUnitIdentifier :(nullable NSStr
|
|
|
676
678
|
[self setAdViewPlacement: placement forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
|
677
679
|
}
|
|
678
680
|
|
|
679
|
-
RCT_EXPORT_METHOD(setMRecCustomData:(NSString *)adUnitIdentifier :(nullable NSString *)customData)
|
|
681
|
+
RCT_EXPORT_METHOD(setMRecCustomData:(NSString *)adUnitIdentifier customData:(nullable NSString *)customData)
|
|
680
682
|
{
|
|
681
683
|
if ( !self.sdk )
|
|
682
684
|
{
|
|
@@ -687,7 +689,7 @@ RCT_EXPORT_METHOD(setMRecCustomData:(NSString *)adUnitIdentifier :(nullable NSSt
|
|
|
687
689
|
[self setAdViewCustomData: customData forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
|
688
690
|
}
|
|
689
691
|
|
|
690
|
-
RCT_EXPORT_METHOD(updateMRecPosition:(NSString *)
|
|
692
|
+
RCT_EXPORT_METHOD(updateMRecPosition:(NSString *)adUnitIdentifier position:(NSString *)mrecPosition)
|
|
691
693
|
{
|
|
692
694
|
if ( !self.sdk )
|
|
693
695
|
{
|
|
@@ -698,13 +700,13 @@ RCT_EXPORT_METHOD(updateMRecPosition:(NSString *)mrecPosition :(NSString *)adUni
|
|
|
698
700
|
[self updateAdViewPosition: mrecPosition withOffset: CGPointZero forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
|
699
701
|
}
|
|
700
702
|
|
|
701
|
-
RCT_EXPORT_METHOD(setMRecExtraParameter:(NSString *)adUnitIdentifier :(NSString *)key :(nullable NSString *)value)
|
|
703
|
+
RCT_EXPORT_METHOD(setMRecExtraParameter:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value)
|
|
702
704
|
{
|
|
703
705
|
[self setAdViewExtraParameterForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec key: key value: value];
|
|
704
706
|
}
|
|
705
707
|
|
|
706
708
|
// 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)
|
|
709
|
+
RCT_EXPORT_METHOD(setMRecLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
708
710
|
{
|
|
709
711
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
710
712
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -781,7 +783,7 @@ RCT_EXPORT_METHOD(loadInterstitial:(NSString *)adUnitIdentifier)
|
|
|
781
783
|
[interstitial loadAd];
|
|
782
784
|
}
|
|
783
785
|
|
|
784
|
-
RCT_EXPORT_METHOD(isInterstitialReady:(NSString *)adUnitIdentifier :(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
786
|
+
RCT_EXPORT_METHOD(isInterstitialReady:(NSString *)adUnitIdentifier resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
785
787
|
{
|
|
786
788
|
if ( !self.sdk )
|
|
787
789
|
{
|
|
@@ -794,7 +796,7 @@ RCT_EXPORT_METHOD(isInterstitialReady:(NSString *)adUnitIdentifier :(RCTPromiseR
|
|
|
794
796
|
resolve(@([interstitial isReady]));
|
|
795
797
|
}
|
|
796
798
|
|
|
797
|
-
RCT_EXPORT_METHOD(showInterstitial:(NSString *)adUnitIdentifier :(nullable NSString *)placement :(nullable NSString *)customData)
|
|
799
|
+
RCT_EXPORT_METHOD(showInterstitial:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData)
|
|
798
800
|
{
|
|
799
801
|
if ( !self.sdk )
|
|
800
802
|
{
|
|
@@ -806,7 +808,7 @@ RCT_EXPORT_METHOD(showInterstitial:(NSString *)adUnitIdentifier :(nullable NSStr
|
|
|
806
808
|
[interstitial showAdForPlacement: placement customData: customData];
|
|
807
809
|
}
|
|
808
810
|
|
|
809
|
-
RCT_EXPORT_METHOD(setInterstitialExtraParameter:(NSString *)adUnitIdentifier :(NSString *)key :(nullable NSString *)value)
|
|
811
|
+
RCT_EXPORT_METHOD(setInterstitialExtraParameter:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value)
|
|
810
812
|
{
|
|
811
813
|
if ( !self.sdk )
|
|
812
814
|
{
|
|
@@ -819,7 +821,7 @@ RCT_EXPORT_METHOD(setInterstitialExtraParameter:(NSString *)adUnitIdentifier :(N
|
|
|
819
821
|
}
|
|
820
822
|
|
|
821
823
|
// 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)
|
|
824
|
+
RCT_EXPORT_METHOD(setInterstitialLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
823
825
|
{
|
|
824
826
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
825
827
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -842,7 +844,7 @@ RCT_EXPORT_METHOD(loadRewardedAd:(NSString *)adUnitIdentifier)
|
|
|
842
844
|
[rewardedAd loadAd];
|
|
843
845
|
}
|
|
844
846
|
|
|
845
|
-
RCT_EXPORT_METHOD(isRewardedAdReady:(NSString *)adUnitIdentifier :(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
847
|
+
RCT_EXPORT_METHOD(isRewardedAdReady:(NSString *)adUnitIdentifier resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
846
848
|
{
|
|
847
849
|
if ( !self.sdk )
|
|
848
850
|
{
|
|
@@ -855,7 +857,7 @@ RCT_EXPORT_METHOD(isRewardedAdReady:(NSString *)adUnitIdentifier :(RCTPromiseRes
|
|
|
855
857
|
resolve(@([rewardedAd isReady]));
|
|
856
858
|
}
|
|
857
859
|
|
|
858
|
-
RCT_EXPORT_METHOD(showRewardedAd:(NSString *)adUnitIdentifier :(nullable NSString *)placement :(nullable NSString *)customData)
|
|
860
|
+
RCT_EXPORT_METHOD(showRewardedAd:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData)
|
|
859
861
|
{
|
|
860
862
|
if ( !self.sdk )
|
|
861
863
|
{
|
|
@@ -867,7 +869,7 @@ RCT_EXPORT_METHOD(showRewardedAd:(NSString *)adUnitIdentifier :(nullable NSStrin
|
|
|
867
869
|
[rewardedAd showAdForPlacement: placement customData: customData];
|
|
868
870
|
}
|
|
869
871
|
|
|
870
|
-
RCT_EXPORT_METHOD(setRewardedAdExtraParameter:(NSString *)adUnitIdentifier :(NSString *)key :(nullable NSString *)value)
|
|
872
|
+
RCT_EXPORT_METHOD(setRewardedAdExtraParameter:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value)
|
|
871
873
|
{
|
|
872
874
|
if ( !self.sdk )
|
|
873
875
|
{
|
|
@@ -880,7 +882,7 @@ RCT_EXPORT_METHOD(setRewardedAdExtraParameter:(NSString *)adUnitIdentifier :(NSS
|
|
|
880
882
|
}
|
|
881
883
|
|
|
882
884
|
// 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)
|
|
885
|
+
RCT_EXPORT_METHOD(setRewardedAdLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
884
886
|
{
|
|
885
887
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
886
888
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -903,7 +905,7 @@ RCT_EXPORT_METHOD(loadAppOpenAd:(NSString *)adUnitIdentifier)
|
|
|
903
905
|
[appOpenAd loadAd];
|
|
904
906
|
}
|
|
905
907
|
|
|
906
|
-
RCT_EXPORT_METHOD(isAppOpenAdReady:(NSString *)adUnitIdentifier :(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
908
|
+
RCT_EXPORT_METHOD(isAppOpenAdReady:(NSString *)adUnitIdentifier resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
907
909
|
{
|
|
908
910
|
if ( !self.sdk )
|
|
909
911
|
{
|
|
@@ -941,7 +943,7 @@ RCT_EXPORT_METHOD(setAppOpenAdExtraParameter:(NSString *)adUnitIdentifier key:(N
|
|
|
941
943
|
}
|
|
942
944
|
|
|
943
945
|
// 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)
|
|
946
|
+
RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
945
947
|
{
|
|
946
948
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
947
949
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -953,21 +955,21 @@ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier :
|
|
|
953
955
|
#pragma mark - AdView Preloading
|
|
954
956
|
|
|
955
957
|
RCT_EXPORT_METHOD(preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
958
|
+
adFormat:(NSString *)adFormatStr
|
|
959
|
+
placement:(nullable NSString *)placement
|
|
960
|
+
customData:(nullable NSString *)customData
|
|
961
|
+
extraParameters:(nullable NSDictionary<NSString *, id> *)extraParameterDict
|
|
962
|
+
localExtraParameters:(nullable NSDictionary<NSString *, id> *)localExtraParameterDict
|
|
963
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
964
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
963
965
|
{
|
|
964
966
|
MAAdFormat *adFormat;
|
|
965
967
|
|
|
966
|
-
if ( [
|
|
968
|
+
if ( [@"BANNER" al_isEqualToStringIgnoringCase: adFormatStr] )
|
|
967
969
|
{
|
|
968
970
|
adFormat = DEVICE_SPECIFIC_ADVIEW_AD_FORMAT;
|
|
969
971
|
}
|
|
970
|
-
else if ( [
|
|
972
|
+
else if ( [@"MREC" al_isEqualToStringIgnoringCase: adFormatStr] )
|
|
971
973
|
{
|
|
972
974
|
adFormat = MAAdFormat.mrec;
|
|
973
975
|
}
|
|
@@ -987,11 +989,11 @@ RCT_EXPORT_METHOD(preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
|
987
989
|
withPromiseRejecter: reject];
|
|
988
990
|
}
|
|
989
991
|
|
|
990
|
-
RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(
|
|
991
|
-
|
|
992
|
-
|
|
992
|
+
RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(double)adViewId
|
|
993
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
994
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
993
995
|
{
|
|
994
|
-
[AppLovinMAXAdView destroyNativeUIComponentAdView: adViewId
|
|
996
|
+
[AppLovinMAXAdView destroyNativeUIComponentAdView: @(adViewId)
|
|
995
997
|
withPromiseResolver: resolve
|
|
996
998
|
withPromiseRejecter: reject];
|
|
997
999
|
}
|
|
@@ -2172,6 +2174,11 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(nonnull NSNumber *)adViewId
|
|
|
2172
2174
|
@"MAX_ERROR_CODE_DONT_KEEP_ACTIVITIES_ENABLED" : @(-5602)};
|
|
2173
2175
|
}
|
|
2174
2176
|
|
|
2177
|
+
- (NSDictionary *)getConstants
|
|
2178
|
+
{
|
|
2179
|
+
return [self constantsToExport];
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2175
2182
|
- (void)startObserving
|
|
2176
2183
|
{
|
|
2177
2184
|
self.hasListeners = YES;
|
|
@@ -2182,4 +2189,11 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(nonnull NSNumber *)adViewId
|
|
|
2182
2189
|
self.hasListeners = NO;
|
|
2183
2190
|
}
|
|
2184
2191
|
|
|
2192
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2193
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
2194
|
+
{
|
|
2195
|
+
return std::make_shared<facebook::react::NativeAppLovinMAXModuleSpecJSI>(params);
|
|
2196
|
+
}
|
|
2197
|
+
#endif
|
|
2198
|
+
|
|
2185
2199
|
@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;
|