adwhale-sdk-react-native 2.7.203 → 2.7.300
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/AdwhaleSdkReactNative.podspec +22 -0
- package/README.md +105 -39
- package/android/build.gradle +15 -15
- package/android/proguard-rules.pro +52 -107
- package/android/src/main/java/com/adwhalesdkreactnative/AdWhaleCustomNativeBinderFactory.java +18 -0
- package/android/src/main/java/com/adwhalesdkreactnative/AdwhaleSdkReactNativePackage.java +51 -6
- package/android/src/main/java/com/adwhalesdkreactnative/BinderFactory.java +9 -0
- package/android/src/main/java/com/adwhalesdkreactnative/RNAdWhaleMediationAdSettingModule.java +149 -42
- package/android/src/main/java/com/adwhalesdkreactnative/RNAdWhaleMediationAdView.java +60 -30
- package/android/src/main/java/com/adwhalesdkreactnative/RNAdWhaleMediationAppOpenAd.java +136 -0
- package/android/src/main/java/com/adwhalesdkreactnative/RNAdWhaleMediationCustomNativeAdView.java +37 -46
- package/android/src/main/java/com/adwhalesdkreactnative/RNAdWhaleMediationExitPopupAd.java +240 -0
- package/android/src/main/java/com/adwhalesdkreactnative/RNAdWhaleMediationInterstitialAd.java +189 -0
- package/android/src/main/java/com/adwhalesdkreactnative/RNAdWhaleMediationLoggerModule.java +2 -1
- package/android/src/main/java/com/adwhalesdkreactnative/RNAdWhaleMediationNativeAdViewListenerBridge.java +83 -0
- package/android/src/main/java/com/adwhalesdkreactnative/RNAdWhaleMediationRewardAd.java +255 -6
- package/android/src/main/java/com/adwhalesdkreactnative/RNAdWhaleMediationTemplateNativeAdView.java +191 -70
- package/android/src/main/java/com/adwhalesdkreactnative/RNAdWhaleMediationTransitionPopupAd.java +218 -0
- package/android/src/main/java/com/adwhalesdkreactnative/RNWrapperView.java +137 -0
- package/android/src/main/java/com/adwhalesdkreactnative/SimpleBinderFactory.java +1 -1
- package/android/src/main/java/com/adwhalesdkreactnative/common/RNMethodArgConst.java +112 -0
- package/android/src/main/java/com/adwhalesdkreactnative/common/RNMethodCallConst.java +113 -0
- package/android/src/main/java/com/adwhalesdkreactnative/common/RNMethodResultConst.java +28 -0
- package/build/generated/ios/ReactAppDependencyProvider.podspec +34 -0
- package/ios/AdWhaleNativeCustomViewFactoryRegistry.swift +56 -0
- package/ios/AdwhaleSdkReactNative.mm +96 -5
- package/ios/AdwhaleSdkReactNativeModule.swift +148 -0
- package/ios/RNAdWhaleMediationAdViewManager.m +38 -0
- package/ios/RNAdWhaleMediationAdViewManager.swift +14 -0
- package/ios/RNAdWhaleMediationAppOpenAd.m +18 -0
- package/ios/RNAdWhaleMediationAppOpenAd.swift +175 -0
- package/ios/RNAdWhaleMediationCustomNativeAdViewManager.m +22 -0
- package/ios/RNAdWhaleMediationCustomNativeAdViewManager.swift +239 -0
- package/ios/RNAdWhaleMediationInterstitialAd.m +18 -0
- package/ios/RNAdWhaleMediationInterstitialAd.swift +161 -0
- package/ios/RNAdWhaleMediationRewardAd.m +18 -0
- package/ios/RNAdWhaleMediationRewardAd.swift +172 -0
- package/ios/WhaleMediationBannerContainer.swift +182 -0
- package/lib/module/AdWhaleAdView.js +80 -1
- package/lib/module/AdWhaleAdView.js.map +1 -1
- package/lib/module/AdWhaleAppOpenAd.js +223 -25
- package/lib/module/AdWhaleAppOpenAd.js.map +1 -1
- package/lib/module/AdWhaleExitPopupAd.js +93 -0
- package/lib/module/AdWhaleExitPopupAd.js.map +1 -0
- package/lib/module/AdWhaleInterstitialAd.js +146 -22
- package/lib/module/AdWhaleInterstitialAd.js.map +1 -1
- package/lib/module/AdWhaleMediationAds.js +75 -4
- package/lib/module/AdWhaleMediationAds.js.map +1 -1
- package/lib/module/AdWhaleNativeCustomView.js +59 -8
- package/lib/module/AdWhaleNativeCustomView.js.map +1 -1
- package/lib/module/AdWhaleNativeTemplateView.js +37 -19
- package/lib/module/AdWhaleNativeTemplateView.js.map +1 -1
- package/lib/module/AdWhaleRewardAd.js +169 -24
- package/lib/module/AdWhaleRewardAd.js.map +1 -1
- package/lib/module/AdWhaleTransitionPopupAd.js +87 -0
- package/lib/module/AdWhaleTransitionPopupAd.js.map +1 -0
- package/lib/module/NativeAdwhaleSdkReactNative.js +16 -1
- package/lib/module/NativeAdwhaleSdkReactNative.js.map +1 -1
- package/lib/module/constants/AdWhaleMethodArgConst.js +53 -0
- package/lib/module/constants/AdWhaleMethodArgConst.js.map +1 -0
- package/lib/module/constants/AdWhaleMethodCallConst.js +56 -0
- package/lib/module/constants/AdWhaleMethodCallConst.js.map +1 -0
- package/lib/module/constants/AdWhaleMethodResultConst.js +16 -0
- package/lib/module/constants/AdWhaleMethodResultConst.js.map +1 -0
- package/lib/module/index.js +10 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/AdWhaleAdView.d.ts +46 -2
- package/lib/typescript/src/AdWhaleAdView.d.ts.map +1 -1
- package/lib/typescript/src/AdWhaleAppOpenAd.d.ts +10 -0
- package/lib/typescript/src/AdWhaleAppOpenAd.d.ts.map +1 -1
- package/lib/typescript/src/AdWhaleExitPopupAd.d.ts +36 -0
- package/lib/typescript/src/AdWhaleExitPopupAd.d.ts.map +1 -0
- package/lib/typescript/src/AdWhaleInterstitialAd.d.ts +16 -0
- package/lib/typescript/src/AdWhaleInterstitialAd.d.ts.map +1 -1
- package/lib/typescript/src/AdWhaleMediationAds.d.ts +14 -5
- package/lib/typescript/src/AdWhaleMediationAds.d.ts.map +1 -1
- package/lib/typescript/src/AdWhaleNativeCustomView.d.ts +7 -4
- package/lib/typescript/src/AdWhaleNativeCustomView.d.ts.map +1 -1
- package/lib/typescript/src/AdWhaleNativeTemplateView.d.ts +20 -7
- package/lib/typescript/src/AdWhaleNativeTemplateView.d.ts.map +1 -1
- package/lib/typescript/src/AdWhaleRewardAd.d.ts +18 -2
- package/lib/typescript/src/AdWhaleRewardAd.d.ts.map +1 -1
- package/lib/typescript/src/AdWhaleTransitionPopupAd.d.ts +33 -0
- package/lib/typescript/src/AdWhaleTransitionPopupAd.d.ts.map +1 -0
- package/lib/typescript/src/NativeAdwhaleSdkReactNative.d.ts +33 -6
- package/lib/typescript/src/NativeAdwhaleSdkReactNative.d.ts.map +1 -1
- package/lib/typescript/src/constants/AdWhaleMethodArgConst.d.ts +51 -0
- package/lib/typescript/src/constants/AdWhaleMethodArgConst.d.ts.map +1 -0
- package/lib/typescript/src/constants/AdWhaleMethodCallConst.d.ts +53 -0
- package/lib/typescript/src/constants/AdWhaleMethodCallConst.d.ts.map +1 -0
- package/lib/typescript/src/constants/AdWhaleMethodResultConst.d.ts +14 -0
- package/lib/typescript/src/constants/AdWhaleMethodResultConst.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +10 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/AdWhaleAdView.tsx +126 -9
- package/src/AdWhaleAppOpenAd.ts +293 -38
- package/src/AdWhaleExitPopupAd.ts +183 -0
- package/src/AdWhaleInterstitialAd.ts +206 -36
- package/src/AdWhaleMediationAds.ts +109 -5
- package/src/AdWhaleNativeCustomView.tsx +85 -23
- package/src/AdWhaleNativeTemplateView.tsx +79 -42
- package/src/AdWhaleRewardAd.ts +245 -43
- package/src/AdWhaleTransitionPopupAd.ts +171 -0
- package/src/NativeAdwhaleSdkReactNative.ts +36 -6
- package/src/constants/AdWhaleMethodArgConst.ts +50 -0
- package/src/constants/AdWhaleMethodCallConst.ts +60 -0
- package/src/constants/AdWhaleMethodResultConst.ts +13 -0
- package/src/index.ts +34 -1
|
@@ -7,10 +7,147 @@ import android.widget.FrameLayout;
|
|
|
7
7
|
|
|
8
8
|
public class RNWrapperView extends FrameLayout {
|
|
9
9
|
|
|
10
|
+
// Flutter와 유사: adId로 인스턴스 식별(선택)
|
|
11
|
+
private int adId = 0;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* RN {@code template} prop이 이전 값과 달라졌을 때만 true로 올려,
|
|
15
|
+
* 다음 {@code loadAd}에서 {@link AdWhaleMediationNativeAdView}를 새로 붙입니다.
|
|
16
|
+
*/
|
|
17
|
+
private boolean recreateNativeAdChildBeforeNextLoad;
|
|
18
|
+
|
|
19
|
+
/** 마지막으로 바인딩된 JS template 문자열 (SMALL/MEDIUM/…). */
|
|
20
|
+
private String lastReactTemplateKey;
|
|
21
|
+
|
|
10
22
|
public RNWrapperView(Context context) {
|
|
11
23
|
super(context);
|
|
12
24
|
}
|
|
13
25
|
|
|
26
|
+
public boolean isRecreateNativeAdChildBeforeNextLoad() {
|
|
27
|
+
return recreateNativeAdChildBeforeNextLoad;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public void setRecreateNativeAdChildBeforeNextLoad(boolean recreate) {
|
|
31
|
+
this.recreateNativeAdChildBeforeNextLoad = recreate;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public String getLastReactTemplateKey() {
|
|
35
|
+
return lastReactTemplateKey;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public void setLastReactTemplateKey(String lastReactTemplateKey) {
|
|
39
|
+
this.lastReactTemplateKey = lastReactTemplateKey;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Fabric 등에서 prop으로 load/show를 트리거할 때 중복 실행 방지 */
|
|
43
|
+
private int lastConsumedLoadRequestId;
|
|
44
|
+
private int lastConsumedShowRequestId;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* JS 논리 인스턴스(예: adViewKey)와 묶어서 load/show 중복을 판별합니다.
|
|
48
|
+
* 동일 loadRequestId=1이 다른 인스턴스/재마운트에서 다시 와도 스킵되지 않게 합니다.
|
|
49
|
+
*/
|
|
50
|
+
private int viewSyncKey = -1;
|
|
51
|
+
private static final int DEDUPE_UNSET = Integer.MIN_VALUE;
|
|
52
|
+
private int lastDedupedLoadSyncKey = DEDUPE_UNSET;
|
|
53
|
+
private int lastDedupedLoadRequestId;
|
|
54
|
+
private int lastDedupedShowSyncKey = DEDUPE_UNSET;
|
|
55
|
+
private int lastDedupedShowRequestId;
|
|
56
|
+
|
|
57
|
+
public int getLastConsumedLoadRequestId() {
|
|
58
|
+
return lastConsumedLoadRequestId;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public void setLastConsumedLoadRequestId(int lastConsumedLoadRequestId) {
|
|
62
|
+
this.lastConsumedLoadRequestId = lastConsumedLoadRequestId;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public int getLastConsumedShowRequestId() {
|
|
66
|
+
return lastConsumedShowRequestId;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public void setLastConsumedShowRequestId(int lastConsumedShowRequestId) {
|
|
70
|
+
this.lastConsumedShowRequestId = lastConsumedShowRequestId;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public int getViewSyncKey() {
|
|
74
|
+
return viewSyncKey;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public void setViewSyncKey(int viewSyncKey) {
|
|
78
|
+
this.viewSyncKey = viewSyncKey;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public boolean shouldSkipLoadRequestDedupe(int loadRequestId) {
|
|
82
|
+
return loadRequestId > 0
|
|
83
|
+
&& lastDedupedLoadSyncKey == viewSyncKey
|
|
84
|
+
&& lastDedupedLoadRequestId == loadRequestId;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public void markLoadRequestDeduped(int loadRequestId) {
|
|
88
|
+
lastDedupedLoadSyncKey = viewSyncKey;
|
|
89
|
+
lastDedupedLoadRequestId = loadRequestId;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public boolean shouldSkipShowRequestDedupe(int showRequestId) {
|
|
93
|
+
return showRequestId > 0
|
|
94
|
+
&& lastDedupedShowSyncKey == viewSyncKey
|
|
95
|
+
&& lastDedupedShowRequestId == showRequestId;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
public void markShowRequestDeduped(int showRequestId) {
|
|
99
|
+
lastDedupedShowSyncKey = viewSyncKey;
|
|
100
|
+
lastDedupedShowRequestId = showRequestId;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public void clearLoadRequestDedupePair() {
|
|
104
|
+
lastDedupedLoadSyncKey = DEDUPE_UNSET;
|
|
105
|
+
lastDedupedLoadRequestId = 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
public void clearShowRequestDedupePair() {
|
|
109
|
+
lastDedupedShowSyncKey = DEDUPE_UNSET;
|
|
110
|
+
lastDedupedShowRequestId = 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** 뷰 드롭 시 dedupe + sync 키 전부 초기화 */
|
|
114
|
+
public void resetRequestDedupeState() {
|
|
115
|
+
clearLoadRequestDedupePair();
|
|
116
|
+
clearShowRequestDedupePair();
|
|
117
|
+
viewSyncKey = -1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Fabric에서 prop 적용 순서가 바뀌어도 올바른 placement/template으로 로드하기 위해
|
|
122
|
+
* 이 래퍼 인스턴스에만 저장합니다.
|
|
123
|
+
*/
|
|
124
|
+
private String storedPlacementUid = "";
|
|
125
|
+
private String storedTemplateKey = "SMALL";
|
|
126
|
+
|
|
127
|
+
public String getStoredPlacementUid() {
|
|
128
|
+
return storedPlacementUid;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
public void setStoredPlacementUid(String storedPlacementUid) {
|
|
132
|
+
this.storedPlacementUid = storedPlacementUid != null ? storedPlacementUid : "";
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
public String getStoredTemplateKey() {
|
|
136
|
+
return storedTemplateKey;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
public void setStoredTemplateKey(String storedTemplateKey) {
|
|
140
|
+
this.storedTemplateKey = storedTemplateKey != null ? storedTemplateKey : "SMALL";
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
public int getAdId() {
|
|
144
|
+
return adId;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
public void setAdId(int adId) {
|
|
148
|
+
this.adId = adId;
|
|
149
|
+
}
|
|
150
|
+
|
|
14
151
|
@Override
|
|
15
152
|
public void requestLayout() {
|
|
16
153
|
super.requestLayout();
|
|
@@ -8,7 +8,7 @@ import net.adwhale.sdk.mediation.ads.AdWhaleNativeAdBinder;
|
|
|
8
8
|
* 간단한 네이티브 광고 바인더 팩토리 구현
|
|
9
9
|
* 레이아웃 리소스 ID와 각 View ID를 받아서 AdWhaleNativeAdBinder를 생성합니다.
|
|
10
10
|
*/
|
|
11
|
-
public class SimpleBinderFactory implements
|
|
11
|
+
public class SimpleBinderFactory implements BinderFactory {
|
|
12
12
|
private final int layoutId;
|
|
13
13
|
private final int iconViewId;
|
|
14
14
|
private final int titleViewId;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
package com.adwhalesdkreactnative.common;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 브릿지 맵/프롭 키 문자열.
|
|
5
|
+
* <p>
|
|
6
|
+
* Flutter {@code net.adwhale.sdk.adwhale_sdk_flutter.common.FlutterMethodArgConst} 와
|
|
7
|
+
* 동일한 이름·값을 가질 때는 필드명을 맞추고, RN 전용(예: TurboModule 응답 키)은 주석으로 구분합니다.
|
|
8
|
+
*/
|
|
9
|
+
public final class RNMethodArgConst {
|
|
10
|
+
|
|
11
|
+
private RNMethodArgConst() {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// --- Flutter SEND_* (성공/에러 페이로드 공통 키) ---
|
|
15
|
+
|
|
16
|
+
public static final String SEND_STATUS_CODE = "statusCode";
|
|
17
|
+
|
|
18
|
+
public static final String SEND_MESSAGE = "message";
|
|
19
|
+
|
|
20
|
+
/** Flutter {@code SEND_SUCCESS} — 값 {@code "success"} */
|
|
21
|
+
public static final String SEND_SUCCESS = "success";
|
|
22
|
+
|
|
23
|
+
public static final String SEND_CODE = "code";
|
|
24
|
+
|
|
25
|
+
/** Flutter 이벤트 채널 등에서 사용 */
|
|
26
|
+
public static final String SEND_EVENT_NAME = "eventName";
|
|
27
|
+
|
|
28
|
+
public static final String SEND_ERROR_MESSAGE = "errorMessage";
|
|
29
|
+
|
|
30
|
+
public static final String SEND_ERROR_CODE = "errorCode";
|
|
31
|
+
|
|
32
|
+
public static final String SEND_REWARD_AMOUNT = "RewardAmount";
|
|
33
|
+
|
|
34
|
+
public static final String SEND_REWARD_TYPE = "RewardType";
|
|
35
|
+
|
|
36
|
+
public static final String SEND_HEIGHT_PX = "heightPx";
|
|
37
|
+
|
|
38
|
+
public static final String SEND_REASON = "reason";
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* RN TurboModule initialize / requestGdprConsent / showAdInspector 응답에서 사용하는 성공 플래그.
|
|
42
|
+
* Flutter GDPR 응답은 {@link #SEND_SUCCESS}({@code success})를 씁니다.
|
|
43
|
+
*/
|
|
44
|
+
public static final String SEND_IS_SUCCESS = "isSuccess";
|
|
45
|
+
|
|
46
|
+
// --- RN getConsentStatus 응답 (Dart 와 키 정렬 시 참고) ---
|
|
47
|
+
|
|
48
|
+
public static final String SEND_COPPA = "coppa";
|
|
49
|
+
|
|
50
|
+
public static final String SEND_GDPR = "gdpr";
|
|
51
|
+
|
|
52
|
+
public static final String SEND_PERSONALIZED_CONSENT = "personalizedConsent";
|
|
53
|
+
|
|
54
|
+
/** React Native ViewManager direct event 등록용 */
|
|
55
|
+
public static final String SEND_REGISTRATION_NAME = "registrationName";
|
|
56
|
+
|
|
57
|
+
// --- Flutter RECEIVE_* (메서드 인자 / 옵션 맵) ---
|
|
58
|
+
|
|
59
|
+
public static final String RECEIVE_AD_ID = "adId";
|
|
60
|
+
|
|
61
|
+
public static final String RECEIVE_PLACEMENT_UID = "placementUid";
|
|
62
|
+
|
|
63
|
+
public static final String RECEIVE_RATING = "rating";
|
|
64
|
+
|
|
65
|
+
public static final String RECEIVE_HAS_CONSENT = "hasConsent";
|
|
66
|
+
|
|
67
|
+
public static final String RECEIVE_VALUE = "value";
|
|
68
|
+
|
|
69
|
+
public static final String RECEIVE_TFUA_MODE = "tfuaMode";
|
|
70
|
+
|
|
71
|
+
public static final String RECEIVE_IDS = "ids";
|
|
72
|
+
|
|
73
|
+
public static final String RECEIVE_REQUEST_ID = "requestId";
|
|
74
|
+
|
|
75
|
+
public static final String RECEIVE_IS_CHILD_DIRECTED = "isChildDirected";
|
|
76
|
+
|
|
77
|
+
public static final String RECEIVE_ENABLED = "enabled";
|
|
78
|
+
|
|
79
|
+
public static final String RECEIVE_IS_MUTED = "isMuted";
|
|
80
|
+
|
|
81
|
+
/** Flutter 필드명 그대로(오타 아님) */
|
|
82
|
+
public static final String RECEIVED_VOLUME = "volume";
|
|
83
|
+
|
|
84
|
+
public static final String RECEIVE_REGION = "region";
|
|
85
|
+
|
|
86
|
+
public static final String RECEIVE_GCODER = "gcoder";
|
|
87
|
+
|
|
88
|
+
public static final String RECEIVE_LT = "lt";
|
|
89
|
+
|
|
90
|
+
public static final String RECEIVE_LNG = "lng";
|
|
91
|
+
|
|
92
|
+
public static final String RECEIVE_PLACEMENT_NAME = "placementName";
|
|
93
|
+
|
|
94
|
+
public static final String RECEIVE_PRIMARY_BUTTON_TEXT = "primaryButtonText";
|
|
95
|
+
|
|
96
|
+
public static final String RECEIVE_SECONDARY_BUTTON_TEXT = "secondaryButtonText";
|
|
97
|
+
|
|
98
|
+
public static final String RECEIVE_CUSTOM_DESCRIPTION = "customDescription";
|
|
99
|
+
|
|
100
|
+
public static final String RECEIVE_OPTIONS = "options";
|
|
101
|
+
|
|
102
|
+
public static final String RECEIVE_ADAPTIVE_ANCHOR_WIDTH = "adaptiveAnchorWidth";
|
|
103
|
+
|
|
104
|
+
public static final String RECEIVE_ANDROID_PLACEMENT_UID = "androidPlacementUid";
|
|
105
|
+
|
|
106
|
+
/** Flutter 배너 옵션 맵 — 배너 높이 enum 문자열 */
|
|
107
|
+
public static final String RECEIVE_BANNER_HEIGHT = "bannerHeight";
|
|
108
|
+
|
|
109
|
+
public static final String RECEIVE_NATIVE_AD_OPTIONS = "nativeAdOptions";
|
|
110
|
+
|
|
111
|
+
public static final String RECEIVE_TEMPLATE_STYLE = "templateStyle";
|
|
112
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
package com.adwhalesdkreactnative.common;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TurboModule 메서드 이름, View prop 이름, 이벤트 이름.
|
|
5
|
+
* <p>
|
|
6
|
+
* Flutter {@code FlutterMethodCallConst} 와 문자열을 맞춥니다.
|
|
7
|
+
* RN ViewManager 전용 항목은 주석으로 표시합니다.
|
|
8
|
+
*/
|
|
9
|
+
public final class RNMethodCallConst {
|
|
10
|
+
|
|
11
|
+
private RNMethodCallConst() {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// --- 글로벌 SDK (TurboModule / AdwhaleSdkReactNative) — Flutter 와 동일 문자열 ---
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* TurboModule / RN codegen 이 생성하는 초기화 메서드명 ({@code initialize}).
|
|
18
|
+
* Flutter MethodChannel 은 {@link #FLUTTER_INIT} ({@code _init}) 를 씁니다.
|
|
19
|
+
*/
|
|
20
|
+
public static final String INITIALIZE = "initialize";
|
|
21
|
+
|
|
22
|
+
/** Flutter {@code FlutterMethodCallConst.INIT} — MethodChannel 전용 문자열 */
|
|
23
|
+
public static final String FLUTTER_INIT = "_init";
|
|
24
|
+
|
|
25
|
+
public static final String REQUEST_GDPR_CONSENT = "requestGdprConsent";
|
|
26
|
+
|
|
27
|
+
public static final String RESET_GDPR_CONSENT_STATUS = "resetGdprConsentStatus";
|
|
28
|
+
|
|
29
|
+
public static final String SET_GDPR = "setGdpr";
|
|
30
|
+
|
|
31
|
+
public static final String GET_CONSENT_STATUS = "getConsentStatus";
|
|
32
|
+
|
|
33
|
+
public static final String SET_TAG_FOR_UNDER_AGE_OF_CONSENT = "setTagForUnderAgeOfConsent";
|
|
34
|
+
|
|
35
|
+
public static final String SET_MAX_AD_CONTENT_RATING = "setMaxAdContentRating";
|
|
36
|
+
|
|
37
|
+
public static final String SET_TEST_DEVICE_IDENTIFIERS = "setTestDeviceIdentifiers";
|
|
38
|
+
|
|
39
|
+
public static final String SHOW_AD_INSPECTOR = "showAdInspector";
|
|
40
|
+
|
|
41
|
+
public static final String SET_COPPA = "setCoppa";
|
|
42
|
+
|
|
43
|
+
public static final String SET_LOGGER_ENABLED = "setLoggerEnabled";
|
|
44
|
+
|
|
45
|
+
public static final String GET_LOG_LEVEL = "getLogLevel";
|
|
46
|
+
|
|
47
|
+
public static final String SET_APP_MUTED = "setAppMuted";
|
|
48
|
+
|
|
49
|
+
public static final String SET_APP_VOLUME = "setAppVolume";
|
|
50
|
+
|
|
51
|
+
// --- Flutter MethodChannel: 배너 인스턴스 (adId 기반) — RN 에는 추후 TurboModule 로 추가 시 사용 ---
|
|
52
|
+
|
|
53
|
+
public static final String LOAD_BANNER_AD = "loadBannerAd";
|
|
54
|
+
|
|
55
|
+
public static final String RESUME_BANNER_AD = "resumeBannerAd";
|
|
56
|
+
|
|
57
|
+
public static final String PAUSE_BANNER_AD = "pauseBannerAd";
|
|
58
|
+
|
|
59
|
+
public static final String DESTROY_BANNER_AD = "destroyBannerAd";
|
|
60
|
+
|
|
61
|
+
/** 프리로드 배너 — RN Android 에는 아직 대응 View/모듈 없음, 상수만 Flutter 와 동기화 */
|
|
62
|
+
public static final String LOAD_PRELOAD_BANNER_AD = "loadPreloadBannerAd";
|
|
63
|
+
|
|
64
|
+
public static final String SHOW_PRELOAD_BANNER_AD = "showPreloadBannerAd";
|
|
65
|
+
|
|
66
|
+
public static final String RESUME_PRELOAD_BANNER_AD = "resumePreloadBannerAd";
|
|
67
|
+
|
|
68
|
+
public static final String PAUSE_PRELOAD_BANNER_AD = "pausePreloadBannerAd";
|
|
69
|
+
|
|
70
|
+
public static final String DESTROY_PRELOAD_BANNER_AD = "destroyPreloadBannerAd";
|
|
71
|
+
|
|
72
|
+
// --- RN 배너 ViewManager (RNAdWhaleMediationAdView) — Flutter 와 다른 API 형태 유지 ---
|
|
73
|
+
|
|
74
|
+
/** React prop: 광고 로드 트리거 (Flutter 의 loadBannerAd 와 역할 유사) */
|
|
75
|
+
public static final String LOAD_AD = "loadAd";
|
|
76
|
+
|
|
77
|
+
public static final String SHOW_AD = "showAd";
|
|
78
|
+
|
|
79
|
+
public static final String PLACEMENT_UID = "placementUid";
|
|
80
|
+
|
|
81
|
+
public static final String AD_SIZE = "adSize";
|
|
82
|
+
|
|
83
|
+
public static final String FACTORY_ID = "factoryId";
|
|
84
|
+
|
|
85
|
+
public static final String ON_AD_INSPECTOR_CLOSED = "onAdInspectorClosed";
|
|
86
|
+
|
|
87
|
+
public static final String ON_INIT_COMPLETE = "onInitComplete";
|
|
88
|
+
|
|
89
|
+
/** 배너/전면 등 공통 — Flutter {@code onAdLoaded} */
|
|
90
|
+
public static final String ON_AD_LOADED = "onAdLoaded";
|
|
91
|
+
|
|
92
|
+
/** Flutter {@code onAdLoadFailed} */
|
|
93
|
+
public static final String ON_AD_LOAD_FAILED = "onAdLoadFailed";
|
|
94
|
+
|
|
95
|
+
public static final String ON_AD_FAILED_TO_LOAD = "onAdFailedToLoad";
|
|
96
|
+
|
|
97
|
+
public static final String ON_AD_CLICKED = "onAdClicked";
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Native template / custom AdView direct events.
|
|
101
|
+
*/
|
|
102
|
+
public static final String ON_NATIVE_AD_LOADED = "onNativeAdLoaded";
|
|
103
|
+
|
|
104
|
+
public static final String ON_NATIVE_AD_FAILED_TO_LOAD = "onNativeAdFailedToLoad";
|
|
105
|
+
|
|
106
|
+
public static final String ON_NATIVE_AD_SHOW_FAILED = "onNativeAdShowFailed";
|
|
107
|
+
|
|
108
|
+
public static final String ON_NATIVE_AD_CLICKED = "onNativeAdClicked";
|
|
109
|
+
|
|
110
|
+
public static final String ON_NATIVE_AD_CLOSED = "onNativeAdClosed";
|
|
111
|
+
|
|
112
|
+
public static final String ON_NATIVE_AD_VIEW_HEIGHT = "onNativeAdViewHeight";
|
|
113
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package com.adwhalesdkreactnative.common;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* {@link com.facebook.react.bridge.Promise#reject(String, String)} 첫 인자로 쓰는 코드 문자열.
|
|
5
|
+
* Flutter {@code FlutterMethodResultConst} 와 동일한 값을 사용합니다.
|
|
6
|
+
*/
|
|
7
|
+
public final class RNMethodResultConst {
|
|
8
|
+
|
|
9
|
+
private RNMethodResultConst() {
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public static final String NO_ACTIVITY = "NoActivity";
|
|
13
|
+
|
|
14
|
+
public static final String INVALID_ARGS = "InvalidArgs";
|
|
15
|
+
|
|
16
|
+
public static final String NATIVE_AD_ERROR = "NativeAdError";
|
|
17
|
+
|
|
18
|
+
public static final String PRELOAD_BANNER_ERROR = "PreloadBannerError";
|
|
19
|
+
|
|
20
|
+
public static final String BANNER_AD_ERROR = "BannerAdError";
|
|
21
|
+
|
|
22
|
+
public static final String AD_SHOW_ERROR = "AdShowError";
|
|
23
|
+
|
|
24
|
+
public static final String OPEN_INSPECTOR_FAILED = "OpenInspectorFailed";
|
|
25
|
+
|
|
26
|
+
/** RN Logger 모듈 전용 — Flutter 와 동일한 PascalCase 패턴 */
|
|
27
|
+
public static final String GET_LOG_LEVEL_ERROR = "GetLogLevelError";
|
|
28
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
version = "0.81.1"
|
|
7
|
+
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
8
|
+
if version == '1000.0.0'
|
|
9
|
+
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
10
|
+
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
11
|
+
else
|
|
12
|
+
source[:tag] = "v#{version}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
Pod::Spec.new do |s|
|
|
16
|
+
s.name = "ReactAppDependencyProvider"
|
|
17
|
+
s.version = version
|
|
18
|
+
s.summary = "The third party dependency provider for the app"
|
|
19
|
+
s.homepage = "https://reactnative.dev/"
|
|
20
|
+
s.documentation_url = "https://reactnative.dev/"
|
|
21
|
+
s.license = "MIT"
|
|
22
|
+
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
23
|
+
s.platforms = min_supported_versions
|
|
24
|
+
s.source = source
|
|
25
|
+
s.source_files = "**/RCTAppDependencyProvider.{h,mm}"
|
|
26
|
+
|
|
27
|
+
# This guard prevent to install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
+
s.pod_target_xcconfig = {
|
|
29
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
30
|
+
"DEFINES_MODULE" => "YES"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
s.dependency "ReactCodegen"
|
|
34
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import UIKit
|
|
3
|
+
import AdWhaleSDK
|
|
4
|
+
|
|
5
|
+
/// Flutter iOS 인터페이스와 동일한 이름/역할:
|
|
6
|
+
/// - AdWhaleNativeAdViewFactory
|
|
7
|
+
/// - AdWhaleBlockNativeAdViewFactory
|
|
8
|
+
/// - registerNativeAdViewFactory(id:factory:)
|
|
9
|
+
@objc public protocol AdWhaleNativeAdViewFactory: AnyObject {
|
|
10
|
+
func make(frame: CGRect) -> AdWhaleNativeAdView
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@objcMembers
|
|
14
|
+
public final class AdWhaleBlockNativeAdViewFactory: NSObject, AdWhaleNativeAdViewFactory {
|
|
15
|
+
private let builder: (CGRect) -> AdWhaleNativeAdView
|
|
16
|
+
|
|
17
|
+
public init(builder: @escaping (CGRect) -> AdWhaleNativeAdView) {
|
|
18
|
+
self.builder = builder
|
|
19
|
+
super.init()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public func make(frame: CGRect) -> AdWhaleNativeAdView {
|
|
23
|
+
builder(frame)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
enum AdWhaleNativeAdViewFactoryRegistry {
|
|
28
|
+
private static var factories: [String: AdWhaleNativeAdViewFactory] = [:]
|
|
29
|
+
|
|
30
|
+
static func register(id: String, factory: AdWhaleNativeAdViewFactory) {
|
|
31
|
+
factories[id] = factory
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static func factory(for id: String) -> AdWhaleNativeAdViewFactory? {
|
|
35
|
+
factories[id]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@objcMembers
|
|
40
|
+
public final class AdWhaleNativeCustomViewFactoryRegistry: NSObject {
|
|
41
|
+
/// Flutter 스타일 메서드명 alias (RN에서는 registry 클래스로 노출)
|
|
42
|
+
public static func registerNativeAdViewFactory(_ id: String, factory: AdWhaleNativeAdViewFactory) {
|
|
43
|
+
AdWhaleNativeAdViewFactoryRegistry.register(id: id, factory: factory)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/// 기존 RN 예제와의 하위 호환 API
|
|
47
|
+
public static func register(factoryId: String, factory: @escaping () -> AdWhaleNativeAdView) {
|
|
48
|
+
let adapter = AdWhaleBlockNativeAdViewFactory { _ in factory() }
|
|
49
|
+
AdWhaleNativeAdViewFactoryRegistry.register(id: factoryId, factory: adapter)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public static func make(factoryId: String, frame: CGRect) -> AdWhaleNativeAdView? {
|
|
53
|
+
AdWhaleNativeAdViewFactoryRegistry.factory(for: factoryId)?.make(frame: frame)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
@@ -1,16 +1,107 @@
|
|
|
1
1
|
#import "AdwhaleSdkReactNative.h"
|
|
2
|
+
#import <AdwhaleSdkReactNativeSpec/AdwhaleSdkReactNativeSpec.h>
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
// …-Swift.h 안에 RNAdWhaleMediationAdViewManager·WhaleMediationBannerContainer 선언이 같이 나가므로,
|
|
5
|
+
// Swift 헤더보다 아래를 먼저 넣어야 RCT* / AdWhale* 타입이 해석됨.
|
|
6
|
+
#import <GoogleMobileAds/GoogleMobileAds.h>
|
|
7
|
+
#if __has_include(<AdWhaleSDK/AdWhaleSDK-Swift.h>)
|
|
8
|
+
#import <AdWhaleSDK/AdWhaleSDK-Swift.h>
|
|
9
|
+
#else
|
|
10
|
+
#import "AdWhaleSDK-Swift.h"
|
|
11
|
+
#endif
|
|
12
|
+
#import <React/RCTComponent.h>
|
|
13
|
+
#import <React/RCTViewManager.h>
|
|
6
14
|
|
|
7
|
-
|
|
15
|
+
#if __has_include(<AdwhaleSdkReactNative/AdwhaleSdkReactNative-Swift.h>)
|
|
16
|
+
#import <AdwhaleSdkReactNative/AdwhaleSdkReactNative-Swift.h>
|
|
17
|
+
#else
|
|
18
|
+
#import "AdwhaleSdkReactNative-Swift.h"
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
@implementation AdwhaleSdkReactNative {
|
|
22
|
+
AdwhaleSdkReactNativeModule *_impl;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
- (instancetype)init
|
|
26
|
+
{
|
|
27
|
+
if ((self = [super init])) {
|
|
28
|
+
_impl = [[AdwhaleSdkReactNativeModule alloc] init];
|
|
29
|
+
}
|
|
30
|
+
return self;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#pragma mark - NativeAdwhaleSdkReactNativeSpec
|
|
34
|
+
|
|
35
|
+
- (void)_init:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject
|
|
36
|
+
{
|
|
37
|
+
[_impl initializeWithResolve:resolve reject:reject];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/// JS `NativeAdwhaleSdkReactNative.initialize()` → ObjC `initialize:reject:` (codegen 스펙은 `_init` 일 수 있음)
|
|
41
|
+
- (void)initialize:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject
|
|
42
|
+
{
|
|
43
|
+
[_impl initializeWithResolve:resolve reject:reject];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
- (void)setCoppa:(BOOL)isEnabled
|
|
47
|
+
{
|
|
48
|
+
[_impl setCoppa:isEnabled];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
- (void)requestGdprConsent:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject
|
|
52
|
+
{
|
|
53
|
+
[_impl requestGdprConsent:resolve reject:reject];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
- (void)getConsentStatus:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject
|
|
57
|
+
{
|
|
58
|
+
[_impl getConsentStatus:resolve reject:reject];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
- (void)resetGdprConsentStatus
|
|
62
|
+
{
|
|
63
|
+
[_impl resetGdprConsentStatus];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
- (void)setGdpr:(BOOL)consent
|
|
67
|
+
{
|
|
68
|
+
[_impl setGdpr:consent];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
- (void)setTagForUnderAgeOfConsent:(BOOL)tag
|
|
72
|
+
{
|
|
73
|
+
[_impl setTagForUnderAgeOfConsent:tag];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
- (void)setMaxAdContentRating:(NSString *)rating
|
|
77
|
+
{
|
|
78
|
+
[_impl setMaxAdContentRating:rating];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
- (void)setTestDeviceIdentifiers:(NSArray *)testDeviceIds
|
|
82
|
+
{
|
|
83
|
+
[_impl setTestDeviceIdentifiers:testDeviceIds];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
- (void)showAdInspector:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject
|
|
87
|
+
{
|
|
88
|
+
[_impl showAdInspector:resolve reject:reject];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
- (void)setAppMuted:(BOOL)isMuted
|
|
92
|
+
{
|
|
93
|
+
[_impl setAppMuted:isMuted];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
- (void)setAppVolume:(double)volume
|
|
97
|
+
{
|
|
98
|
+
[_impl setAppVolume:volume];
|
|
8
99
|
}
|
|
9
100
|
|
|
10
101
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
11
102
|
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
12
103
|
{
|
|
13
|
-
|
|
104
|
+
return std::make_shared<facebook::react::NativeAdwhaleSdkReactNativeSpecJSI>(params);
|
|
14
105
|
}
|
|
15
106
|
|
|
16
107
|
+ (NSString *)moduleName
|