react-native-daro 2.0.7 → 2.0.9-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/android/build.gradle +3 -1
- package/android/src/main/java/com/daro/reactnative/DaroRNAdBannerViewManager.kt +8 -3
- package/android/src/main/java/com/daro/reactnative/DaroRNAdNativeViewManager.kt +8 -3
- package/android/src/main/java/com/daro/reactnative/DaroRNModule.kt +76 -34
- package/android/src/main/java/com/daro/reactnative/event/DaroRNEvent.kt +8 -0
- package/android/src/main/java/com/daro/reactnative/impl/DaroRNInterstitialModuleImpl.kt +13 -13
- package/android/src/main/java/com/daro/reactnative/impl/DaroRNLightPopupModuleImpl.kt +12 -12
- package/android/src/main/java/com/daro/reactnative/impl/DaroRNPreloadModuleImpl.kt +77 -0
- package/android/src/main/java/com/daro/reactnative/impl/DaroRNRewardedAdModuleImpl.kt +14 -14
- package/android/src/main/java/com/daro/reactnative/preload/DaroRNPreloadRegistry.kt +57 -0
- package/android/src/main/java/com/daro/reactnative/util/AdInfoUtil.kt +27 -16
- package/android/src/main/java/com/daro/reactnative/view/DaroMediaView.kt +3 -0
- package/android/src/main/java/com/daro/reactnative/view/DaroRNAdBannerViewContainer.kt +36 -15
- package/android/src/main/java/com/daro/reactnative/view/DaroRNAdNativeViewContainer.kt +36 -15
- package/android/src/oldarch/java/com/daro/reactnative/DaroRNModuleSpec.kt +28 -14
- package/android/src/test/java/com/daro/reactnative/preload/DaroRNPreloadRegistryTest.kt +65 -0
- package/android/src/test/java/com/daro/reactnative/view/DaroMediaViewTest.kt +45 -0
- package/android/src/test/java/com/daro/reactnative/view/DaroRNPreloadFirstLoadTest.kt +160 -0
- package/ios/DaroRNModule+AppOpen.swift +9 -9
- package/ios/DaroRNModule+Interstitial.swift +9 -9
- package/ios/DaroRNModule+LightPopup.swift +13 -13
- package/ios/DaroRNModule+Preload.swift +122 -0
- package/ios/DaroRNModule+Rewarded.swift +14 -14
- package/ios/DaroRNModule.mm +20 -14
- package/ios/DaroRNModule.swift +6 -1
- package/ios/Fabric/DaroRNAdBannerComponentView.mm +12 -7
- package/ios/Fabric/DaroRNNativeAdComponentView.mm +12 -7
- package/ios/Paper/DaroRNAdBannerViewManager.m +2 -1
- package/ios/Paper/DaroRNNativeAdViewManager.m +2 -1
- package/ios/Shared/DaroRNBannerAdView.swift +23 -9
- package/ios/Shared/DaroRNNativeAdView.swift +77 -46
- package/ios/Shared/DaroRNPreloadRegistry.swift +54 -0
- package/lib/commonjs/AdBannerView.js +4 -2
- package/lib/commonjs/AdBannerView.js.map +1 -1
- package/lib/commonjs/AdPreload.js +105 -0
- package/lib/commonjs/AdPreload.js.map +1 -0
- package/lib/commonjs/AppOpenAd.js +22 -22
- package/lib/commonjs/AppOpenAd.js.map +1 -1
- package/lib/commonjs/DaroRNAdBannerViewNativeComponent.ts +5 -3
- package/lib/commonjs/DaroRNNativeAdViewNativeComponent.ts +5 -3
- package/lib/commonjs/InterstitialAd.js +24 -24
- package/lib/commonjs/InterstitialAd.js.map +1 -1
- package/lib/commonjs/LightPopupAd.js +27 -27
- package/lib/commonjs/LightPopupAd.js.map +1 -1
- package/lib/commonjs/NativeDaroModule.js.map +1 -1
- package/lib/commonjs/RewardedAd.js +22 -22
- package/lib/commonjs/RewardedAd.js.map +1 -1
- package/lib/commonjs/hooks/useAdPreload.js +61 -0
- package/lib/commonjs/hooks/useAdPreload.js.map +1 -0
- package/lib/commonjs/hooks/useInterstitialAd.js +6 -6
- package/lib/commonjs/hooks/useInterstitialAd.js.map +1 -1
- package/lib/commonjs/hooks/useLightPopupAd.js +5 -5
- package/lib/commonjs/hooks/useLightPopupAd.js.map +1 -1
- package/lib/commonjs/hooks/useRewardedAd.js +6 -6
- package/lib/commonjs/hooks/useRewardedAd.js.map +1 -1
- package/lib/commonjs/index.js +37 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdView.js +4 -2
- package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
- package/lib/commonjs/types/NativeAdViewProps.js.map +1 -1
- package/lib/module/AdBannerView.js +4 -2
- package/lib/module/AdBannerView.js.map +1 -1
- package/lib/module/AdPreload.js +98 -0
- package/lib/module/AdPreload.js.map +1 -0
- package/lib/module/AppOpenAd.js +22 -22
- package/lib/module/AppOpenAd.js.map +1 -1
- package/lib/module/DaroRNAdBannerViewNativeComponent.ts +5 -3
- package/lib/module/DaroRNNativeAdViewNativeComponent.ts +5 -3
- package/lib/module/InterstitialAd.js +24 -24
- package/lib/module/InterstitialAd.js.map +1 -1
- package/lib/module/LightPopupAd.js +27 -27
- package/lib/module/LightPopupAd.js.map +1 -1
- package/lib/module/NativeDaroModule.js.map +1 -1
- package/lib/module/RewardedAd.js +22 -22
- package/lib/module/RewardedAd.js.map +1 -1
- package/lib/module/hooks/useAdPreload.js +56 -0
- package/lib/module/hooks/useAdPreload.js.map +1 -0
- package/lib/module/hooks/useInterstitialAd.js +6 -6
- package/lib/module/hooks/useInterstitialAd.js.map +1 -1
- package/lib/module/hooks/useLightPopupAd.js +5 -5
- package/lib/module/hooks/useLightPopupAd.js.map +1 -1
- package/lib/module/hooks/useRewardedAd.js +6 -6
- package/lib/module/hooks/useRewardedAd.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/nativeAd/NativeAdView.js +4 -2
- package/lib/module/nativeAd/NativeAdView.js.map +1 -1
- package/lib/module/types/NativeAdViewProps.js.map +1 -1
- package/lib/typescript/commonjs/src/AdBannerView.d.ts +1 -0
- package/lib/typescript/commonjs/src/AdBannerView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/AdPreload.d.ts +62 -0
- package/lib/typescript/commonjs/src/AdPreload.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/AppOpenAd.d.ts +8 -8
- package/lib/typescript/commonjs/src/AppOpenAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/DaroRNAdBannerViewNativeComponent.d.ts +4 -3
- package/lib/typescript/commonjs/src/DaroRNAdBannerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/DaroRNNativeAdViewNativeComponent.d.ts +4 -3
- package/lib/typescript/commonjs/src/DaroRNNativeAdViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/InterstitialAd.d.ts +8 -8
- package/lib/typescript/commonjs/src/InterstitialAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/LightPopupAd.d.ts +9 -9
- package/lib/typescript/commonjs/src/LightPopupAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/NativeDaroModule.d.ts +19 -14
- package/lib/typescript/commonjs/src/NativeDaroModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/RewardedAd.d.ts +8 -8
- package/lib/typescript/commonjs/src/RewardedAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useAdPreload.d.ts +19 -0
- package/lib/typescript/commonjs/src/hooks/useAdPreload.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useInterstitialAd.d.ts +1 -1
- package/lib/typescript/commonjs/src/hooks/useInterstitialAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts +1 -1
- package/lib/typescript/commonjs/src/hooks/useLightPopupAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useRewardedAd.d.ts +1 -1
- package/lib/typescript/commonjs/src/hooks/useRewardedAd.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +4 -0
- 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/types/AdBannerViewProps.d.ts +6 -0
- package/lib/typescript/commonjs/src/types/AdBannerViewProps.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdInfo.d.ts +2 -2
- package/lib/typescript/commonjs/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/AdProps.d.ts +1 -1
- package/lib/typescript/commonjs/src/types/AdProps.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/NativeAdViewProps.d.ts +6 -0
- package/lib/typescript/commonjs/src/types/NativeAdViewProps.d.ts.map +1 -1
- package/lib/typescript/module/src/AdBannerView.d.ts +1 -0
- package/lib/typescript/module/src/AdBannerView.d.ts.map +1 -1
- package/lib/typescript/module/src/AdPreload.d.ts +62 -0
- package/lib/typescript/module/src/AdPreload.d.ts.map +1 -0
- package/lib/typescript/module/src/AppOpenAd.d.ts +8 -8
- package/lib/typescript/module/src/AppOpenAd.d.ts.map +1 -1
- package/lib/typescript/module/src/DaroRNAdBannerViewNativeComponent.d.ts +4 -3
- package/lib/typescript/module/src/DaroRNAdBannerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/DaroRNNativeAdViewNativeComponent.d.ts +4 -3
- package/lib/typescript/module/src/DaroRNNativeAdViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/InterstitialAd.d.ts +8 -8
- package/lib/typescript/module/src/InterstitialAd.d.ts.map +1 -1
- package/lib/typescript/module/src/LightPopupAd.d.ts +9 -9
- package/lib/typescript/module/src/LightPopupAd.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeDaroModule.d.ts +19 -14
- package/lib/typescript/module/src/NativeDaroModule.d.ts.map +1 -1
- package/lib/typescript/module/src/RewardedAd.d.ts +8 -8
- package/lib/typescript/module/src/RewardedAd.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useAdPreload.d.ts +19 -0
- package/lib/typescript/module/src/hooks/useAdPreload.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useInterstitialAd.d.ts +1 -1
- package/lib/typescript/module/src/hooks/useInterstitialAd.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts +1 -1
- package/lib/typescript/module/src/hooks/useLightPopupAd.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useRewardedAd.d.ts +1 -1
- package/lib/typescript/module/src/hooks/useRewardedAd.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +4 -0
- 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/types/AdBannerViewProps.d.ts +6 -0
- package/lib/typescript/module/src/types/AdBannerViewProps.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdInfo.d.ts +2 -2
- package/lib/typescript/module/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/module/src/types/AdProps.d.ts +1 -1
- package/lib/typescript/module/src/types/AdProps.d.ts.map +1 -1
- package/lib/typescript/module/src/types/NativeAdViewProps.d.ts +6 -0
- package/lib/typescript/module/src/types/NativeAdViewProps.d.ts.map +1 -1
- package/package.json +1 -1
- package/plugin/build/withAndroid.js +2 -2
- package/react-native-daro.podspec +1 -1
- package/src/AdBannerView.tsx +4 -2
- package/src/AdPreload.ts +141 -0
- package/src/AppOpenAd.ts +21 -21
- package/src/DaroRNAdBannerViewNativeComponent.ts +5 -3
- package/src/DaroRNNativeAdViewNativeComponent.ts +5 -3
- package/src/InterstitialAd.ts +23 -23
- package/src/LightPopupAd.ts +26 -26
- package/src/NativeDaroModule.ts +31 -14
- package/src/RewardedAd.ts +21 -21
- package/src/hooks/useAdPreload.ts +82 -0
- package/src/hooks/useInterstitialAd.ts +6 -6
- package/src/hooks/useLightPopupAd.ts +5 -5
- package/src/hooks/useRewardedAd.ts +6 -6
- package/src/index.tsx +16 -0
- package/src/nativeAd/NativeAdView.tsx +4 -2
- package/src/types/AdBannerViewProps.ts +6 -0
- package/src/types/AdInfo.ts +2 -2
- package/src/types/AdProps.ts +1 -1
- package/src/types/NativeAdViewProps.ts +6 -0
package/src/AdBannerView.tsx
CHANGED
|
@@ -45,10 +45,11 @@ export const AdBannerView = forwardRef<
|
|
|
45
45
|
AdBannerViewProps & ViewProps
|
|
46
46
|
>(function AdBannerView(
|
|
47
47
|
{
|
|
48
|
-
|
|
48
|
+
adUnitKey,
|
|
49
49
|
adFormat,
|
|
50
50
|
loadOnMount = true,
|
|
51
51
|
isVisible = true,
|
|
52
|
+
preload,
|
|
52
53
|
onAdLoaded,
|
|
53
54
|
onAdLoadFailed,
|
|
54
55
|
onAdClicked,
|
|
@@ -125,8 +126,9 @@ export const AdBannerView = forwardRef<
|
|
|
125
126
|
style={style}
|
|
126
127
|
adFormat={toNativeAdFormat(adFormat)}
|
|
127
128
|
ref={saveElement}
|
|
128
|
-
|
|
129
|
+
adUnitKey={adUnitKey}
|
|
129
130
|
loadOnMount={loadOnMount}
|
|
131
|
+
preloadId={preload?.preloadId}
|
|
130
132
|
isVisible={isVisible}
|
|
131
133
|
onAdLoadedEvent={onAdLoadedEvent}
|
|
132
134
|
onAdLoadFailedEvent={onAdLoadFailedEvent}
|
package/src/AdPreload.ts
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { AdEventEmitter } from './EventEmitter';
|
|
2
|
+
import NativeDaroModule from './NativeDaroModule';
|
|
3
|
+
import type { AdFormat } from './AdBannerView';
|
|
4
|
+
import type { AdInfo, AdLoadFailedInfo } from './types/AdInfo';
|
|
5
|
+
import type { AdChoicesPosition } from './types/NativeAdViewProps';
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
ON_AD_PRELOAD_SUCCESS_EVENT,
|
|
9
|
+
ON_AD_PRELOAD_FAILED_EVENT,
|
|
10
|
+
BANNER_AD_FORMAT_LABEL,
|
|
11
|
+
MREC_AD_FORMAT_LABEL,
|
|
12
|
+
} = NativeDaroModule.getConstants();
|
|
13
|
+
|
|
14
|
+
export enum AdPreloadEventType {
|
|
15
|
+
SUCCESS = 'SUCCESS',
|
|
16
|
+
FAIL = 'FAIL',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface AdPreloadEventPayloadMap {
|
|
20
|
+
[AdPreloadEventType.SUCCESS]: AdInfo;
|
|
21
|
+
[AdPreloadEventType.FAIL]: AdLoadFailedInfo;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const NATIVE_EVENT_BY_TYPE: Record<AdPreloadEventType, string> = {
|
|
25
|
+
[AdPreloadEventType.SUCCESS]: ON_AD_PRELOAD_SUCCESS_EVENT,
|
|
26
|
+
[AdPreloadEventType.FAIL]: ON_AD_PRELOAD_FAILED_EVENT,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
let nextPreloadId = 1;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 뷰 광고 하나를 뷰 없이 미리 받아 두는 객체. 같은 화면의 `AdBannerView` / `NativeAdView` 에
|
|
33
|
+
* `preload` prop 으로 넘기면 마운트 때 받아 둔 광고를 쓴다.
|
|
34
|
+
*
|
|
35
|
+
* - 객체 하나에 광고 하나. 로딩 중이거나 유효한 광고가 있을 때의 {@link preload} 는 무시된다.
|
|
36
|
+
* - 받아 둔 광고는 한 번만 쓰인다. 마운트로 소비된 뒤 다시 받으려면 {@link preload} 를 다시 부른다.
|
|
37
|
+
* - 실패했거나 만료된 ( 10분 ) 광고를 넘겨받은 뷰는 일반 로드를 한다.
|
|
38
|
+
* - 쓰지 않은 광고는 화면을 떠날 때 {@link destroy} 로 정리한다.
|
|
39
|
+
*/
|
|
40
|
+
abstract class AdPreload {
|
|
41
|
+
/** 뷰의 `preloadId` prop 으로 넘어가는 값. 직접 쓸 일은 없다. */
|
|
42
|
+
readonly preloadId = `daro-preload-${nextPreloadId++}`;
|
|
43
|
+
|
|
44
|
+
private readonly eventEmitter = new AdEventEmitter();
|
|
45
|
+
// destroy 뒤에 도착한 이전 요청의 결과를 버린다.
|
|
46
|
+
private active = false;
|
|
47
|
+
|
|
48
|
+
constructor(readonly adUnitKey: string) {}
|
|
49
|
+
|
|
50
|
+
protected abstract requestPreload(): Promise<void>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 광고를 미리 받기 시작한다. Promise 는 네이티브가 요청을 받아 둔 시점에 끝난다 —
|
|
54
|
+
* 광고 수신 결과는 {@link addPreloadEventListener} 로 온다. 결과를 기다리지 않고 마운트해도 된다.
|
|
55
|
+
*/
|
|
56
|
+
preload(): Promise<void> {
|
|
57
|
+
this.active = true;
|
|
58
|
+
return this.requestPreload();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
addPreloadEventListener<T extends AdPreloadEventType>(
|
|
62
|
+
type: T,
|
|
63
|
+
listener: (info: AdPreloadEventPayloadMap[T]) => void
|
|
64
|
+
): () => void {
|
|
65
|
+
const preloadId = this.preloadId;
|
|
66
|
+
return this.eventEmitter.addEventListener(
|
|
67
|
+
NATIVE_EVENT_BY_TYPE[type],
|
|
68
|
+
(payload: any) => {
|
|
69
|
+
if (!this.active || payload?.preloadId !== preloadId) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const info = { ...payload };
|
|
73
|
+
delete info.preloadId;
|
|
74
|
+
listener(info);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
removeAllListeners(): void {
|
|
80
|
+
this.eventEmitter.removeAllListeners();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 쓰지 않은 광고를 정리한다. 여러 번 불러도 된다. 이미 뷰에 넘어간 광고는 그 뷰가 정리한다.
|
|
85
|
+
* 다시 {@link preload} 를 부르면 새로 받는다.
|
|
86
|
+
*/
|
|
87
|
+
destroy(): void {
|
|
88
|
+
this.active = false;
|
|
89
|
+
NativeDaroModule.destroyAdPreload(this.preloadId);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type BannerAdPreloadOptions = {
|
|
94
|
+
adUnitKey: string;
|
|
95
|
+
adFormat: AdFormat;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export class BannerAdPreload extends AdPreload {
|
|
99
|
+
readonly adFormat: AdFormat;
|
|
100
|
+
|
|
101
|
+
constructor({ adUnitKey, adFormat }: BannerAdPreloadOptions) {
|
|
102
|
+
super(adUnitKey);
|
|
103
|
+
this.adFormat = adFormat;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
protected requestPreload(): Promise<void> {
|
|
107
|
+
return NativeDaroModule.preloadBannerAd(
|
|
108
|
+
this.preloadId,
|
|
109
|
+
this.adUnitKey,
|
|
110
|
+
(this.adFormat as string) === 'MREC'
|
|
111
|
+
? MREC_AD_FORMAT_LABEL
|
|
112
|
+
: BANNER_AD_FORMAT_LABEL
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export type NativeAdPreloadOptions = {
|
|
118
|
+
adUnitKey: string;
|
|
119
|
+
/** iOS 는 광고를 받을 때 정해진다. `NativeAdView` 의 `adChoicesPosition` 과 같은 값을 준다. */
|
|
120
|
+
adChoicesPosition?: AdChoicesPosition;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export class NativeAdPreload extends AdPreload {
|
|
124
|
+
readonly adChoicesPosition: AdChoicesPosition;
|
|
125
|
+
|
|
126
|
+
constructor({
|
|
127
|
+
adUnitKey,
|
|
128
|
+
adChoicesPosition = 'bottomRight',
|
|
129
|
+
}: NativeAdPreloadOptions) {
|
|
130
|
+
super(adUnitKey);
|
|
131
|
+
this.adChoicesPosition = adChoicesPosition;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
protected requestPreload(): Promise<void> {
|
|
135
|
+
return NativeDaroModule.preloadNativeAd(
|
|
136
|
+
this.preloadId,
|
|
137
|
+
this.adUnitKey,
|
|
138
|
+
this.adChoicesPosition
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
}
|
package/src/AppOpenAd.ts
CHANGED
|
@@ -47,19 +47,19 @@ export class AppOpenAd {
|
|
|
47
47
|
|
|
48
48
|
private constructor(
|
|
49
49
|
private readonly requestId: number,
|
|
50
|
-
private readonly
|
|
50
|
+
private readonly adUnitKey: string
|
|
51
51
|
) {}
|
|
52
52
|
|
|
53
|
-
static createForAdRequest(
|
|
53
|
+
static createForAdRequest(adUnitKey: string): AppOpenAd {
|
|
54
54
|
const requestId = AppOpenAd._nextRequestId++;
|
|
55
|
-
return new AppOpenAd(requestId,
|
|
55
|
+
return new AppOpenAd(requestId, adUnitKey);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
isAdReady(): Promise<boolean> {
|
|
59
59
|
if (!IS_SUPPORTED_PLATFORM) {
|
|
60
60
|
return Promise.resolve(false);
|
|
61
61
|
}
|
|
62
|
-
return NativeDaroModule.isAppOpenAdReady(this.requestId, this.
|
|
62
|
+
return NativeDaroModule.isAppOpenAdReady(this.requestId, this.adUnitKey);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
load(): void {
|
|
@@ -67,7 +67,7 @@ export class AppOpenAd {
|
|
|
67
67
|
warnUnsupportedPlatform();
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
NativeDaroModule.loadAppOpenAd(this.requestId, this.
|
|
70
|
+
NativeDaroModule.loadAppOpenAd(this.requestId, this.adUnitKey);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
show(customData?: string | null): void {
|
|
@@ -77,7 +77,7 @@ export class AppOpenAd {
|
|
|
77
77
|
}
|
|
78
78
|
NativeDaroModule.showAppOpenAd(
|
|
79
79
|
this.requestId,
|
|
80
|
-
this.
|
|
80
|
+
this.adUnitKey,
|
|
81
81
|
customData ?? undefined
|
|
82
82
|
);
|
|
83
83
|
}
|
|
@@ -107,11 +107,11 @@ export class AppOpenAd {
|
|
|
107
107
|
|
|
108
108
|
// ---- Deprecated static API (backward compatibility) ----
|
|
109
109
|
|
|
110
|
-
private static _getLegacyRequestId(
|
|
111
|
-
let requestId = AppOpenAd._legacyRequestIds.get(
|
|
110
|
+
private static _getLegacyRequestId(adUnitKey: string): number {
|
|
111
|
+
let requestId = AppOpenAd._legacyRequestIds.get(adUnitKey);
|
|
112
112
|
if (requestId === undefined) {
|
|
113
113
|
requestId = AppOpenAd._nextRequestId++;
|
|
114
|
-
AppOpenAd._legacyRequestIds.set(
|
|
114
|
+
AppOpenAd._legacyRequestIds.set(adUnitKey, requestId);
|
|
115
115
|
AppOpenAd._legacyRequestIdSet.add(requestId);
|
|
116
116
|
}
|
|
117
117
|
return requestId;
|
|
@@ -134,35 +134,35 @@ export class AppOpenAd {
|
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
/** @deprecated `AppOpenAd.createForAdRequest(
|
|
138
|
-
static isAdReady(
|
|
137
|
+
/** @deprecated `AppOpenAd.createForAdRequest(adUnitKey)` 인스턴스의 `isAdReady()`를 사용하세요. */
|
|
138
|
+
static isAdReady(adUnitKey: string): Promise<boolean> {
|
|
139
139
|
if (!IS_SUPPORTED_PLATFORM) {
|
|
140
140
|
return Promise.resolve(false);
|
|
141
141
|
}
|
|
142
|
-
const requestId = AppOpenAd._getLegacyRequestId(
|
|
143
|
-
return NativeDaroModule.isAppOpenAdReady(requestId,
|
|
142
|
+
const requestId = AppOpenAd._getLegacyRequestId(adUnitKey);
|
|
143
|
+
return NativeDaroModule.isAppOpenAdReady(requestId, adUnitKey);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
/** @deprecated `AppOpenAd.createForAdRequest(
|
|
147
|
-
static loadAd(
|
|
146
|
+
/** @deprecated `AppOpenAd.createForAdRequest(adUnitKey)` 인스턴스의 `load()`를 사용하세요. */
|
|
147
|
+
static loadAd(adUnitKey: string): void {
|
|
148
148
|
if (!IS_SUPPORTED_PLATFORM) {
|
|
149
149
|
warnUnsupportedPlatform();
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
|
-
const requestId = AppOpenAd._getLegacyRequestId(
|
|
153
|
-
NativeDaroModule.loadAppOpenAd(requestId,
|
|
152
|
+
const requestId = AppOpenAd._getLegacyRequestId(adUnitKey);
|
|
153
|
+
NativeDaroModule.loadAppOpenAd(requestId, adUnitKey);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
/** @deprecated `AppOpenAd.createForAdRequest(
|
|
157
|
-
static showAd(
|
|
156
|
+
/** @deprecated `AppOpenAd.createForAdRequest(adUnitKey)` 인스턴스의 `show()`를 사용하세요. */
|
|
157
|
+
static showAd(adUnitKey: string, customData?: string | null): void {
|
|
158
158
|
if (!IS_SUPPORTED_PLATFORM) {
|
|
159
159
|
warnUnsupportedPlatform();
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
const requestId = AppOpenAd._getLegacyRequestId(
|
|
162
|
+
const requestId = AppOpenAd._getLegacyRequestId(adUnitKey);
|
|
163
163
|
NativeDaroModule.showAppOpenAd(
|
|
164
164
|
requestId,
|
|
165
|
-
|
|
165
|
+
adUnitKey,
|
|
166
166
|
customData ?? undefined
|
|
167
167
|
);
|
|
168
168
|
}
|
|
@@ -13,23 +13,25 @@ import type {
|
|
|
13
13
|
// 필드 구성은 src/types/AdInfo.ts 의 AdInfo 와 같은 것을 뜻한다. 이쪽은 codegen 이
|
|
14
14
|
// 읽는 선언이라 **여기 없으면 네이티브가 실어 보내도 Fabric 이 걸러낸다.**
|
|
15
15
|
type AdInfoPayload = {
|
|
16
|
-
|
|
16
|
+
adUnitKey: string;
|
|
17
17
|
latencyMillis: Double;
|
|
18
18
|
mediationPlatform?: string;
|
|
19
19
|
adNetwork?: string;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
type AdLoadFailedInfoPayload = {
|
|
23
|
-
|
|
23
|
+
adUnitKey: string;
|
|
24
24
|
code: Int32;
|
|
25
25
|
message: string;
|
|
26
26
|
latencyMillis: Double;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export interface NativeProps extends ViewProps {
|
|
30
|
-
|
|
30
|
+
adUnitKey: string;
|
|
31
31
|
adFormat: string;
|
|
32
32
|
loadOnMount?: WithDefault<boolean, true>;
|
|
33
|
+
// preload 로 받아 둔 광고의 id. 비어 있으면 일반 로드다.
|
|
34
|
+
preloadId?: string;
|
|
33
35
|
isVisible?: WithDefault<boolean, true>;
|
|
34
36
|
onAdLoadedEvent?: DirectEventHandler<AdInfoPayload>;
|
|
35
37
|
onAdLoadFailedEvent?: DirectEventHandler<AdLoadFailedInfoPayload>;
|
|
@@ -14,14 +14,14 @@ import type {
|
|
|
14
14
|
// 필드 구성은 src/types/AdInfo.ts 의 AdInfo 와 같은 것을 뜻한다. 이쪽은 codegen 이
|
|
15
15
|
// 읽는 선언이라 **여기 없으면 네이티브가 실어 보내도 Fabric 이 걸러낸다.**
|
|
16
16
|
type AdInfoPayload = {
|
|
17
|
-
|
|
17
|
+
adUnitKey: string;
|
|
18
18
|
latencyMillis: Double;
|
|
19
19
|
mediationPlatform?: string;
|
|
20
20
|
adNetwork?: string;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
type AdLoadFailedInfoPayload = {
|
|
24
|
-
|
|
24
|
+
adUnitKey: string;
|
|
25
25
|
code: Int32;
|
|
26
26
|
message: string;
|
|
27
27
|
latencyMillis: Double;
|
|
@@ -30,8 +30,10 @@ type AdLoadFailedInfoPayload = {
|
|
|
30
30
|
type AdChoicesPosition = 'topLeft' | 'topRight' | 'bottomRight' | 'bottomLeft';
|
|
31
31
|
|
|
32
32
|
export interface NativeProps extends ViewProps {
|
|
33
|
-
|
|
33
|
+
adUnitKey: string;
|
|
34
34
|
loadOnMount?: WithDefault<boolean, true>;
|
|
35
|
+
// preload 로 받아 둔 광고의 id. 비어 있으면 일반 로드다.
|
|
36
|
+
preloadId?: string;
|
|
35
37
|
adChoicesPosition?: WithDefault<AdChoicesPosition, 'bottomRight'>;
|
|
36
38
|
|
|
37
39
|
titleView?: Int32;
|
package/src/InterstitialAd.ts
CHANGED
|
@@ -40,24 +40,24 @@ export class InterstitialAd {
|
|
|
40
40
|
|
|
41
41
|
private constructor(
|
|
42
42
|
private readonly requestId: number,
|
|
43
|
-
private readonly
|
|
43
|
+
private readonly adUnitKey: string
|
|
44
44
|
) {}
|
|
45
45
|
|
|
46
|
-
static createForAdRequest(
|
|
46
|
+
static createForAdRequest(adUnitKey: string): InterstitialAd {
|
|
47
47
|
const requestId = InterstitialAd._nextRequestId++;
|
|
48
|
-
return new InterstitialAd(requestId,
|
|
48
|
+
return new InterstitialAd(requestId, adUnitKey);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
isAdReady(): Promise<boolean> {
|
|
52
|
-
return NativeDaroModule.isInterstitialReady(this.requestId, this.
|
|
52
|
+
return NativeDaroModule.isInterstitialReady(this.requestId, this.adUnitKey);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
load(): void {
|
|
56
|
-
NativeDaroModule.loadInterstitial(this.requestId, this.
|
|
56
|
+
NativeDaroModule.loadInterstitial(this.requestId, this.adUnitKey);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
show(): void {
|
|
60
|
-
NativeDaroModule.showInterstitial(this.requestId, this.
|
|
60
|
+
NativeDaroModule.showInterstitial(this.requestId, this.adUnitKey);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
addAdEventListener<T extends AdEventType>(
|
|
@@ -79,14 +79,14 @@ export class InterstitialAd {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
// ---- Deprecated static API (backward compatibility) ----
|
|
82
|
-
// Static API allocates a stable requestId per
|
|
83
|
-
// Multiple static calls for the same
|
|
82
|
+
// Static API allocates a stable requestId per adUnitKey and reuses it.
|
|
83
|
+
// Multiple static calls for the same adUnitKey share the same native slot.
|
|
84
84
|
|
|
85
|
-
private static _getLegacyRequestId(
|
|
86
|
-
let requestId = InterstitialAd._legacyRequestIds.get(
|
|
85
|
+
private static _getLegacyRequestId(adUnitKey: string): number {
|
|
86
|
+
let requestId = InterstitialAd._legacyRequestIds.get(adUnitKey);
|
|
87
87
|
if (requestId === undefined) {
|
|
88
88
|
requestId = InterstitialAd._nextRequestId++;
|
|
89
|
-
InterstitialAd._legacyRequestIds.set(
|
|
89
|
+
InterstitialAd._legacyRequestIds.set(adUnitKey, requestId);
|
|
90
90
|
InterstitialAd._legacyRequestIdSet.add(requestId);
|
|
91
91
|
}
|
|
92
92
|
return requestId;
|
|
@@ -104,22 +104,22 @@ export class InterstitialAd {
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
/** @deprecated `InterstitialAd.createForAdRequest(
|
|
108
|
-
static isAdReady(
|
|
109
|
-
const requestId = InterstitialAd._getLegacyRequestId(
|
|
110
|
-
return NativeDaroModule.isInterstitialReady(requestId,
|
|
107
|
+
/** @deprecated `InterstitialAd.createForAdRequest(adUnitKey)` 인스턴스의 `isAdReady()`를 사용하세요. */
|
|
108
|
+
static isAdReady(adUnitKey: string): Promise<boolean> {
|
|
109
|
+
const requestId = InterstitialAd._getLegacyRequestId(adUnitKey);
|
|
110
|
+
return NativeDaroModule.isInterstitialReady(requestId, adUnitKey);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
/** @deprecated `InterstitialAd.createForAdRequest(
|
|
114
|
-
static loadAd(
|
|
115
|
-
const requestId = InterstitialAd._getLegacyRequestId(
|
|
116
|
-
NativeDaroModule.loadInterstitial(requestId,
|
|
113
|
+
/** @deprecated `InterstitialAd.createForAdRequest(adUnitKey)` 인스턴스의 `load()`를 사용하세요. */
|
|
114
|
+
static loadAd(adUnitKey: string): void {
|
|
115
|
+
const requestId = InterstitialAd._getLegacyRequestId(adUnitKey);
|
|
116
|
+
NativeDaroModule.loadInterstitial(requestId, adUnitKey);
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
/** @deprecated `InterstitialAd.createForAdRequest(
|
|
120
|
-
static showAd(
|
|
121
|
-
const requestId = InterstitialAd._getLegacyRequestId(
|
|
122
|
-
NativeDaroModule.showInterstitial(requestId,
|
|
119
|
+
/** @deprecated `InterstitialAd.createForAdRequest(adUnitKey)` 인스턴스의 `show()`를 사용하세요. */
|
|
120
|
+
static showAd(adUnitKey: string): void {
|
|
121
|
+
const requestId = InterstitialAd._getLegacyRequestId(adUnitKey);
|
|
122
|
+
NativeDaroModule.showInterstitial(requestId, adUnitKey);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
/** @deprecated `addAdEventListener(AdEventType.LOADED, ...)`를 인스턴스에서 사용하세요. */
|
package/src/LightPopupAd.ts
CHANGED
|
@@ -94,37 +94,37 @@ export class LightPopupAd {
|
|
|
94
94
|
|
|
95
95
|
private constructor(
|
|
96
96
|
private readonly requestId: number,
|
|
97
|
-
private readonly
|
|
97
|
+
private readonly adUnitKey: string
|
|
98
98
|
) {}
|
|
99
99
|
|
|
100
|
-
static createForAdRequest(
|
|
100
|
+
static createForAdRequest(adUnitKey: string): LightPopupAd {
|
|
101
101
|
const requestId = LightPopupAd._nextRequestId++;
|
|
102
|
-
return new LightPopupAd(requestId,
|
|
102
|
+
return new LightPopupAd(requestId, adUnitKey);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
isAdReady(): Promise<boolean> {
|
|
106
106
|
if (this.destroyed) return Promise.resolve(false);
|
|
107
107
|
return NativeDaroModule.isLightPopupReady(
|
|
108
108
|
this.requestId,
|
|
109
|
-
this.
|
|
109
|
+
this.adUnitKey
|
|
110
110
|
).then((ready) => !this.destroyed && ready);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
load(): void {
|
|
114
114
|
if (this.destroyed) return;
|
|
115
|
-
NativeDaroModule.loadLightPopup(this.requestId, this.
|
|
115
|
+
NativeDaroModule.loadLightPopup(this.requestId, this.adUnitKey);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
show(): void {
|
|
119
119
|
if (this.destroyed) return;
|
|
120
|
-
NativeDaroModule.showLightPopup(this.requestId, this.
|
|
120
|
+
NativeDaroModule.showLightPopup(this.requestId, this.adUnitKey);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
setConfiguration(configuration: LightPopupAdConfiguration): void {
|
|
124
124
|
if (this.destroyed) return;
|
|
125
125
|
NativeDaroModule.setLightPopupAdConfiguration(
|
|
126
126
|
this.requestId,
|
|
127
|
-
this.
|
|
127
|
+
this.adUnitKey,
|
|
128
128
|
normalizeConfiguration(configuration)
|
|
129
129
|
);
|
|
130
130
|
}
|
|
@@ -153,16 +153,16 @@ export class LightPopupAd {
|
|
|
153
153
|
if (this.destroyed) return;
|
|
154
154
|
this.destroyed = true;
|
|
155
155
|
this.removeAllListeners();
|
|
156
|
-
NativeDaroModule.destroyLightPopup(this.requestId, this.
|
|
156
|
+
NativeDaroModule.destroyLightPopup(this.requestId, this.adUnitKey);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
// ---- Deprecated static API (backward compatibility) ----
|
|
160
160
|
|
|
161
|
-
private static _getLegacyRequestId(
|
|
162
|
-
let requestId = LightPopupAd._legacyRequestIds.get(
|
|
161
|
+
private static _getLegacyRequestId(adUnitKey: string): number {
|
|
162
|
+
let requestId = LightPopupAd._legacyRequestIds.get(adUnitKey);
|
|
163
163
|
if (requestId === undefined) {
|
|
164
164
|
requestId = LightPopupAd._nextRequestId++;
|
|
165
|
-
LightPopupAd._legacyRequestIds.set(
|
|
165
|
+
LightPopupAd._legacyRequestIds.set(adUnitKey, requestId);
|
|
166
166
|
LightPopupAd._legacyRequestIdSet.add(requestId);
|
|
167
167
|
}
|
|
168
168
|
return requestId;
|
|
@@ -180,33 +180,33 @@ export class LightPopupAd {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
/** @deprecated `LightPopupAd.createForAdRequest(
|
|
184
|
-
static isAdReady(
|
|
185
|
-
const requestId = LightPopupAd._getLegacyRequestId(
|
|
186
|
-
return NativeDaroModule.isLightPopupReady(requestId,
|
|
183
|
+
/** @deprecated `LightPopupAd.createForAdRequest(adUnitKey)` 인스턴스의 `isAdReady()`를 사용하세요. */
|
|
184
|
+
static isAdReady(adUnitKey: string): Promise<boolean> {
|
|
185
|
+
const requestId = LightPopupAd._getLegacyRequestId(adUnitKey);
|
|
186
|
+
return NativeDaroModule.isLightPopupReady(requestId, adUnitKey);
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
/** @deprecated `LightPopupAd.createForAdRequest(
|
|
190
|
-
static loadAd(
|
|
191
|
-
const requestId = LightPopupAd._getLegacyRequestId(
|
|
192
|
-
NativeDaroModule.loadLightPopup(requestId,
|
|
189
|
+
/** @deprecated `LightPopupAd.createForAdRequest(adUnitKey)` 인스턴스의 `load()`를 사용하세요. */
|
|
190
|
+
static loadAd(adUnitKey: string): void {
|
|
191
|
+
const requestId = LightPopupAd._getLegacyRequestId(adUnitKey);
|
|
192
|
+
NativeDaroModule.loadLightPopup(requestId, adUnitKey);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
/** @deprecated `LightPopupAd.createForAdRequest(
|
|
196
|
-
static showAd(
|
|
197
|
-
const requestId = LightPopupAd._getLegacyRequestId(
|
|
198
|
-
NativeDaroModule.showLightPopup(requestId,
|
|
195
|
+
/** @deprecated `LightPopupAd.createForAdRequest(adUnitKey)` 인스턴스의 `show()`를 사용하세요. */
|
|
196
|
+
static showAd(adUnitKey: string): void {
|
|
197
|
+
const requestId = LightPopupAd._getLegacyRequestId(adUnitKey);
|
|
198
|
+
NativeDaroModule.showLightPopup(requestId, adUnitKey);
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
/** @deprecated 인스턴스의 `setConfiguration()`을 사용하세요. */
|
|
202
202
|
static setLightPopupAdConfiguration(
|
|
203
|
-
|
|
203
|
+
adUnitKey: string,
|
|
204
204
|
configuration: LightPopupAdConfiguration
|
|
205
205
|
): void {
|
|
206
|
-
const requestId = LightPopupAd._getLegacyRequestId(
|
|
206
|
+
const requestId = LightPopupAd._getLegacyRequestId(adUnitKey);
|
|
207
207
|
NativeDaroModule.setLightPopupAdConfiguration(
|
|
208
208
|
requestId,
|
|
209
|
-
|
|
209
|
+
adUnitKey,
|
|
210
210
|
normalizeConfiguration(configuration)
|
|
211
211
|
);
|
|
212
212
|
}
|
package/src/NativeDaroModule.ts
CHANGED
|
@@ -39,6 +39,9 @@ export type DaroModuleConstants = {
|
|
|
39
39
|
ON_LIGHTPOPUP_HIDDEN_EVENT: string;
|
|
40
40
|
ON_LIGHTPOPUP_AD_IMPRESSION_RECORDED: string;
|
|
41
41
|
|
|
42
|
+
ON_AD_PRELOAD_SUCCESS_EVENT: string;
|
|
43
|
+
ON_AD_PRELOAD_FAILED_EVENT: string;
|
|
44
|
+
|
|
42
45
|
BANNER_AD_FORMAT_LABEL: string;
|
|
43
46
|
MREC_AD_FORMAT_LABEL: string;
|
|
44
47
|
UNKNOWN_AD_FORMAT_LABEL?: string;
|
|
@@ -73,36 +76,50 @@ export interface Spec extends TurboModule {
|
|
|
73
76
|
|
|
74
77
|
isInterstitialReady: (
|
|
75
78
|
requestId: Double,
|
|
76
|
-
|
|
79
|
+
adUnitKey: string
|
|
77
80
|
) => Promise<boolean>;
|
|
78
|
-
loadInterstitial: (requestId: Double,
|
|
79
|
-
showInterstitial: (requestId: Double,
|
|
81
|
+
loadInterstitial: (requestId: Double, adUnitKey: string) => Promise<void>;
|
|
82
|
+
showInterstitial: (requestId: Double, adUnitKey: string) => Promise<void>;
|
|
80
83
|
|
|
81
|
-
isRewardedAdReady: (requestId: Double,
|
|
82
|
-
loadRewardedAd: (requestId: Double,
|
|
84
|
+
isRewardedAdReady: (requestId: Double, adUnitKey: string) => Promise<boolean>;
|
|
85
|
+
loadRewardedAd: (requestId: Double, adUnitKey: string) => Promise<void>;
|
|
83
86
|
showRewardedAd: (
|
|
84
87
|
requestId: Double,
|
|
85
|
-
|
|
88
|
+
adUnitKey: string,
|
|
86
89
|
customData?: string | null
|
|
87
90
|
) => Promise<void>;
|
|
88
91
|
|
|
89
|
-
isAppOpenAdReady: (requestId: Double,
|
|
90
|
-
loadAppOpenAd: (requestId: Double,
|
|
92
|
+
isAppOpenAdReady: (requestId: Double, adUnitKey: string) => Promise<boolean>;
|
|
93
|
+
loadAppOpenAd: (requestId: Double, adUnitKey: string) => Promise<void>;
|
|
91
94
|
showAppOpenAd: (
|
|
92
95
|
requestId: Double,
|
|
93
|
-
|
|
96
|
+
adUnitKey: string,
|
|
94
97
|
customData?: string | null
|
|
95
98
|
) => Promise<void>;
|
|
96
99
|
|
|
97
|
-
isLightPopupReady: (requestId: Double,
|
|
98
|
-
loadLightPopup: (requestId: Double,
|
|
99
|
-
destroyLightPopup: (requestId: Double,
|
|
100
|
-
showLightPopup: (requestId: Double,
|
|
100
|
+
isLightPopupReady: (requestId: Double, adUnitKey: string) => Promise<boolean>;
|
|
101
|
+
loadLightPopup: (requestId: Double, adUnitKey: string) => Promise<void>;
|
|
102
|
+
destroyLightPopup: (requestId: Double, adUnitKey: string) => void;
|
|
103
|
+
showLightPopup: (requestId: Double, adUnitKey: string) => Promise<void>;
|
|
101
104
|
setLightPopupAdConfiguration: (
|
|
102
105
|
requestId: Double,
|
|
103
|
-
|
|
106
|
+
adUnitKey: string,
|
|
104
107
|
configuration: UnsafeObject
|
|
105
108
|
) => Promise<void>;
|
|
109
|
+
|
|
110
|
+
// 뷰 광고 preload. Promise 는 네이티브 보관 준비 완료이고, 광고 수신 결과는
|
|
111
|
+
// ON_AD_PRELOAD_*_EVENT 로 온다. `preloadId` 는 뷰의 `preloadId` prop 과 짝이다.
|
|
112
|
+
preloadBannerAd: (
|
|
113
|
+
preloadId: string,
|
|
114
|
+
adUnitKey: string,
|
|
115
|
+
adFormat: string
|
|
116
|
+
) => Promise<void>;
|
|
117
|
+
preloadNativeAd: (
|
|
118
|
+
preloadId: string,
|
|
119
|
+
adUnitKey: string,
|
|
120
|
+
adChoicesPosition: string
|
|
121
|
+
) => Promise<void>;
|
|
122
|
+
destroyAdPreload: (preloadId: string) => void;
|
|
106
123
|
}
|
|
107
124
|
|
|
108
125
|
export default TurboModuleRegistry.getEnforcing<Spec>('DaroRNModule');
|