react-native-daro 1.0.15 → 1.0.16
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 +11 -1
- package/android/src/main/java/com/daro/reactnative/DaroMAdBannerViewManager.kt +34 -11
- package/android/src/main/java/com/daro/reactnative/DaroMAdNativeViewManager.kt +79 -48
- package/android/src/main/java/com/daro/reactnative/DaroMModule.kt +80 -25
- package/android/src/main/java/com/daro/reactnative/DaroMPackage.kt +28 -4
- package/android/src/main/java/com/daro/reactnative/DaroMediaViewManager.kt +25 -0
- package/android/src/main/java/com/daro/reactnative/event/DaroMEvent.kt +18 -7
- package/android/src/main/java/com/daro/reactnative/util/EventEmitterUtil.kt +18 -5
- package/android/src/main/java/com/daro/reactnative/view/DaroMAdNativeViewContainer.kt +301 -52
- package/android/src/main/java/com/daro/reactnative/view/DaroMediaView.kt +123 -0
- package/android/src/newarch/java/com/daro/reactnative/DaroMModuleSpec.kt +6 -0
- package/android/src/oldarch/java/com/daro/reactnative/DaroMModuleSpec.kt +90 -0
- package/ios/DaroMModule+AppOpen.swift +13 -10
- package/ios/DaroMModule+Interstitial.swift +12 -9
- package/ios/DaroMModule+LightPopup.swift +16 -13
- package/ios/DaroMModule+Rewarded.swift +12 -9
- package/ios/DaroMModule.mm +45 -17
- package/ios/DaroMModule.swift +4 -4
- package/ios/Fabric/DaroMAdBannerComponentView.mm +207 -0
- package/ios/Fabric/DaroMFabricEventSink.mm +31 -0
- package/ios/Fabric/DaroMFabricPropApplier.mm +123 -0
- package/ios/Fabric/DaroMNativeAdComponentView.mm +294 -0
- package/ios/{DaroMAdBannerViewManager.m → Paper/DaroMAdBannerViewManager.m} +3 -1
- package/ios/Paper/DaroMAdBannerViewManager.swift +21 -0
- package/ios/{DaroMNativeAdViewManager.m → Paper/DaroMNativeAdViewManager.m} +2 -1
- package/ios/Paper/DaroMNativeAdViewManager.swift +22 -0
- package/ios/Shared/DaroMAdEventSink.swift +24 -0
- package/ios/Shared/DaroMBannerAdView.swift +188 -0
- package/ios/Shared/DaroMNativeAdLoadCoordinator.swift +49 -0
- package/ios/Shared/DaroMNativeAdView.swift +575 -0
- package/ios/Shared/DaroMNativeAssetResolver.swift +53 -0
- package/ios/mediation/admob/DaroMediationTypes.swift +1 -0
- package/lib/commonjs/AdBannerView.js +20 -39
- package/lib/commonjs/AdBannerView.js.map +1 -1
- package/lib/commonjs/AppOpenAd.js +43 -10
- package/lib/commonjs/AppOpenAd.js.map +1 -1
- package/lib/commonjs/DaroMAdBannerViewNativeComponent.ts +47 -0
- package/lib/commonjs/DaroMNativeAdViewNativeComponent.ts +62 -0
- package/lib/commonjs/DaroMediaViewNativeComponent.ts +9 -0
- package/lib/commonjs/EventEmitter.js +4 -5
- package/lib/commonjs/EventEmitter.js.map +1 -1
- package/lib/commonjs/InterstitialAd.js +9 -11
- package/lib/commonjs/InterstitialAd.js.map +1 -1
- package/lib/commonjs/LightPopupAd.js +11 -12
- package/lib/commonjs/LightPopupAd.js.map +1 -1
- package/lib/commonjs/NativeDaroModule.js +9 -0
- package/lib/commonjs/NativeDaroModule.js.map +1 -0
- package/lib/commonjs/RewardedAd.js +9 -11
- package/lib/commonjs/RewardedAd.js.map +1 -1
- package/lib/commonjs/codegen-env.d.js +2 -0
- package/lib/commonjs/codegen-env.d.js.map +1 -0
- package/lib/commonjs/hooks/useInterstitialAd.js +110 -0
- package/lib/commonjs/hooks/useInterstitialAd.js.map +1 -0
- package/lib/commonjs/hooks/useLightPopupAd.js +114 -0
- package/lib/commonjs/hooks/useLightPopupAd.js.map +1 -0
- package/lib/commonjs/hooks/useRewardedAd.js +113 -0
- package/lib/commonjs/hooks/useRewardedAd.js.map +1 -0
- package/lib/commonjs/index.js +29 -13
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdView.js +23 -22
- package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js +43 -31
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js +34 -7
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js.map +1 -1
- package/lib/module/AdBannerView.js +19 -40
- package/lib/module/AdBannerView.js.map +1 -1
- package/lib/module/AppOpenAd.js +43 -11
- package/lib/module/AppOpenAd.js.map +1 -1
- package/lib/module/DaroMAdBannerViewNativeComponent.ts +47 -0
- package/lib/module/DaroMNativeAdViewNativeComponent.ts +62 -0
- package/lib/module/DaroMediaViewNativeComponent.ts +9 -0
- package/lib/module/EventEmitter.js +4 -6
- package/lib/module/EventEmitter.js.map +1 -1
- package/lib/module/InterstitialAd.js +8 -11
- package/lib/module/InterstitialAd.js.map +1 -1
- package/lib/module/LightPopupAd.js +11 -13
- package/lib/module/LightPopupAd.js.map +1 -1
- package/lib/module/NativeDaroModule.js +5 -0
- package/lib/module/NativeDaroModule.js.map +1 -0
- package/lib/module/RewardedAd.js +8 -11
- package/lib/module/RewardedAd.js.map +1 -1
- package/lib/module/codegen-env.d.js +2 -0
- package/lib/module/codegen-env.d.js.map +1 -0
- package/lib/module/hooks/useInterstitialAd.js +106 -0
- package/lib/module/hooks/useInterstitialAd.js.map +1 -0
- package/lib/module/hooks/useLightPopupAd.js +110 -0
- package/lib/module/hooks/useLightPopupAd.js.map +1 -0
- package/lib/module/hooks/useRewardedAd.js +109 -0
- package/lib/module/hooks/useRewardedAd.js.map +1 -0
- package/lib/module/index.js +7 -13
- package/lib/module/index.js.map +1 -1
- package/lib/module/nativeAd/NativeAdView.js +22 -23
- package/lib/module/nativeAd/NativeAdView.js.map +1 -1
- package/lib/module/nativeAd/NativeAdViewComponents.js +45 -34
- package/lib/module/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/module/nativeAd/NativeAdViewProvider.js +35 -8
- package/lib/module/nativeAd/NativeAdViewProvider.js.map +1 -1
- package/lib/typescript/commonjs/plugin/src/index.d.ts +1 -1
- package/lib/typescript/commonjs/plugin/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +1 -1
- package/lib/typescript/commonjs/plugin/src/withIos.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/AdBannerView.d.ts +2 -2
- package/lib/typescript/commonjs/src/AdBannerView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/AppOpenAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/DaroMAdBannerViewNativeComponent.d.ts +32 -0
- package/lib/typescript/commonjs/src/DaroMAdBannerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/DaroMNativeAdViewNativeComponent.d.ts +42 -0
- package/lib/typescript/commonjs/src/DaroMNativeAdViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/DaroMediaViewNativeComponent.d.ts +6 -0
- package/lib/typescript/commonjs/src/DaroMediaViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/InterstitialAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/LightPopupAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/NativeDaroModule.d.ts +61 -0
- package/lib/typescript/commonjs/src/NativeDaroModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/RewardedAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useInterstitialAd.d.ts +19 -0
- package/lib/typescript/commonjs/src/hooks/useInterstitialAd.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts +23 -0
- package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useRewardedAd.d.ts +20 -0
- package/lib/typescript/commonjs/src/hooks/useRewardedAd.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +7 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/nativeAd/NativeAdView.d.ts +1 -0
- package/lib/typescript/commonjs/src/nativeAd/NativeAdView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/nativeAd/NativeAdViewProvider.d.ts +11 -5
- package/lib/typescript/commonjs/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/NativeAdViewProps.d.ts +2 -0
- package/lib/typescript/commonjs/src/types/NativeAdViewProps.d.ts.map +1 -1
- package/lib/typescript/module/plugin/src/index.d.ts +1 -1
- package/lib/typescript/module/plugin/src/index.d.ts.map +1 -1
- package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +1 -1
- package/lib/typescript/module/plugin/src/withIos.d.ts.map +1 -1
- package/lib/typescript/module/src/AdBannerView.d.ts +2 -2
- package/lib/typescript/module/src/AdBannerView.d.ts.map +1 -1
- package/lib/typescript/module/src/AppOpenAd.d.ts.map +1 -1
- package/lib/typescript/module/src/DaroMAdBannerViewNativeComponent.d.ts +32 -0
- package/lib/typescript/module/src/DaroMAdBannerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/DaroMNativeAdViewNativeComponent.d.ts +42 -0
- package/lib/typescript/module/src/DaroMNativeAdViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/DaroMediaViewNativeComponent.d.ts +6 -0
- package/lib/typescript/module/src/DaroMediaViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/module/src/InterstitialAd.d.ts.map +1 -1
- package/lib/typescript/module/src/LightPopupAd.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeDaroModule.d.ts +61 -0
- package/lib/typescript/module/src/NativeDaroModule.d.ts.map +1 -0
- package/lib/typescript/module/src/RewardedAd.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useInterstitialAd.d.ts +19 -0
- package/lib/typescript/module/src/hooks/useInterstitialAd.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts +23 -0
- package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useRewardedAd.d.ts +20 -0
- package/lib/typescript/module/src/hooks/useRewardedAd.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +7 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/nativeAd/NativeAdView.d.ts +1 -0
- package/lib/typescript/module/src/nativeAd/NativeAdView.d.ts.map +1 -1
- package/lib/typescript/module/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
- package/lib/typescript/module/src/nativeAd/NativeAdViewProvider.d.ts +11 -5
- package/lib/typescript/module/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
- package/lib/typescript/module/src/types/NativeAdViewProps.d.ts +2 -0
- package/lib/typescript/module/src/types/NativeAdViewProps.d.ts.map +1 -1
- package/package.json +12 -5
- package/plugin/build/index.d.ts +1 -1
- package/plugin/build/withAndroid.js +99 -17
- package/plugin/build/withIos.js +4 -5
- package/react-native-daro.podspec +3 -0
- package/src/AdBannerView.tsx +24 -61
- package/src/AppOpenAd.ts +46 -9
- package/src/DaroMAdBannerViewNativeComponent.ts +47 -0
- package/src/DaroMNativeAdViewNativeComponent.ts +62 -0
- package/src/DaroMediaViewNativeComponent.ts +9 -0
- package/src/EventEmitter.ts +4 -5
- package/src/InterstitialAd.ts +8 -10
- package/src/LightPopupAd.ts +11 -12
- package/src/NativeDaroModule.ts +91 -0
- package/src/RewardedAd.ts +8 -10
- package/src/codegen-env.d.ts +45 -0
- package/src/hooks/useInterstitialAd.ts +117 -0
- package/src/hooks/useLightPopupAd.ts +132 -0
- package/src/hooks/useRewardedAd.ts +122 -0
- package/src/index.tsx +21 -22
- package/src/nativeAd/NativeAdView.tsx +41 -54
- package/src/nativeAd/NativeAdViewComponents.tsx +80 -42
- package/src/nativeAd/NativeAdViewProvider.tsx +75 -17
- package/src/types/NativeAdViewProps.ts +7 -0
- package/ios/DaroMAdBannerViewManager.swift +0 -91
- package/ios/DaroMNativeAdViewManager.swift +0 -291
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#import <React/RCTDefines.h>
|
|
2
|
+
|
|
3
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4
|
+
|
|
5
|
+
#import <Foundation/Foundation.h>
|
|
6
|
+
#include <string>
|
|
7
|
+
|
|
8
|
+
NSDictionary *DaroMFabricEventBody(NSDictionary *body)
|
|
9
|
+
{
|
|
10
|
+
return [body isKindOfClass:NSDictionary.class] ? body : @{};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
std::string DaroMFabricEventString(NSDictionary *body, NSString *key)
|
|
14
|
+
{
|
|
15
|
+
id value = body[key];
|
|
16
|
+
return [value isKindOfClass:NSString.class] ? std::string([value UTF8String]) : "";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
double DaroMFabricEventDouble(NSDictionary *body, NSString *key)
|
|
20
|
+
{
|
|
21
|
+
id value = body[key];
|
|
22
|
+
return [value respondsToSelector:@selector(doubleValue)] ? [value doubleValue] : 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
int DaroMFabricEventInt(NSDictionary *body, NSString *key)
|
|
26
|
+
{
|
|
27
|
+
id value = body[key];
|
|
28
|
+
return [value respondsToSelector:@selector(intValue)] ? [value intValue] : 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#endif
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
#import <React/RCTDefines.h>
|
|
2
|
+
|
|
3
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4
|
+
|
|
5
|
+
#import <React/RCTLog.h>
|
|
6
|
+
#import <UIKit/UIKit.h>
|
|
7
|
+
#include <folly/dynamic.h>
|
|
8
|
+
#include <string>
|
|
9
|
+
|
|
10
|
+
static NSString *DaroMFabricSetterNameForKey(NSString *key)
|
|
11
|
+
{
|
|
12
|
+
if (key.length == 0) {
|
|
13
|
+
return nil;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
NSString *first = [[key substringToIndex:1] uppercaseString];
|
|
17
|
+
NSString *rest = [key substringFromIndex:1];
|
|
18
|
+
return [NSString stringWithFormat:@"set%@%@:", first, rest];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
void DaroMFabricSetValue(UIView *view, NSString *key, id value)
|
|
22
|
+
{
|
|
23
|
+
SEL setter = NSSelectorFromString(DaroMFabricSetterNameForKey(key));
|
|
24
|
+
if (![view respondsToSelector:setter]) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[view setValue:value forKey:key];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
void DaroMFabricPerformSelector(UIView *view, SEL selector)
|
|
32
|
+
{
|
|
33
|
+
if (![view respondsToSelector:selector]) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
IMP imp = [view methodForSelector:selector];
|
|
38
|
+
auto function = reinterpret_cast<void (*)(id, SEL)>(imp);
|
|
39
|
+
function(view, selector);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
void DaroMFabricPerformSelectorWithObject(UIView *view, SEL selector, id object)
|
|
43
|
+
{
|
|
44
|
+
if (![view respondsToSelector:selector]) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
IMP imp = [view methodForSelector:selector];
|
|
49
|
+
auto function = reinterpret_cast<void (*)(id, SEL, id)>(imp);
|
|
50
|
+
function(view, selector, object);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
void DaroMFabricPerformSelectorWithTwoObjects(UIView *view, SEL selector, id firstObject, id secondObject)
|
|
54
|
+
{
|
|
55
|
+
if (![view respondsToSelector:selector]) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
IMP imp = [view methodForSelector:selector];
|
|
60
|
+
auto function = reinterpret_cast<void (*)(id, SEL, id, id)>(imp);
|
|
61
|
+
function(view, selector, firstObject, secondObject);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
UIView *DaroMFabricCreateSwiftView(NSString *className)
|
|
65
|
+
{
|
|
66
|
+
Class viewClass = NSClassFromString(className);
|
|
67
|
+
if (![viewClass isSubclassOfClass:UIView.class]) {
|
|
68
|
+
RCTLogError(@"%@ is not available as a UIView subclass.", className);
|
|
69
|
+
return [UIView new];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return [[viewClass alloc] init];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
NSString *DaroMFabricNSStringFromStdString(const std::string &value)
|
|
76
|
+
{
|
|
77
|
+
return [NSString stringWithUTF8String:value.c_str()];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
static id DaroMFabricNSObjectFromDynamic(const folly::dynamic &value)
|
|
81
|
+
{
|
|
82
|
+
switch (value.type()) {
|
|
83
|
+
case folly::dynamic::NULLT:
|
|
84
|
+
return (id)kCFNull;
|
|
85
|
+
case folly::dynamic::BOOL:
|
|
86
|
+
return value.getBool() ? @YES : @NO;
|
|
87
|
+
case folly::dynamic::INT64:
|
|
88
|
+
return @(value.getInt());
|
|
89
|
+
case folly::dynamic::DOUBLE:
|
|
90
|
+
return @(value.getDouble());
|
|
91
|
+
case folly::dynamic::STRING:
|
|
92
|
+
return [[NSString alloc] initWithBytes:value.c_str() length:value.size() encoding:NSUTF8StringEncoding];
|
|
93
|
+
case folly::dynamic::ARRAY: {
|
|
94
|
+
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:value.size()];
|
|
95
|
+
for (const auto &item : value) {
|
|
96
|
+
id converted = DaroMFabricNSObjectFromDynamic(item);
|
|
97
|
+
if (converted != nil) {
|
|
98
|
+
[array addObject:converted];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return array;
|
|
102
|
+
}
|
|
103
|
+
case folly::dynamic::OBJECT: {
|
|
104
|
+
NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithCapacity:value.size()];
|
|
105
|
+
for (const auto &item : value.items()) {
|
|
106
|
+
id key = DaroMFabricNSObjectFromDynamic(item.first);
|
|
107
|
+
id converted = DaroMFabricNSObjectFromDynamic(item.second);
|
|
108
|
+
if (key != nil && converted != nil && [key conformsToProtocol:@protocol(NSCopying)]) {
|
|
109
|
+
dictionary[key] = converted;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return dictionary;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
id DaroMFabricIdFromDynamic(const folly::dynamic &value)
|
|
118
|
+
{
|
|
119
|
+
id converted = DaroMFabricNSObjectFromDynamic(value);
|
|
120
|
+
return converted == (id)kCFNull ? nil : converted;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
#endif
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
#import <React/RCTDefines.h>
|
|
2
|
+
|
|
3
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4
|
+
|
|
5
|
+
#import <React/RCTComponent.h>
|
|
6
|
+
#import <React/RCTFabricComponentsPlugins.h>
|
|
7
|
+
#import <React/RCTViewComponentView.h>
|
|
8
|
+
#import <react/renderer/components/DaroReactNativeSpec/ComponentDescriptors.h>
|
|
9
|
+
#import <react/renderer/components/DaroReactNativeSpec/EventEmitters.h>
|
|
10
|
+
#import <react/renderer/components/DaroReactNativeSpec/Props.h>
|
|
11
|
+
#import <react/renderer/components/DaroReactNativeSpec/RCTComponentViewHelpers.h>
|
|
12
|
+
#include <folly/dynamic.h>
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
using namespace facebook::react;
|
|
16
|
+
|
|
17
|
+
extern UIView *DaroMFabricCreateSwiftView(NSString *className);
|
|
18
|
+
extern void DaroMFabricSetValue(UIView *view, NSString *key, id value);
|
|
19
|
+
extern void DaroMFabricPerformSelector(UIView *view, SEL selector);
|
|
20
|
+
extern void DaroMFabricPerformSelectorWithObject(UIView *view, SEL selector, id object);
|
|
21
|
+
extern void DaroMFabricPerformSelectorWithTwoObjects(UIView *view, SEL selector, id firstObject, id secondObject);
|
|
22
|
+
extern NSString *DaroMFabricNSStringFromStdString(const std::string &value);
|
|
23
|
+
extern id DaroMFabricIdFromDynamic(const folly::dynamic &value);
|
|
24
|
+
extern NSDictionary *DaroMFabricEventBody(NSDictionary *body);
|
|
25
|
+
extern std::string DaroMFabricEventString(NSDictionary *body, NSString *key);
|
|
26
|
+
extern double DaroMFabricEventDouble(NSDictionary *body, NSString *key);
|
|
27
|
+
extern int DaroMFabricEventInt(NSDictionary *body, NSString *key);
|
|
28
|
+
|
|
29
|
+
static NSString *DaroMFabricAdChoicesPositionString(DaroMNativeAdViewAdChoicesPosition position)
|
|
30
|
+
{
|
|
31
|
+
switch (position) {
|
|
32
|
+
case DaroMNativeAdViewAdChoicesPosition::TopLeft:
|
|
33
|
+
return @"topLeft";
|
|
34
|
+
case DaroMNativeAdViewAdChoicesPosition::TopRight:
|
|
35
|
+
return @"topRight";
|
|
36
|
+
case DaroMNativeAdViewAdChoicesPosition::BottomLeft:
|
|
37
|
+
return @"bottomLeft";
|
|
38
|
+
case DaroMNativeAdViewAdChoicesPosition::BottomRight:
|
|
39
|
+
default:
|
|
40
|
+
return @"bottomRight";
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@interface DaroMNativeAdViewComponentView : RCTViewComponentView <RCTDaroMNativeAdViewViewProtocol>
|
|
45
|
+
@end
|
|
46
|
+
|
|
47
|
+
@implementation DaroMNativeAdViewComponentView {
|
|
48
|
+
UIView *_nativeAdView;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
+ (void)load
|
|
52
|
+
{
|
|
53
|
+
[super load];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
57
|
+
{
|
|
58
|
+
if (self = [super initWithFrame:frame]) {
|
|
59
|
+
static const auto defaultProps = std::make_shared<const DaroMNativeAdViewProps>();
|
|
60
|
+
_props = defaultProps;
|
|
61
|
+
[self createNativeAdView];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return self;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
- (void)createNativeAdView
|
|
68
|
+
{
|
|
69
|
+
_nativeAdView = DaroMFabricCreateSwiftView(@"RNDaroMNativeAdView");
|
|
70
|
+
_nativeAdView.frame = self.bounds;
|
|
71
|
+
_nativeAdView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
72
|
+
DaroMFabricPerformSelectorWithObject(_nativeAdView, NSSelectorFromString(@"setAssetSearchRootView:"), _nativeAdView);
|
|
73
|
+
[self addSubview:_nativeAdView];
|
|
74
|
+
[self installEventHandlers];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
- (void)installEventHandlers
|
|
78
|
+
{
|
|
79
|
+
__weak DaroMNativeAdViewComponentView *weakSelf = self;
|
|
80
|
+
|
|
81
|
+
RCTDirectEventBlock onAdLoadedEvent = ^(NSDictionary *body) {
|
|
82
|
+
DaroMNativeAdViewComponentView *strongSelf = weakSelf;
|
|
83
|
+
if (!strongSelf) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
auto eventEmitter = std::static_pointer_cast<const DaroMNativeAdViewEventEmitter>(strongSelf->_eventEmitter);
|
|
88
|
+
if (!eventEmitter) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
NSDictionary *eventBody = DaroMFabricEventBody(body);
|
|
93
|
+
eventEmitter->onAdLoadedEvent({
|
|
94
|
+
.adUnitId = DaroMFabricEventString(eventBody, @"adUnitId"),
|
|
95
|
+
.latencyMillis = DaroMFabricEventDouble(eventBody, @"latencyMillis"),
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
RCTDirectEventBlock onAdLoadFailedEvent = ^(NSDictionary *body) {
|
|
100
|
+
DaroMNativeAdViewComponentView *strongSelf = weakSelf;
|
|
101
|
+
if (!strongSelf) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
auto eventEmitter = std::static_pointer_cast<const DaroMNativeAdViewEventEmitter>(strongSelf->_eventEmitter);
|
|
106
|
+
if (!eventEmitter) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
NSDictionary *eventBody = DaroMFabricEventBody(body);
|
|
111
|
+
eventEmitter->onAdLoadFailedEvent({
|
|
112
|
+
.adUnitId = DaroMFabricEventString(eventBody, @"adUnitId"),
|
|
113
|
+
.code = DaroMFabricEventInt(eventBody, @"code"),
|
|
114
|
+
.message = DaroMFabricEventString(eventBody, @"message"),
|
|
115
|
+
.latencyMillis = DaroMFabricEventDouble(eventBody, @"latencyMillis"),
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
RCTDirectEventBlock onAdClickedEvent = ^(NSDictionary *body) {
|
|
120
|
+
DaroMNativeAdViewComponentView *strongSelf = weakSelf;
|
|
121
|
+
if (!strongSelf) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
auto eventEmitter = std::static_pointer_cast<const DaroMNativeAdViewEventEmitter>(strongSelf->_eventEmitter);
|
|
126
|
+
if (!eventEmitter) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
NSDictionary *eventBody = DaroMFabricEventBody(body);
|
|
131
|
+
eventEmitter->onAdClickedEvent({
|
|
132
|
+
.adUnitId = DaroMFabricEventString(eventBody, @"adUnitId"),
|
|
133
|
+
.latencyMillis = DaroMFabricEventDouble(eventBody, @"latencyMillis"),
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
RCTDirectEventBlock onAdImpressionRecordedEvent = ^(NSDictionary *body) {
|
|
138
|
+
DaroMNativeAdViewComponentView *strongSelf = weakSelf;
|
|
139
|
+
if (!strongSelf) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
auto eventEmitter = std::static_pointer_cast<const DaroMNativeAdViewEventEmitter>(strongSelf->_eventEmitter);
|
|
144
|
+
if (!eventEmitter) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
NSDictionary *eventBody = DaroMFabricEventBody(body);
|
|
149
|
+
eventEmitter->onAdImpressionRecordedEvent({
|
|
150
|
+
.adUnitId = DaroMFabricEventString(eventBody, @"adUnitId"),
|
|
151
|
+
.latencyMillis = DaroMFabricEventDouble(eventBody, @"latencyMillis"),
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
DaroMFabricSetValue(_nativeAdView, @"onAdLoadedEvent", onAdLoadedEvent);
|
|
156
|
+
DaroMFabricSetValue(_nativeAdView, @"onAdLoadFailedEvent", onAdLoadFailedEvent);
|
|
157
|
+
DaroMFabricSetValue(_nativeAdView, @"onAdClickedEvent", onAdClickedEvent);
|
|
158
|
+
DaroMFabricSetValue(_nativeAdView, @"onAdImpressionRecordedEvent", onAdImpressionRecordedEvent);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
162
|
+
{
|
|
163
|
+
return concreteComponentDescriptorProvider<DaroMNativeAdViewComponentDescriptor>();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
|
|
167
|
+
{
|
|
168
|
+
const auto &oldComponentProps = *std::static_pointer_cast<const DaroMNativeAdViewProps>(_props);
|
|
169
|
+
const auto &newComponentProps = *std::static_pointer_cast<const DaroMNativeAdViewProps>(props);
|
|
170
|
+
NSMutableArray<NSString *> *changedProps = [NSMutableArray new];
|
|
171
|
+
|
|
172
|
+
if (oldComponentProps.adUnitId != newComponentProps.adUnitId) {
|
|
173
|
+
DaroMFabricSetValue(_nativeAdView, @"adUnitId", DaroMFabricNSStringFromStdString(newComponentProps.adUnitId));
|
|
174
|
+
[changedProps addObject:@"adUnitId"];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (oldComponentProps.loadOnMount != newComponentProps.loadOnMount) {
|
|
178
|
+
DaroMFabricSetValue(_nativeAdView, @"loadOnMount", @(newComponentProps.loadOnMount));
|
|
179
|
+
[changedProps addObject:@"loadOnMount"];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (oldComponentProps.adChoicesPosition != newComponentProps.adChoicesPosition) {
|
|
183
|
+
DaroMFabricSetValue(
|
|
184
|
+
_nativeAdView, @"adChoicesPosition", DaroMFabricAdChoicesPositionString(newComponentProps.adChoicesPosition));
|
|
185
|
+
[changedProps addObject:@"adChoicesPosition"];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (oldComponentProps.titleView != newComponentProps.titleView) {
|
|
189
|
+
DaroMFabricSetValue(_nativeAdView, @"titleView", @(newComponentProps.titleView));
|
|
190
|
+
[changedProps addObject:@"titleView"];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (oldComponentProps.bodyView != newComponentProps.bodyView) {
|
|
194
|
+
DaroMFabricSetValue(_nativeAdView, @"bodyView", @(newComponentProps.bodyView));
|
|
195
|
+
[changedProps addObject:@"bodyView"];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (oldComponentProps.callToActionView != newComponentProps.callToActionView) {
|
|
199
|
+
DaroMFabricSetValue(_nativeAdView, @"callToActionView", @(newComponentProps.callToActionView));
|
|
200
|
+
[changedProps addObject:@"callToActionView"];
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (oldComponentProps.iconView != newComponentProps.iconView) {
|
|
204
|
+
DaroMFabricSetValue(_nativeAdView, @"iconView", @(newComponentProps.iconView));
|
|
205
|
+
[changedProps addObject:@"iconView"];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (oldComponentProps.mediaView != newComponentProps.mediaView) {
|
|
209
|
+
DaroMFabricSetValue(_nativeAdView, @"mediaView", @(newComponentProps.mediaView));
|
|
210
|
+
[changedProps addObject:@"mediaView"];
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (oldComponentProps.titleViewStyleProps != newComponentProps.titleViewStyleProps) {
|
|
214
|
+
DaroMFabricSetValue(_nativeAdView, @"titleViewStyleProps", DaroMFabricIdFromDynamic(newComponentProps.titleViewStyleProps));
|
|
215
|
+
[changedProps addObject:@"titleViewStyleProps"];
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (oldComponentProps.bodyViewStyleProps != newComponentProps.bodyViewStyleProps) {
|
|
219
|
+
DaroMFabricSetValue(_nativeAdView, @"bodyViewStyleProps", DaroMFabricIdFromDynamic(newComponentProps.bodyViewStyleProps));
|
|
220
|
+
[changedProps addObject:@"bodyViewStyleProps"];
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (oldComponentProps.callToActionViewStyleProps != newComponentProps.callToActionViewStyleProps) {
|
|
224
|
+
DaroMFabricSetValue(
|
|
225
|
+
_nativeAdView, @"callToActionViewStyleProps", DaroMFabricIdFromDynamic(newComponentProps.callToActionViewStyleProps));
|
|
226
|
+
[changedProps addObject:@"callToActionViewStyleProps"];
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (oldComponentProps.iconViewStyleProps != newComponentProps.iconViewStyleProps) {
|
|
230
|
+
DaroMFabricSetValue(_nativeAdView, @"iconViewStyleProps", DaroMFabricIdFromDynamic(newComponentProps.iconViewStyleProps));
|
|
231
|
+
[changedProps addObject:@"iconViewStyleProps"];
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (oldComponentProps.mediaViewStyleProps != newComponentProps.mediaViewStyleProps) {
|
|
235
|
+
DaroMFabricSetValue(_nativeAdView, @"mediaViewStyleProps", DaroMFabricIdFromDynamic(newComponentProps.mediaViewStyleProps));
|
|
236
|
+
[changedProps addObject:@"mediaViewStyleProps"];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
[super updateProps:props oldProps:oldProps];
|
|
240
|
+
|
|
241
|
+
DaroMFabricPerformSelectorWithObject(_nativeAdView, NSSelectorFromString(@"applyReactProps:"), changedProps);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
- (void)updateLayoutMetrics:(const LayoutMetrics &)layoutMetrics oldLayoutMetrics:(const LayoutMetrics &)oldLayoutMetrics
|
|
245
|
+
{
|
|
246
|
+
[super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics];
|
|
247
|
+
_nativeAdView.frame = self.bounds;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
251
|
+
{
|
|
252
|
+
DaroMFabricPerformSelectorWithTwoObjects(
|
|
253
|
+
_nativeAdView, NSSelectorFromString(@"insertMountedSubview:atIndex:"), childComponentView, @(index));
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
257
|
+
{
|
|
258
|
+
[childComponentView removeFromSuperview];
|
|
259
|
+
DaroMFabricPerformSelector(_nativeAdView, NSSelectorFromString(@"refreshMountedAssetViews"));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
- (void)loadAd
|
|
263
|
+
{
|
|
264
|
+
DaroMFabricPerformSelector(_nativeAdView, NSSelectorFromString(@"loadAd"));
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args
|
|
268
|
+
{
|
|
269
|
+
RCTDaroMNativeAdViewHandleCommand(self, commandName, args);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
- (void)prepareForRecycle
|
|
273
|
+
{
|
|
274
|
+
[super prepareForRecycle];
|
|
275
|
+
DaroMFabricSetValue(_nativeAdView, @"onAdLoadedEvent", nil);
|
|
276
|
+
DaroMFabricSetValue(_nativeAdView, @"onAdLoadFailedEvent", nil);
|
|
277
|
+
DaroMFabricSetValue(_nativeAdView, @"onAdClickedEvent", nil);
|
|
278
|
+
DaroMFabricSetValue(_nativeAdView, @"onAdImpressionRecordedEvent", nil);
|
|
279
|
+
DaroMFabricPerformSelectorWithObject(_nativeAdView, NSSelectorFromString(@"setAssetSearchRootView:"), nil);
|
|
280
|
+
DaroMFabricPerformSelector(_nativeAdView, NSSelectorFromString(@"prepareForReuse"));
|
|
281
|
+
DaroMFabricPerformSelectorWithObject(_nativeAdView, NSSelectorFromString(@"setAssetSearchRootView:"), _nativeAdView);
|
|
282
|
+
[self installEventHandlers];
|
|
283
|
+
static const auto defaultProps = std::make_shared<const DaroMNativeAdViewProps>();
|
|
284
|
+
_props = defaultProps;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
@end
|
|
288
|
+
|
|
289
|
+
Class<RCTComponentViewProtocol> DaroMNativeAdViewCls(void)
|
|
290
|
+
{
|
|
291
|
+
return DaroMNativeAdViewComponentView.class;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
#endif
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
RCT_EXPORT_VIEW_PROPERTY(adUnitId, NSString)
|
|
6
6
|
RCT_EXPORT_VIEW_PROPERTY(adFormat, NSString)
|
|
7
|
+
RCT_EXPORT_VIEW_PROPERTY(loadOnMount, BOOL)
|
|
8
|
+
RCT_EXPORT_VIEW_PROPERTY(isVisible, BOOL)
|
|
7
9
|
|
|
8
10
|
RCT_EXPORT_VIEW_PROPERTY(onAdLoadedEvent, RCTDirectEventBlock)
|
|
9
11
|
RCT_EXPORT_VIEW_PROPERTY(onAdLoadFailedEvent, RCTDirectEventBlock)
|
|
10
12
|
RCT_EXPORT_VIEW_PROPERTY(onAdClickedEvent, RCTDirectEventBlock)
|
|
11
13
|
RCT_EXPORT_VIEW_PROPERTY(onAdImpressionRecordedEvent, RCTDirectEventBlock)
|
|
12
14
|
|
|
13
|
-
RCT_EXTERN_METHOD(loadAd)
|
|
15
|
+
RCT_EXTERN_METHOD(loadAd : (nonnull NSNumber *)viewTag)
|
|
14
16
|
|
|
15
17
|
@end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React
|
|
2
|
+
|
|
3
|
+
@objc(DaroMAdBannerViewManager)
|
|
4
|
+
class DaroMAdBannerViewManager: RCTViewManager {
|
|
5
|
+
override func view() -> DaroMAdBannerView {
|
|
6
|
+
DaroMAdBannerView()
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@objc override static func requiresMainQueueSetup() -> Bool {
|
|
10
|
+
false
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@objc(loadAd:)
|
|
14
|
+
func loadAd(viewTag: NSNumber) {
|
|
15
|
+
bridge?.uiManager.addUIBlock({ _, viewRegistry in
|
|
16
|
+
if let view = viewRegistry?[viewTag] as? DaroMAdBannerView {
|
|
17
|
+
view.loadAd()
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
@interface RCT_EXTERN_MODULE (DaroMNativeAdViewManager, RCTViewManager)
|
|
4
4
|
|
|
5
5
|
RCT_EXPORT_VIEW_PROPERTY(adUnitId, NSString)
|
|
6
|
+
RCT_EXPORT_VIEW_PROPERTY(loadOnMount, BOOL)
|
|
7
|
+
RCT_EXPORT_VIEW_PROPERTY(adChoicesPosition, NSString)
|
|
6
8
|
|
|
7
9
|
RCT_EXPORT_VIEW_PROPERTY(titleView, NSNumber)
|
|
8
10
|
RCT_EXPORT_VIEW_PROPERTY(bodyView, NSNumber)
|
|
9
11
|
RCT_EXPORT_VIEW_PROPERTY(callToActionView, NSNumber)
|
|
10
12
|
RCT_EXPORT_VIEW_PROPERTY(iconView, NSNumber)
|
|
11
|
-
RCT_EXPORT_VIEW_PROPERTY(optionsView, NSNumber)
|
|
12
13
|
RCT_EXPORT_VIEW_PROPERTY(mediaView, NSNumber)
|
|
13
14
|
|
|
14
15
|
RCT_EXPORT_VIEW_PROPERTY(titleViewStyleProps, NSDictionary)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React
|
|
2
|
+
import UIKit
|
|
3
|
+
|
|
4
|
+
@objc(DaroMNativeAdViewManager)
|
|
5
|
+
class DaroMNativeAdViewManager: RCTViewManager {
|
|
6
|
+
override func view() -> RNDaroMNativeAdView {
|
|
7
|
+
RNDaroMNativeAdView(assetResolver: DaroMBridgeNativeAssetResolver(bridge: bridge))
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@objc override static func requiresMainQueueSetup() -> Bool {
|
|
11
|
+
false
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@objc(loadAd:)
|
|
15
|
+
func loadAd(viewTag: NSNumber) {
|
|
16
|
+
bridge?.uiManager.addUIBlock({ _, viewRegistry in
|
|
17
|
+
if let view = viewRegistry?[viewTag] as? RNDaroMNativeAdView {
|
|
18
|
+
view.loadAd()
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React
|
|
2
|
+
|
|
3
|
+
final class DaroMAdEventSink {
|
|
4
|
+
var onAdLoadedEvent: RCTDirectEventBlock?
|
|
5
|
+
var onAdLoadFailedEvent: RCTDirectEventBlock?
|
|
6
|
+
var onAdClickedEvent: RCTDirectEventBlock?
|
|
7
|
+
var onAdImpressionRecordedEvent: RCTDirectEventBlock?
|
|
8
|
+
|
|
9
|
+
func emitAdLoaded(_ body: [AnyHashable: Any]?) {
|
|
10
|
+
onAdLoadedEvent?(body)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
func emitAdLoadFailed(_ body: [AnyHashable: Any]?) {
|
|
14
|
+
onAdLoadFailedEvent?(body)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
func emitAdClicked(_ body: [AnyHashable: Any]?) {
|
|
18
|
+
onAdClickedEvent?(body)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
func emitAdImpressionRecorded(_ body: [AnyHashable: Any]?) {
|
|
22
|
+
onAdImpressionRecordedEvent?(body)
|
|
23
|
+
}
|
|
24
|
+
}
|