react-native-applovin-max 8.1.1 → 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 +14 -3
- 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 +17 -15
- package/android/src/main/java/com/applovin/reactnative/{AppLovinMAXModule.java → AppLovinMAXModuleImpl.java} +115 -179
- 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 -8
- package/ios/{AppLovinMAX.m → AppLovinMAX.mm} +73 -64
- 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 +67 -85
- package/lib/commonjs/AdView.js.map +1 -1
- package/lib/commonjs/AppLovinMAX.js +51 -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 +57 -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/commonjs/types/AdInfo.js +10 -3
- package/lib/commonjs/types/AdInfo.js.map +1 -1
- package/lib/module/AdView.js +62 -81
- package/lib/module/AdView.js.map +1 -1
- package/lib/module/AppLovinMAX.js +47 -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 +55 -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/module/types/AdInfo.js +10 -4
- package/lib/module/types/AdInfo.js.map +1 -1
- package/lib/typescript/src/AdView.d.ts +16 -16
- 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 +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/AdEvent.d.ts +2 -2
- package/lib/typescript/src/types/AdEvent.d.ts.map +1 -1
- package/lib/typescript/src/types/AdInfo.d.ts +24 -25
- package/lib/typescript/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/src/types/AdProps.d.ts +4 -4
- package/lib/typescript/src/types/AdProps.d.ts.map +1 -1
- package/lib/typescript/src/types/FullscreenAd.d.ts +4 -4
- package/lib/typescript/src/types/FullscreenAd.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/lib/typescript/src/types/ViewAd.d.ts +4 -4
- 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 +56 -121
- package/src/AppLovinMAX.ts +7 -8
- package/src/AppOpenAd.ts +3 -5
- package/src/BannerAd.ts +3 -5
- package/src/ErrorCode.ts +1 -3
- package/src/EventEmitter.ts +2 -3
- package/src/InterstitialAd.ts +4 -6
- package/src/MRecAd.ts +3 -5
- package/src/Privacy.ts +1 -3
- package/src/RewardedAd.ts +4 -6
- 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/AdEvent.ts +2 -2
- package/src/types/AdInfo.ts +28 -28
- package/src/types/AdProps.ts +4 -4
- package/src/types/FullscreenAd.ts +4 -4
- package/src/types/NativeAd.ts +5 -0
- package/src/types/ViewAd.ts +4 -4
- 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 -323
- 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;
|
|
@@ -59,11 +64,6 @@ extern NSString *const ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT;
|
|
|
59
64
|
*/
|
|
60
65
|
- (NSDictionary<NSString *, id> *)adDisplayFailedInfoForAd:(MAAd *)ad withError:(MAError *)error;
|
|
61
66
|
|
|
62
|
-
/**
|
|
63
|
-
* Returns a dictionay value of adRevenuInfo for the specified ad.
|
|
64
|
-
*/
|
|
65
|
-
- (NSDictionary<NSString *, id> *)adRevenueInfoForAd:(MAAd *)ad;
|
|
66
|
-
|
|
67
67
|
@end
|
|
68
68
|
|
|
69
69
|
NS_ASSUME_NONNULL_END
|
|
@@ -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,8 @@ RCT_EXPORT_MODULE()
|
|
|
149
149
|
[super initialize];
|
|
150
150
|
|
|
151
151
|
ALCompatibleNativeSDKVersions = @{
|
|
152
|
+
@"9.0.0" : @"13.0.1",
|
|
153
|
+
@"8.2.0" : @"13.0.1",
|
|
152
154
|
@"8.1.1" : @"13.0.1",
|
|
153
155
|
@"8.1.0" : @"13.0.1",
|
|
154
156
|
@"8.0.5" : @"13.0.1",
|
|
@@ -220,12 +222,12 @@ RCT_EXPORT_MODULE()
|
|
|
220
222
|
return self;
|
|
221
223
|
}
|
|
222
224
|
|
|
223
|
-
RCT_EXPORT_METHOD(isInitialized:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
225
|
+
RCT_EXPORT_METHOD(isInitialized:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
224
226
|
{
|
|
225
227
|
resolve(@([self isPluginInitialized] && [self isSDKInitialized]));
|
|
226
228
|
}
|
|
227
229
|
|
|
228
|
-
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)
|
|
229
231
|
{
|
|
230
232
|
// Guard against running init logic multiple times
|
|
231
233
|
if ( [self isPluginInitialized] )
|
|
@@ -290,7 +292,7 @@ RCT_EXPORT_METHOD(initialize:(NSString *)pluginVersion :(NSString *)sdkKey :(RCT
|
|
|
290
292
|
|
|
291
293
|
#pragma mark - General Public API
|
|
292
294
|
|
|
293
|
-
RCT_EXPORT_METHOD(isTablet:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
295
|
+
RCT_EXPORT_METHOD(isTablet:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
294
296
|
{
|
|
295
297
|
resolve(@([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad));
|
|
296
298
|
}
|
|
@@ -311,7 +313,7 @@ RCT_EXPORT_METHOD(setHasUserConsent:(BOOL)hasUserConsent)
|
|
|
311
313
|
[ALPrivacySettings setHasUserConsent: hasUserConsent];
|
|
312
314
|
}
|
|
313
315
|
|
|
314
|
-
RCT_EXPORT_METHOD(hasUserConsent:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
316
|
+
RCT_EXPORT_METHOD(hasUserConsent:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
315
317
|
{
|
|
316
318
|
resolve(@([ALPrivacySettings hasUserConsent]));
|
|
317
319
|
}
|
|
@@ -321,7 +323,7 @@ RCT_EXPORT_METHOD(setDoNotSell:(BOOL)doNotSell)
|
|
|
321
323
|
[ALPrivacySettings setDoNotSell: doNotSell];
|
|
322
324
|
}
|
|
323
325
|
|
|
324
|
-
RCT_EXPORT_METHOD(isDoNotSell:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
326
|
+
RCT_EXPORT_METHOD(isDoNotSell:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
325
327
|
{
|
|
326
328
|
resolve(@([ALPrivacySettings isDoNotSell]));
|
|
327
329
|
}
|
|
@@ -336,7 +338,7 @@ RCT_EXPORT_METHOD(setMuted:(BOOL)muted)
|
|
|
336
338
|
self.sdk.settings.muted = muted;
|
|
337
339
|
}
|
|
338
340
|
|
|
339
|
-
RCT_EXPORT_METHOD(isMuted:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
341
|
+
RCT_EXPORT_METHOD(isMuted:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
340
342
|
{
|
|
341
343
|
resolve(@(self.sdk.settings.muted));
|
|
342
344
|
}
|
|
@@ -356,7 +358,7 @@ RCT_EXPORT_METHOD(setCreativeDebuggerEnabled:(BOOL)enabled)
|
|
|
356
358
|
self.sdk.settings.creativeDebuggerEnabled = enabled;
|
|
357
359
|
}
|
|
358
360
|
|
|
359
|
-
RCT_EXPORT_METHOD(setExtraParameter:(NSString *)key :(nullable NSString *)value)
|
|
361
|
+
RCT_EXPORT_METHOD(setExtraParameter:(NSString *)key value:(nullable NSString *)value)
|
|
360
362
|
{
|
|
361
363
|
if ( ![key al_isValidString] )
|
|
362
364
|
{
|
|
@@ -396,7 +398,7 @@ RCT_EXPORT_METHOD(setConsentFlowDebugUserGeography:(NSString *)userGeography)
|
|
|
396
398
|
self.sdk.settings.termsAndPrivacyPolicyFlowSettings.debugUserGeography = [self toAppLovinConsentFlowUserGeography: userGeography];
|
|
397
399
|
}
|
|
398
400
|
|
|
399
|
-
RCT_EXPORT_METHOD(showCmpForExistingUser:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
401
|
+
RCT_EXPORT_METHOD(showCmpForExistingUser:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
400
402
|
{
|
|
401
403
|
if ( ![self isPluginInitialized] )
|
|
402
404
|
{
|
|
@@ -419,7 +421,7 @@ RCT_EXPORT_METHOD(showCmpForExistingUser:(RCTPromiseResolveBlock)resolve :(RCTPr
|
|
|
419
421
|
}];
|
|
420
422
|
}
|
|
421
423
|
|
|
422
|
-
RCT_EXPORT_METHOD(hasSupportedCmp:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
424
|
+
RCT_EXPORT_METHOD(hasSupportedCmp:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
423
425
|
{
|
|
424
426
|
if ( ![self isPluginInitialized] )
|
|
425
427
|
{
|
|
@@ -432,7 +434,7 @@ RCT_EXPORT_METHOD(hasSupportedCmp:(RCTPromiseResolveBlock)resolve :(RCTPromiseRe
|
|
|
432
434
|
|
|
433
435
|
#pragma mark - Segment Targeting
|
|
434
436
|
|
|
435
|
-
RCT_EXPORT_METHOD(addSegment:(
|
|
437
|
+
RCT_EXPORT_METHOD(addSegment:(double)key values:(NSArray *)values resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
436
438
|
{
|
|
437
439
|
if ( [self isPluginInitialized] )
|
|
438
440
|
{
|
|
@@ -440,12 +442,12 @@ RCT_EXPORT_METHOD(addSegment:(nonnull NSNumber *)key :(NSArray<NSNumber *> *)val
|
|
|
440
442
|
return;
|
|
441
443
|
}
|
|
442
444
|
|
|
443
|
-
[self.segmentCollectionBuilder addSegment: [[MASegment alloc] initWithKey: key values: values]];
|
|
445
|
+
[self.segmentCollectionBuilder addSegment: [[MASegment alloc] initWithKey: @(key) values: values]];
|
|
444
446
|
|
|
445
447
|
resolve(nil);
|
|
446
448
|
}
|
|
447
449
|
|
|
448
|
-
RCT_EXPORT_METHOD(getSegments:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
450
|
+
RCT_EXPORT_METHOD(getSegments:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
449
451
|
{
|
|
450
452
|
if ( ![self isSDKInitialized] )
|
|
451
453
|
{
|
|
@@ -482,7 +484,7 @@ RCT_EXPORT_METHOD(trackEvent:(NSString *)event :(NSDictionary<NSString *, id> *)
|
|
|
482
484
|
|
|
483
485
|
#pragma mark - Banners
|
|
484
486
|
|
|
485
|
-
RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier :(NSString *)bannerPosition)
|
|
487
|
+
RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition)
|
|
486
488
|
{
|
|
487
489
|
if ( !self.sdk )
|
|
488
490
|
{
|
|
@@ -494,7 +496,7 @@ RCT_EXPORT_METHOD(createBanner:(NSString *)adUnitIdentifier :(NSString *)bannerP
|
|
|
494
496
|
}
|
|
495
497
|
|
|
496
498
|
// NOTE: No function overloading in JS so we need new method signature
|
|
497
|
-
RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier :(NSString *)bannerPosition :(
|
|
499
|
+
RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition xOffset:(double)xOffset yOffset:(double)yOffset)
|
|
498
500
|
{
|
|
499
501
|
if ( !self.sdk )
|
|
500
502
|
{
|
|
@@ -505,7 +507,7 @@ RCT_EXPORT_METHOD(createBannerWithOffsets:(NSString *)adUnitIdentifier :(NSStrin
|
|
|
505
507
|
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT atPosition: bannerPosition withOffset: CGPointMake(xOffset, yOffset)];
|
|
506
508
|
}
|
|
507
509
|
|
|
508
|
-
RCT_EXPORT_METHOD(setBannerBackgroundColor:(NSString *)adUnitIdentifier :(NSString *)hexColorCode)
|
|
510
|
+
RCT_EXPORT_METHOD(setBannerBackgroundColor:(NSString *)adUnitIdentifier hexColorCode:(NSString *)hexColorCode)
|
|
509
511
|
{
|
|
510
512
|
if ( !self.sdk )
|
|
511
513
|
{
|
|
@@ -516,7 +518,7 @@ RCT_EXPORT_METHOD(setBannerBackgroundColor:(NSString *)adUnitIdentifier :(NSStri
|
|
|
516
518
|
[self setAdViewBackgroundColorForAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT hexColorCode: hexColorCode];
|
|
517
519
|
}
|
|
518
520
|
|
|
519
|
-
RCT_EXPORT_METHOD(setBannerPlacement:(NSString *)adUnitIdentifier :(nullable NSString *)placement)
|
|
521
|
+
RCT_EXPORT_METHOD(setBannerPlacement:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement)
|
|
520
522
|
{
|
|
521
523
|
if ( !self.sdk )
|
|
522
524
|
{
|
|
@@ -527,7 +529,7 @@ RCT_EXPORT_METHOD(setBannerPlacement:(NSString *)adUnitIdentifier :(nullable NSS
|
|
|
527
529
|
[self setAdViewPlacement: placement forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
528
530
|
}
|
|
529
531
|
|
|
530
|
-
RCT_EXPORT_METHOD(setBannerCustomData:(NSString *)adUnitIdentifier :(nullable NSString *)customData)
|
|
532
|
+
RCT_EXPORT_METHOD(setBannerCustomData:(NSString *)adUnitIdentifier customData:(nullable NSString *)customData)
|
|
531
533
|
{
|
|
532
534
|
if ( !self.sdk )
|
|
533
535
|
{
|
|
@@ -538,7 +540,7 @@ RCT_EXPORT_METHOD(setBannerCustomData:(NSString *)adUnitIdentifier :(nullable NS
|
|
|
538
540
|
[self setAdViewCustomData: customData forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
539
541
|
}
|
|
540
542
|
|
|
541
|
-
RCT_EXPORT_METHOD(updateBannerPosition:(NSString *)adUnitIdentifier :(NSString *)bannerPosition)
|
|
543
|
+
RCT_EXPORT_METHOD(updateBannerPosition:(NSString *)adUnitIdentifier position:(NSString *)bannerPosition)
|
|
542
544
|
{
|
|
543
545
|
if ( !self.sdk )
|
|
544
546
|
{
|
|
@@ -549,7 +551,7 @@ RCT_EXPORT_METHOD(updateBannerPosition:(NSString *)adUnitIdentifier :(NSString *
|
|
|
549
551
|
[self updateAdViewPosition: bannerPosition withOffset: CGPointZero forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
550
552
|
}
|
|
551
553
|
|
|
552
|
-
RCT_EXPORT_METHOD(updateBannerOffsets:(NSString *)adUnitIdentifier :(
|
|
554
|
+
RCT_EXPORT_METHOD(updateBannerOffsets:(NSString *)adUnitIdentifier xOffset:(double)xOffset yOffset:(double)yOffset)
|
|
553
555
|
{
|
|
554
556
|
if ( !self.sdk )
|
|
555
557
|
{
|
|
@@ -560,7 +562,7 @@ RCT_EXPORT_METHOD(updateBannerOffsets:(NSString *)adUnitIdentifier :(CGFloat)xOf
|
|
|
560
562
|
[self updateAdViewPosition: self.adViewPositions[adUnitIdentifier] withOffset: CGPointMake(xOffset, yOffset) forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
561
563
|
}
|
|
562
564
|
|
|
563
|
-
RCT_EXPORT_METHOD(setBannerWidth:(NSString *)adUnitIdentifier :(
|
|
565
|
+
RCT_EXPORT_METHOD(setBannerWidth:(NSString *)adUnitIdentifier width:(double)width)
|
|
564
566
|
{
|
|
565
567
|
if ( !self.sdk )
|
|
566
568
|
{
|
|
@@ -571,7 +573,7 @@ RCT_EXPORT_METHOD(setBannerWidth:(NSString *)adUnitIdentifier :(CGFloat)width)
|
|
|
571
573
|
[self setAdViewWidth: width forAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
572
574
|
}
|
|
573
575
|
|
|
574
|
-
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)
|
|
575
577
|
{
|
|
576
578
|
if ( !self.sdk )
|
|
577
579
|
{
|
|
@@ -583,7 +585,7 @@ RCT_EXPORT_METHOD(setBannerExtraParameter:(NSString *)adUnitIdentifier :(NSStrin
|
|
|
583
585
|
}
|
|
584
586
|
|
|
585
587
|
// NOTE: Even though iOS is ok with `id` generic types, Android is not - so we wrap it via JSON/ReadableMap
|
|
586
|
-
RCT_EXPORT_METHOD(setBannerLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
|
|
588
|
+
RCT_EXPORT_METHOD(setBannerLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
587
589
|
{
|
|
588
590
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
589
591
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -646,14 +648,14 @@ RCT_EXPORT_METHOD(destroyBanner:(NSString *)adUnitIdentifier)
|
|
|
646
648
|
[self destroyAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: DEVICE_SPECIFIC_ADVIEW_AD_FORMAT];
|
|
647
649
|
}
|
|
648
650
|
|
|
649
|
-
RCT_EXPORT_METHOD(getAdaptiveBannerHeightForWidth:(
|
|
651
|
+
RCT_EXPORT_METHOD(getAdaptiveBannerHeightForWidth:(double)width resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
650
652
|
{
|
|
651
653
|
resolve(@([DEVICE_SPECIFIC_ADVIEW_AD_FORMAT adaptiveSizeForWidth: width].height));
|
|
652
654
|
}
|
|
653
655
|
|
|
654
656
|
#pragma mark - MRECs
|
|
655
657
|
|
|
656
|
-
RCT_EXPORT_METHOD(createMRec:(NSString *)adUnitIdentifier :(NSString *)mrecPosition)
|
|
658
|
+
RCT_EXPORT_METHOD(createMRec:(NSString *)adUnitIdentifier position:(NSString *)mrecPosition)
|
|
657
659
|
{
|
|
658
660
|
if ( !self.sdk )
|
|
659
661
|
{
|
|
@@ -664,7 +666,7 @@ RCT_EXPORT_METHOD(createMRec:(NSString *)adUnitIdentifier :(NSString *)mrecPosit
|
|
|
664
666
|
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec atPosition: mrecPosition withOffset: CGPointZero];
|
|
665
667
|
}
|
|
666
668
|
|
|
667
|
-
RCT_EXPORT_METHOD(setMRecPlacement:(NSString *)adUnitIdentifier :(nullable NSString *)placement)
|
|
669
|
+
RCT_EXPORT_METHOD(setMRecPlacement:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement)
|
|
668
670
|
{
|
|
669
671
|
if ( !self.sdk )
|
|
670
672
|
{
|
|
@@ -675,7 +677,7 @@ RCT_EXPORT_METHOD(setMRecPlacement:(NSString *)adUnitIdentifier :(nullable NSStr
|
|
|
675
677
|
[self setAdViewPlacement: placement forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
|
676
678
|
}
|
|
677
679
|
|
|
678
|
-
RCT_EXPORT_METHOD(setMRecCustomData:(NSString *)adUnitIdentifier :(nullable NSString *)customData)
|
|
680
|
+
RCT_EXPORT_METHOD(setMRecCustomData:(NSString *)adUnitIdentifier customData:(nullable NSString *)customData)
|
|
679
681
|
{
|
|
680
682
|
if ( !self.sdk )
|
|
681
683
|
{
|
|
@@ -686,7 +688,7 @@ RCT_EXPORT_METHOD(setMRecCustomData:(NSString *)adUnitIdentifier :(nullable NSSt
|
|
|
686
688
|
[self setAdViewCustomData: customData forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
|
687
689
|
}
|
|
688
690
|
|
|
689
|
-
RCT_EXPORT_METHOD(updateMRecPosition:(NSString *)
|
|
691
|
+
RCT_EXPORT_METHOD(updateMRecPosition:(NSString *)adUnitIdentifier position:(NSString *)mrecPosition)
|
|
690
692
|
{
|
|
691
693
|
if ( !self.sdk )
|
|
692
694
|
{
|
|
@@ -697,13 +699,13 @@ RCT_EXPORT_METHOD(updateMRecPosition:(NSString *)mrecPosition :(NSString *)adUni
|
|
|
697
699
|
[self updateAdViewPosition: mrecPosition withOffset: CGPointZero forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
|
698
700
|
}
|
|
699
701
|
|
|
700
|
-
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)
|
|
701
703
|
{
|
|
702
704
|
[self setAdViewExtraParameterForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec key: key value: value];
|
|
703
705
|
}
|
|
704
706
|
|
|
705
707
|
// NOTE: Even though iOS is ok with `id` generic types, Android is not - so we wrap it via JSON/ReadableMap
|
|
706
|
-
RCT_EXPORT_METHOD(setMRecLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
|
|
708
|
+
RCT_EXPORT_METHOD(setMRecLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
707
709
|
{
|
|
708
710
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
709
711
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -780,7 +782,7 @@ RCT_EXPORT_METHOD(loadInterstitial:(NSString *)adUnitIdentifier)
|
|
|
780
782
|
[interstitial loadAd];
|
|
781
783
|
}
|
|
782
784
|
|
|
783
|
-
RCT_EXPORT_METHOD(isInterstitialReady:(NSString *)adUnitIdentifier :(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
785
|
+
RCT_EXPORT_METHOD(isInterstitialReady:(NSString *)adUnitIdentifier resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
784
786
|
{
|
|
785
787
|
if ( !self.sdk )
|
|
786
788
|
{
|
|
@@ -793,7 +795,7 @@ RCT_EXPORT_METHOD(isInterstitialReady:(NSString *)adUnitIdentifier :(RCTPromiseR
|
|
|
793
795
|
resolve(@([interstitial isReady]));
|
|
794
796
|
}
|
|
795
797
|
|
|
796
|
-
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)
|
|
797
799
|
{
|
|
798
800
|
if ( !self.sdk )
|
|
799
801
|
{
|
|
@@ -805,7 +807,7 @@ RCT_EXPORT_METHOD(showInterstitial:(NSString *)adUnitIdentifier :(nullable NSStr
|
|
|
805
807
|
[interstitial showAdForPlacement: placement customData: customData];
|
|
806
808
|
}
|
|
807
809
|
|
|
808
|
-
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)
|
|
809
811
|
{
|
|
810
812
|
if ( !self.sdk )
|
|
811
813
|
{
|
|
@@ -818,7 +820,7 @@ RCT_EXPORT_METHOD(setInterstitialExtraParameter:(NSString *)adUnitIdentifier :(N
|
|
|
818
820
|
}
|
|
819
821
|
|
|
820
822
|
// NOTE: Even though iOS is ok with `id` generic types, Android is not - so we wrap it via JSON/ReadableMap
|
|
821
|
-
RCT_EXPORT_METHOD(setInterstitialLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
|
|
823
|
+
RCT_EXPORT_METHOD(setInterstitialLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
822
824
|
{
|
|
823
825
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
824
826
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -841,7 +843,7 @@ RCT_EXPORT_METHOD(loadRewardedAd:(NSString *)adUnitIdentifier)
|
|
|
841
843
|
[rewardedAd loadAd];
|
|
842
844
|
}
|
|
843
845
|
|
|
844
|
-
RCT_EXPORT_METHOD(isRewardedAdReady:(NSString *)adUnitIdentifier :(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
846
|
+
RCT_EXPORT_METHOD(isRewardedAdReady:(NSString *)adUnitIdentifier resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
845
847
|
{
|
|
846
848
|
if ( !self.sdk )
|
|
847
849
|
{
|
|
@@ -854,7 +856,7 @@ RCT_EXPORT_METHOD(isRewardedAdReady:(NSString *)adUnitIdentifier :(RCTPromiseRes
|
|
|
854
856
|
resolve(@([rewardedAd isReady]));
|
|
855
857
|
}
|
|
856
858
|
|
|
857
|
-
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)
|
|
858
860
|
{
|
|
859
861
|
if ( !self.sdk )
|
|
860
862
|
{
|
|
@@ -866,7 +868,7 @@ RCT_EXPORT_METHOD(showRewardedAd:(NSString *)adUnitIdentifier :(nullable NSStrin
|
|
|
866
868
|
[rewardedAd showAdForPlacement: placement customData: customData];
|
|
867
869
|
}
|
|
868
870
|
|
|
869
|
-
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)
|
|
870
872
|
{
|
|
871
873
|
if ( !self.sdk )
|
|
872
874
|
{
|
|
@@ -879,7 +881,7 @@ RCT_EXPORT_METHOD(setRewardedAdExtraParameter:(NSString *)adUnitIdentifier :(NSS
|
|
|
879
881
|
}
|
|
880
882
|
|
|
881
883
|
// NOTE: Even though iOS is ok with `id` generic types, Android is not - so we wrap it via JSON/ReadableMap
|
|
882
|
-
RCT_EXPORT_METHOD(setRewardedAdLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
|
|
884
|
+
RCT_EXPORT_METHOD(setRewardedAdLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
883
885
|
{
|
|
884
886
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
885
887
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -902,7 +904,7 @@ RCT_EXPORT_METHOD(loadAppOpenAd:(NSString *)adUnitIdentifier)
|
|
|
902
904
|
[appOpenAd loadAd];
|
|
903
905
|
}
|
|
904
906
|
|
|
905
|
-
RCT_EXPORT_METHOD(isAppOpenAdReady:(NSString *)adUnitIdentifier :(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject)
|
|
907
|
+
RCT_EXPORT_METHOD(isAppOpenAdReady:(NSString *)adUnitIdentifier resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
906
908
|
{
|
|
907
909
|
if ( !self.sdk )
|
|
908
910
|
{
|
|
@@ -940,7 +942,7 @@ RCT_EXPORT_METHOD(setAppOpenAdExtraParameter:(NSString *)adUnitIdentifier key:(N
|
|
|
940
942
|
}
|
|
941
943
|
|
|
942
944
|
// NOTE: Even though iOS is ok with `id` generic types, Android is not - so we wrap it via JSON/ReadableMap
|
|
943
|
-
RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier :(NSDictionary<NSString *, id> *)parameterDict)
|
|
945
|
+
RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier parameters:(NSDictionary<NSString *, id> *)parameterDict)
|
|
944
946
|
{
|
|
945
947
|
NSString *key = parameterDict.allKeys.firstObject;
|
|
946
948
|
id value = parameterDict.allValues.firstObject != [NSNull null] ? parameterDict.allValues.firstObject : nil;
|
|
@@ -952,21 +954,21 @@ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier :
|
|
|
952
954
|
#pragma mark - AdView Preloading
|
|
953
955
|
|
|
954
956
|
RCT_EXPORT_METHOD(preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
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)
|
|
962
964
|
{
|
|
963
965
|
MAAdFormat *adFormat;
|
|
964
966
|
|
|
965
|
-
if ( [
|
|
967
|
+
if ( [@"BANNER" al_isEqualToStringIgnoringCase: adFormatStr] )
|
|
966
968
|
{
|
|
967
969
|
adFormat = DEVICE_SPECIFIC_ADVIEW_AD_FORMAT;
|
|
968
970
|
}
|
|
969
|
-
else if ( [
|
|
971
|
+
else if ( [@"MREC" al_isEqualToStringIgnoringCase: adFormatStr] )
|
|
970
972
|
{
|
|
971
973
|
adFormat = MAAdFormat.mrec;
|
|
972
974
|
}
|
|
@@ -986,11 +988,11 @@ RCT_EXPORT_METHOD(preloadNativeUIComponentAdView:(NSString *)adUnitIdentifier
|
|
|
986
988
|
withPromiseRejecter: reject];
|
|
987
989
|
}
|
|
988
990
|
|
|
989
|
-
RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(
|
|
990
|
-
|
|
991
|
-
|
|
991
|
+
RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(double)adViewId
|
|
992
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
993
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
992
994
|
{
|
|
993
|
-
[AppLovinMAXAdView destroyNativeUIComponentAdView: adViewId
|
|
995
|
+
[AppLovinMAXAdView destroyNativeUIComponentAdView: @(adViewId)
|
|
994
996
|
withPromiseResolver: resolve
|
|
995
997
|
withPromiseRejecter: reject];
|
|
996
998
|
}
|
|
@@ -1230,7 +1232,7 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(nonnull NSNumber *)adViewId
|
|
|
1230
1232
|
return;
|
|
1231
1233
|
}
|
|
1232
1234
|
|
|
1233
|
-
[self sendReactNativeEventWithName: name body: [self
|
|
1235
|
+
[self sendReactNativeEventWithName: name body: [self adInfoForAd: ad]];
|
|
1234
1236
|
}
|
|
1235
1237
|
|
|
1236
1238
|
- (void)didCompleteRewardedVideoForAd:(MAAd *)ad
|
|
@@ -1856,11 +1858,15 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(nonnull NSNumber *)adViewId
|
|
|
1856
1858
|
- (NSDictionary<NSString *, id> *)adInfoForAd:(MAAd *)ad
|
|
1857
1859
|
{
|
|
1858
1860
|
return @{@"adUnitId" : ad.adUnitIdentifier,
|
|
1859
|
-
@"
|
|
1861
|
+
@"adFormat" : ad.format.label,
|
|
1860
1862
|
@"networkName" : ad.networkName,
|
|
1863
|
+
@"networkPlacement" : ad.networkPlacement,
|
|
1864
|
+
@"creativeId" : ad.creativeIdentifier ?: @"",
|
|
1861
1865
|
@"placement" : ad.placement ?: @"",
|
|
1862
1866
|
@"revenue" : @(ad.revenue),
|
|
1867
|
+
@"revenuePrecision" : ad.revenuePrecision,
|
|
1863
1868
|
@"waterfall": [self createAdWaterfallInfo: ad.waterfall],
|
|
1869
|
+
@"latencyMillis" : @(ad.requestLatency * 1000),
|
|
1864
1870
|
@"dspName" : ad.DSPName ?: @"",
|
|
1865
1871
|
@"size" : @{@"width" : @(ad.size.width),
|
|
1866
1872
|
@"height" : @(ad.size.height)}
|
|
@@ -1892,15 +1898,6 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(nonnull NSNumber *)adViewId
|
|
|
1892
1898
|
return body;
|
|
1893
1899
|
}
|
|
1894
1900
|
|
|
1895
|
-
- (NSDictionary<NSString *, id> *)adRevenueInfoForAd:(MAAd *)ad
|
|
1896
|
-
{
|
|
1897
|
-
NSMutableDictionary *body = [self adInfoForAd: ad].mutableCopy;
|
|
1898
|
-
body[@"networkPlacement"] = ad.networkPlacement;
|
|
1899
|
-
body[@"revenuePrecision"] = ad.revenuePrecision;
|
|
1900
|
-
body[@"countryCode"] = self.sdk.configuration.countryCode;
|
|
1901
|
-
return body;
|
|
1902
|
-
}
|
|
1903
|
-
|
|
1904
1901
|
#pragma mark - Waterfall Information
|
|
1905
1902
|
|
|
1906
1903
|
- (NSDictionary<NSString *, id> *)createAdWaterfallInfo:(MAAdWaterfallInfo *)waterfallInfo
|
|
@@ -2176,6 +2173,11 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(nonnull NSNumber *)adViewId
|
|
|
2176
2173
|
@"MAX_ERROR_CODE_DONT_KEEP_ACTIVITIES_ENABLED" : @(-5602)};
|
|
2177
2174
|
}
|
|
2178
2175
|
|
|
2176
|
+
- (NSDictionary *)getConstants
|
|
2177
|
+
{
|
|
2178
|
+
return [self constantsToExport];
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2179
2181
|
- (void)startObserving
|
|
2180
2182
|
{
|
|
2181
2183
|
self.hasListeners = YES;
|
|
@@ -2186,4 +2188,11 @@ RCT_EXPORT_METHOD(destroyNativeUIComponentAdView:(nonnull NSNumber *)adViewId
|
|
|
2186
2188
|
self.hasListeners = NO;
|
|
2187
2189
|
}
|
|
2188
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
|
+
|
|
2189
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;
|