@cc-component/cc-ex-component 1.2.6 → 1.2.8
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/assets/core/ReferenceComponent.ts +24 -17
- package/assets/core/ViewModel.ts +50 -6
- package/package.json +1 -1
- package/assets/platform/Interface.ts +0 -80
- package/assets/platform/Interface.ts.meta +0 -9
- package/assets/platform/android/AndroidModule.ts +0 -12
- package/assets/platform/android/AndroidModule.ts.meta +0 -9
- package/assets/platform/android/AndroidSDK.ts +0 -186
- package/assets/platform/android/AndroidSDK.ts.meta +0 -1
- package/assets/platform/android/AnyThinkAds/ATBanner.ts +0 -266
- package/assets/platform/android/AnyThinkAds/ATBanner.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/ATInterstitial.ts +0 -185
- package/assets/platform/android/AnyThinkAds/ATInterstitial.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/ATInterstitialAuto.ts +0 -180
- package/assets/platform/android/AnyThinkAds/ATInterstitialAuto.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/ATNative.ts +0 -256
- package/assets/platform/android/AnyThinkAds/ATNative.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/ATRewardedAutoVideo.ts +0 -175
- package/assets/platform/android/AnyThinkAds/ATRewardedAutoVideo.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/ATRewardedVideo.ts +0 -243
- package/assets/platform/android/AnyThinkAds/ATRewardedVideo.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/ATSDK.ts +0 -222
- package/assets/platform/android/AnyThinkAds/ATSDK.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/ATSplash.ts +0 -155
- package/assets/platform/android/AnyThinkAds/ATSplash.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidBannerTS.ts +0 -71
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidBannerTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidInterstitialAutoTS.ts +0 -52
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidInterstitialAutoTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidInterstitialTS.ts +0 -41
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidInterstitialTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidNativeTS.ts +0 -47
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidNativeTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidRewardedVideoAutoTS.ts +0 -52
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidRewardedVideoAutoTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidRewardedVideoTS.ts +0 -41
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidRewardedVideoTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidSplashTS.ts +0 -42
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidSplashTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidTS.ts +0 -73
- package/assets/platform/android/AnyThinkAds/Android/ATAndroidTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/Android.meta +0 -9
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSBannerTS.ts +0 -66
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSBannerTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSInterstitiaAutolTS.ts +0 -54
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSInterstitiaAutolTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSInterstitialTS.ts +0 -43
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSInterstitialTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSNativeTS.ts +0 -47
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSNativeTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSRewardedAutoVideoTS.ts +0 -55
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSRewardedAutoVideoTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSRewardedVideoTS.ts +0 -43
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSRewardedVideoTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSSplashTS.ts +0 -47
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSSplashTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSTS.ts +0 -76
- package/assets/platform/android/AnyThinkAds/iOS/ATiOSTS.ts.meta +0 -9
- package/assets/platform/android/AnyThinkAds/iOS.meta +0 -9
- package/assets/platform/android/AnyThinkAds.meta +0 -9
- package/assets/platform/android/iOSSDK.ts +0 -14
- package/assets/platform/android/iOSSDK.ts.meta +0 -1
- package/assets/platform/android.meta +0 -11
- package/assets/platform/base/EditorSDK.ts +0 -30
- package/assets/platform/base/EditorSDK.ts.meta +0 -1
- package/assets/platform/base/PlatfprmModule.ts +0 -152
- package/assets/platform/base/PlatfprmModule.ts.meta +0 -9
- package/assets/platform/base/SDKBase.ts +0 -59
- package/assets/platform/base/SDKBase.ts.meta +0 -9
- package/assets/platform/base/SDKEnum.ts +0 -127
- package/assets/platform/base/SDKEnum.ts.meta +0 -9
- package/assets/platform/base/TTSDK.ts +0 -366
- package/assets/platform/base/TTSDK.ts.meta +0 -9
- package/assets/platform/base/WXSDK.ts +0 -149
- package/assets/platform/base/WXSDK.ts.meta +0 -1
- package/assets/platform/base.meta +0 -9
- package/assets/platform/wx/MiniSDK.ts +0 -1039
- package/assets/platform/wx/MiniSDK.ts.meta +0 -9
- package/assets/platform/wx/lib.douyin.d.ts +0 -168
- package/assets/platform/wx/lib.douyin.d.ts.meta +0 -9
- package/assets/platform/wx/wxmini.d.ts +0 -2452
- package/assets/platform/wx/wxmini.d.ts.meta +0 -9
- package/assets/platform/wx.meta +0 -9
- package/assets/platform.meta +0 -9
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import {ATAndroidBannerTS} from "./Android/ATAndroidBannerTS";
|
|
2
|
-
import {ATiOSBannerTS} from "./iOS/ATiOSBannerTS";
|
|
3
|
-
import {sys} from 'cc';
|
|
4
|
-
|
|
5
|
-
const initPlatformBridge = function () {
|
|
6
|
-
if (sys.os === sys.OS.IOS) {
|
|
7
|
-
return ATiOSBannerTS;
|
|
8
|
-
} else if (sys.os === sys.OS.ANDROID) {
|
|
9
|
-
return ATAndroidBannerTS;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const platformBridge = initPlatformBridge();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export const ATBannerSDK = {
|
|
17
|
-
kATBannerAdLoadingExtraBannerAdSizeStruct: "banner_ad_size_struct",
|
|
18
|
-
kATBannerAdShowingPositionTop: "top",
|
|
19
|
-
kATBannerAdShowingPositionBottom: "bottom",
|
|
20
|
-
|
|
21
|
-
kATBannerAdInlineAdaptiveWidth: "inline_adaptive_width",
|
|
22
|
-
kATBannerAdInlineAdaptiveOrientation: "inline_adaptive_orientation",
|
|
23
|
-
kATBannerAdInlineAdaptiveOrientationCurrent: 0,
|
|
24
|
-
kATBannerAdInlineAdaptiveOrientationPortrait: 1,
|
|
25
|
-
kATBannerAdInlineAdaptiveOrientationLandscape: 2,
|
|
26
|
-
|
|
27
|
-
kATBannerAdAdaptiveWidth: "adaptive_width",
|
|
28
|
-
kATBannerAdAdaptiveOrientation: "adaptive_orientation",
|
|
29
|
-
kATBannerAdAdaptiveOrientationCurrent: 0,
|
|
30
|
-
kATBannerAdAdaptiveOrientationPortrait: 1,
|
|
31
|
-
kATBannerAdAdaptiveOrientationLandscape: 2,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
ATBannerListener: {
|
|
35
|
-
developerCallback: null, onBannerAdLoaded: function (placementId: any) {
|
|
36
|
-
if (this.developerCallback != null && this.developerCallback.onBannerAdLoaded != null) {
|
|
37
|
-
this.developerCallback.onBannerAdLoaded(placementId);
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
onBannerAdLoadFail: function (placementId: any, errorInfo: any) {
|
|
42
|
-
if (this.developerCallback != null && this.developerCallback.onBannerAdLoadFail != null) {
|
|
43
|
-
this.developerCallback.onBannerAdLoadFail(placementId, errorInfo);
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
onBannerAdShow: function (placementId: any, callbackInfo: any) {
|
|
48
|
-
if (this.developerCallback != null && this.developerCallback.onBannerAdShow != null) {
|
|
49
|
-
this.developerCallback.onBannerAdShow(placementId, callbackInfo);
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
onBannerAdClick: function (placementId: any, callbackInfo: any) {
|
|
54
|
-
if (this.developerCallback != null && this.developerCallback.onBannerAdClick != null) {
|
|
55
|
-
this.developerCallback.onBannerAdClick(placementId, callbackInfo);
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
onBannerAdAutoRefresh: function (placementId: any, callbackInfo: any) {
|
|
60
|
-
if (this.developerCallback != null && this.developerCallback.onBannerAdAutoRefresh != null) {
|
|
61
|
-
this.developerCallback.onBannerAdAutoRefresh(placementId, callbackInfo);
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
onBannerAdAutoRefreshFail: function (placementId: any, errorInfo: any) {
|
|
66
|
-
if (this.developerCallback != null && this.developerCallback.onBannerAdAutoRefreshFail != null) {
|
|
67
|
-
this.developerCallback.onBannerAdAutoRefreshFail(placementId, errorInfo);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
onBannerAdCloseButtonTapped: function (placementId: any, callbackInfo: any) {
|
|
72
|
-
if (this.developerCallback != null && this.developerCallback.onBannerAdCloseButtonTapped != null) {
|
|
73
|
-
this.developerCallback.onBannerAdCloseButtonTapped(placementId, callbackInfo);
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
//added v5.8.10
|
|
78
|
-
onAdSourceBiddingAttempt: function (placementId: any, callbackInfo: any) {
|
|
79
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingAttempt != null) {
|
|
80
|
-
this.developerCallback.onAdSourceBiddingAttempt(placementId, callbackInfo);
|
|
81
|
-
}
|
|
82
|
-
}, onAdSourceBiddingFilled: function (placementId: any, callbackInfo: any) {
|
|
83
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFilled != null) {
|
|
84
|
-
this.developerCallback.onAdSourceBiddingFilled(placementId, callbackInfo);
|
|
85
|
-
}
|
|
86
|
-
}, onAdSourceBiddingFail: function (placementId: any, errorInfo: any, callbackInfo: any) {
|
|
87
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFail != null) {
|
|
88
|
-
this.developerCallback.onAdSourceBiddingFail(placementId, errorInfo, callbackInfo);
|
|
89
|
-
}
|
|
90
|
-
}, onAdSourceAttemp: function (placementId: any, callbackInfo: any) {
|
|
91
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceAttemp != null) {
|
|
92
|
-
this.developerCallback.onAdSourceAttemp(placementId, callbackInfo);
|
|
93
|
-
}
|
|
94
|
-
}, onAdSourceLoadFilled: function (placementId: any, callbackInfo: any) {
|
|
95
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFilled != null) {
|
|
96
|
-
this.developerCallback.onAdSourceLoadFilled(placementId, callbackInfo);
|
|
97
|
-
}
|
|
98
|
-
}, onAdSourceLoadFail: function (placementId: any, errorInfo: any, callbackInfo: any) {
|
|
99
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFail != null) {
|
|
100
|
-
this.developerCallback.onAdSourceLoadFail(placementId, errorInfo, callbackInfo);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
loadAd: function (placementId: any, settings = {}) {
|
|
107
|
-
if (undefined != platformBridge) {
|
|
108
|
-
if (settings.hasOwnProperty(ATBannerSDK.kATBannerAdLoadingExtraBannerAdSizeStruct)) {
|
|
109
|
-
const loadAdSize = settings[ATBannerSDK.kATBannerAdLoadingExtraBannerAdSizeStruct];
|
|
110
|
-
settings["width"] = loadAdSize["width"];
|
|
111
|
-
settings["height"] = loadAdSize["height"];
|
|
112
|
-
}
|
|
113
|
-
platformBridge.loadBanner(placementId, JSON.stringify(settings));
|
|
114
|
-
} else {
|
|
115
|
-
console.log("You must run on Android or iOS.");
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
setAdListener: function (listener: any) {
|
|
120
|
-
const eventJSON = {};
|
|
121
|
-
eventJSON[LoadedCallbackKey] = "ATBannerSDK.ATBannerListener.onBannerAdLoaded",
|
|
122
|
-
eventJSON[LoadFailCallbackKey] = "ATBannerSDK.ATBannerListener.onBannerAdLoadFail",
|
|
123
|
-
eventJSON[CloseCallbackKey] = "ATBannerSDK.ATBannerListener.onBannerAdCloseButtonTapped",
|
|
124
|
-
eventJSON[ClickCallbackKey] = "ATBannerSDK.ATBannerListener.onBannerAdClick",
|
|
125
|
-
eventJSON[ShowCallbackKey] = "ATBannerSDK.ATBannerListener.onBannerAdShow",
|
|
126
|
-
eventJSON[RefreshCallbackKey] = "ATBannerSDK.ATBannerListener.onBannerAdAutoRefresh",
|
|
127
|
-
eventJSON[RefreshFailCallbackKey] = "ATBannerSDK.ATBannerListener.onBannerAdAutoRefreshFail",
|
|
128
|
-
|
|
129
|
-
//added v5.8.10
|
|
130
|
-
eventJSON[BiddingAttempt] = "ATBannerSDK.ATBannerListener.onAdSourceBiddingAttempt",
|
|
131
|
-
eventJSON[BiddingFilled] = "ATBannerSDK.ATBannerListener.onAdSourceBiddingFilled",
|
|
132
|
-
eventJSON[BiddingFail] = "ATBannerSDK.ATBannerListener.onAdSourceBiddingFail",
|
|
133
|
-
eventJSON[Attemp] = "ATBannerSDK.ATBannerListener.onAdSourceAttemp",
|
|
134
|
-
eventJSON[LoadFilled] = "ATBannerSDK.ATBannerListener.onAdSourceLoadFilled",
|
|
135
|
-
eventJSON[LoadFail] = "ATBannerSDK.ATBannerListener.onAdSourceLoadFail"
|
|
136
|
-
|
|
137
|
-
if (undefined != platformBridge) {
|
|
138
|
-
platformBridge.setAdListener(JSON.stringify(eventJSON));
|
|
139
|
-
} else {
|
|
140
|
-
console.log("You must run on Android or iOS.");
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
this.ATBannerListener.developerCallback = listener;
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
hasAdReady: function (placementId: any) {
|
|
147
|
-
if (undefined != platformBridge) {
|
|
148
|
-
try {
|
|
149
|
-
return platformBridge.hasAdReady(placementId);
|
|
150
|
-
} catch (e) {
|
|
151
|
-
console.error("anythink hasAdReady: " + e.toString());
|
|
152
|
-
}
|
|
153
|
-
} else {
|
|
154
|
-
console.log("You must run on Android or iOS.");
|
|
155
|
-
}
|
|
156
|
-
return false;
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
checkAdStatus: function (placementId: any) {
|
|
160
|
-
if (undefined != platformBridge) {
|
|
161
|
-
return platformBridge.checkAdStatus(placementId);
|
|
162
|
-
} else {
|
|
163
|
-
console.log("You must run on Android or iOS.");
|
|
164
|
-
}
|
|
165
|
-
return "";
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
showAdInPosition: function (placementId: any, position: any) {
|
|
169
|
-
if (undefined != platformBridge) {
|
|
170
|
-
platformBridge.showAdInPosition(placementId, position);
|
|
171
|
-
} else {
|
|
172
|
-
console.log("You must run on Android or iOS.");
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
showAdInPositionAndScenario: function (placementId: any, position: any, scenario: any) {
|
|
177
|
-
if (undefined != platformBridge) {
|
|
178
|
-
platformBridge.showAdInPositionAndScenario(placementId, position, scenario);
|
|
179
|
-
} else {
|
|
180
|
-
console.log("You must run on Android or iOS.");
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
showAdInRectangle: function (placementId: any, showAdRect: any) {
|
|
185
|
-
if (undefined != platformBridge) {
|
|
186
|
-
platformBridge.showAdInRectangle(placementId, JSON.stringify(showAdRect));
|
|
187
|
-
} else {
|
|
188
|
-
console.log("You must run on Android or iOS.");
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
showAdInRectangleAndScenario: function (placementId: any, showAdRect: any, scenario: any) {
|
|
193
|
-
if (undefined != platformBridge) {
|
|
194
|
-
platformBridge.showAdInRectangleAndScenario(placementId, JSON.stringify(showAdRect), scenario);
|
|
195
|
-
} else {
|
|
196
|
-
console.log("You must run on Android or iOS.");
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
|
|
200
|
-
removeAd: function (placementId: any) {
|
|
201
|
-
if (undefined != platformBridge) {
|
|
202
|
-
platformBridge.removeAd(placementId);
|
|
203
|
-
} else {
|
|
204
|
-
console.log("You must run on Android or iOS.");
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
|
|
208
|
-
reShowAd: function (placementId: any) {
|
|
209
|
-
if (undefined != platformBridge) {
|
|
210
|
-
platformBridge.reShowAd(placementId);
|
|
211
|
-
} else {
|
|
212
|
-
console.log("You must run on Android or iOS.");
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
|
|
216
|
-
hideAd: function (placementId: any) {
|
|
217
|
-
if (undefined != platformBridge) {
|
|
218
|
-
platformBridge.hideAd(placementId);
|
|
219
|
-
} else {
|
|
220
|
-
console.log("You must run on Android or iOS.");
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
createLoadAdSize: function (width: any, height: any) {
|
|
225
|
-
const loadAdSize = {};
|
|
226
|
-
loadAdSize["width"] = width;
|
|
227
|
-
loadAdSize["height"] = height;
|
|
228
|
-
return loadAdSize;
|
|
229
|
-
},
|
|
230
|
-
|
|
231
|
-
createShowAdRect: function (x: any, y: any, width: any, height: any) {
|
|
232
|
-
const adRect = {};
|
|
233
|
-
adRect["x"] = x;
|
|
234
|
-
adRect["y"] = y;
|
|
235
|
-
adRect["width"] = width;
|
|
236
|
-
adRect["height"] = height;
|
|
237
|
-
return adRect;
|
|
238
|
-
},
|
|
239
|
-
|
|
240
|
-
entryAdScenario: function (placementId: any, scenario: any) {
|
|
241
|
-
if (undefined != platformBridge) {
|
|
242
|
-
platformBridge.entryAdScenario(placementId, scenario);
|
|
243
|
-
} else {
|
|
244
|
-
console.log("You must run on Android or iOS.");
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
const LoadedCallbackKey = "BannerLoaded";
|
|
252
|
-
const LoadFailCallbackKey = "BannerLoadFail";
|
|
253
|
-
const CloseCallbackKey = "BannerCloseButtonTapped";
|
|
254
|
-
const ClickCallbackKey = "BannerClick";
|
|
255
|
-
const ShowCallbackKey = "BannerShow";
|
|
256
|
-
const RefreshCallbackKey = "BannerRefresh";
|
|
257
|
-
const RefreshFailCallbackKey = "BannerRefreshFail";
|
|
258
|
-
|
|
259
|
-
const BiddingAttempt = "BannerBiddingAttempt";
|
|
260
|
-
const BiddingFilled = "BannerBiddingFilled";
|
|
261
|
-
const BiddingFail = "BannerBiddingFail";
|
|
262
|
-
const Attemp = "BannerAttemp";
|
|
263
|
-
const LoadFilled = "BannerLoadFilled";
|
|
264
|
-
const LoadFail = "BannerLoadFail";
|
|
265
|
-
|
|
266
|
-
window["ATBannerSDK"] = ATBannerSDK;
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import {ATAndroidInterstitialTS} from "./Android/ATAndroidInterstitialTS";
|
|
2
|
-
import {ATiOSInterstitialTS} from "./iOS/ATiOSInterstitialTS";
|
|
3
|
-
import {sys} from 'cc';
|
|
4
|
-
|
|
5
|
-
const initPlatformBridge = function () {
|
|
6
|
-
if (sys.os === sys.OS.IOS) {
|
|
7
|
-
return ATiOSInterstitialTS;
|
|
8
|
-
} else if (sys.os === sys.OS.ANDROID) {
|
|
9
|
-
return ATAndroidInterstitialTS;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const platformBridge = initPlatformBridge();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export const ATInterstitialSDK = {
|
|
17
|
-
|
|
18
|
-
UseInterstitialAsInterstitial: "UseInterstitialAsInterstitial",
|
|
19
|
-
|
|
20
|
-
ATInterstitialListener: {
|
|
21
|
-
developerCallback: null, onInterstitialAdLoaded: function (placementId: any) {
|
|
22
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdLoaded != null) {
|
|
23
|
-
this.developerCallback.onInterstitialAdLoaded(placementId);
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
onInterstitialAdLoadFail: function (placementId: any, errorInfo: any) {
|
|
28
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdLoadFail != null) {
|
|
29
|
-
this.developerCallback.onInterstitialAdLoadFail(placementId, errorInfo);
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
onInterstitialAdShow: function (placementId: any, callbackInfo: any) {
|
|
34
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdShow != null) {
|
|
35
|
-
this.developerCallback.onInterstitialAdShow(placementId, callbackInfo);
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
onInterstitialAdStartPlayingVideo: function (placementId: any, callbackInfo: any) {
|
|
40
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdStartPlayingVideo != null) {
|
|
41
|
-
this.developerCallback.onInterstitialAdStartPlayingVideo(placementId, callbackInfo);
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
onInterstitialAdEndPlayingVideo: function (placementId: any, callbackInfo: any) {
|
|
46
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdEndPlayingVideo != null) {
|
|
47
|
-
this.developerCallback.onInterstitialAdEndPlayingVideo(placementId, callbackInfo);
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
onInterstitialAdFailedToPlayVideo: function (placementId: any, errorInfo: any) {
|
|
52
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdFailedToPlayVideo != null) {
|
|
53
|
-
this.developerCallback.onInterstitialAdFailedToPlayVideo(placementId, errorInfo);
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
onInterstitialAdFailedToShow: function (placementId: any, errorInfo: any, callbackInfo: any) {
|
|
58
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdFailedToShow != null) {
|
|
59
|
-
this.developerCallback.onInterstitialAdFailedToShow(placementId, errorInfo, callbackInfo);
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
onInterstitialAdClose: function (placementId: any, callbackInfo: any) {
|
|
64
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdClose != null) {
|
|
65
|
-
this.developerCallback.onInterstitialAdClose(placementId, callbackInfo);
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
onInterstitialAdClick: function (placementId: any, callbackInfo: any) {
|
|
70
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdClick != null) {
|
|
71
|
-
this.developerCallback.onInterstitialAdClick(placementId, callbackInfo);
|
|
72
|
-
}
|
|
73
|
-
}, //added v5.8.10
|
|
74
|
-
onAdSourceBiddingAttempt: function (placementId: any, callbackInfo: any) {
|
|
75
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingAttempt != null) {
|
|
76
|
-
this.developerCallback.onAdSourceBiddingAttempt(placementId, callbackInfo);
|
|
77
|
-
}
|
|
78
|
-
}, onAdSourceBiddingFilled: function (placementId: any, callbackInfo: any) {
|
|
79
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFilled != null) {
|
|
80
|
-
this.developerCallback.onAdSourceBiddingFilled(placementId, callbackInfo);
|
|
81
|
-
}
|
|
82
|
-
}, onAdSourceBiddingFail: function (placementId: any, errorInfo: any, callbackInfo: any) {
|
|
83
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFail != null) {
|
|
84
|
-
this.developerCallback.onAdSourceBiddingFail(placementId, errorInfo, callbackInfo);
|
|
85
|
-
}
|
|
86
|
-
}, onAdSourceAttemp: function (placementId: any, callbackInfo: any) {
|
|
87
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceAttemp != null) {
|
|
88
|
-
this.developerCallback.onAdSourceAttemp(placementId, callbackInfo);
|
|
89
|
-
}
|
|
90
|
-
}, onAdSourceLoadFilled: function (placementId: any, callbackInfo: any) {
|
|
91
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFilled != null) {
|
|
92
|
-
this.developerCallback.onAdSourceLoadFilled(placementId, callbackInfo);
|
|
93
|
-
}
|
|
94
|
-
}, onAdSourceLoadFail: function (placementId: any, errorInfo: any, callbackInfo: any) {
|
|
95
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFail != null) {
|
|
96
|
-
this.developerCallback.onAdSourceLoadFail(placementId, errorInfo, callbackInfo);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
loadAd: function (placementId: any, settings = {}) {
|
|
103
|
-
|
|
104
|
-
if (platformBridge != null) {
|
|
105
|
-
platformBridge.loadInterstitial(placementId, JSON.stringify(settings));
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
setAdListener: function (listener: any) {
|
|
110
|
-
const eventJSON = {};
|
|
111
|
-
eventJSON[LoadedCallbackKey] = "ATInterstitialSDK.ATInterstitialListener.onInterstitialAdLoaded", eventJSON[LoadFailCallbackKey] = "ATInterstitialSDK.ATInterstitialListener.onInterstitialAdLoadFail", eventJSON[PlayStartCallbackKey] = "ATInterstitialSDK.ATInterstitialListener.onInterstitialAdStartPlayingVideo", eventJSON[PlayEndCallbackKey] = "ATInterstitialSDK.ATInterstitialListener.onInterstitialAdEndPlayingVideo", eventJSON[PlayFailCallbackKey] = "ATInterstitialSDK.ATInterstitialListener.onInterstitialAdFailedToPlayVideo", eventJSON[CloseCallbackKey] = "ATInterstitialSDK.ATInterstitialListener.onInterstitialAdClose", eventJSON[ClickCallbackKey] = "ATInterstitialSDK.ATInterstitialListener.onInterstitialAdClick", eventJSON[ShowCallbackKey] = "ATInterstitialSDK.ATInterstitialListener.onInterstitialAdShow", eventJSON[ShowFailCallbackKey] = "ATInterstitialSDK.ATInterstitialListener.onInterstitialAdFailedToShow", //added v5.8.10
|
|
112
|
-
eventJSON[BiddingAttempt] = "ATInterstitialSDK.ATInterstitialListener.onAdSourceBiddingAttempt", eventJSON[BiddingFilled] = "ATInterstitialSDK.ATInterstitialListener.onAdSourceBiddingFilled", eventJSON[BiddingFail] = "ATInterstitialSDK.ATInterstitialListener.onAdSourceBiddingFail", eventJSON[Attemp] = "ATInterstitialSDK.ATInterstitialListener.onAdSourceAttemp", eventJSON[LoadFilled] = "ATInterstitialSDK.ATInterstitialListener.onAdSourceLoadFilled", eventJSON[LoadFail] = "ATInterstitialSDK.ATInterstitialListener.onAdSourceLoadFail"
|
|
113
|
-
|
|
114
|
-
if (undefined != platformBridge) {
|
|
115
|
-
platformBridge.setAdListener(JSON.stringify(eventJSON));
|
|
116
|
-
} else {
|
|
117
|
-
console.log("You must run on Android or iOS.");
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
this.ATInterstitialListener.developerCallback = listener;
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
hasAdReady: function (placementId: any) {
|
|
124
|
-
if (undefined != platformBridge) {
|
|
125
|
-
return platformBridge.hasAdReady(placementId);
|
|
126
|
-
} else {
|
|
127
|
-
console.log("You must run on Android or iOS.");
|
|
128
|
-
}
|
|
129
|
-
return false;
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
checkAdStatus: function (placementId: any) {
|
|
133
|
-
if (undefined != platformBridge) {
|
|
134
|
-
return platformBridge.checkAdStatus(placementId);
|
|
135
|
-
} else {
|
|
136
|
-
console.log("You must run on Android or iOS.");
|
|
137
|
-
}
|
|
138
|
-
return "";
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
showAd: function (placementId: any) {
|
|
142
|
-
if (undefined != platformBridge) {
|
|
143
|
-
platformBridge.showAd(placementId);
|
|
144
|
-
} else {
|
|
145
|
-
console.log("You must run on Android or iOS.");
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
showAdInScenario: function (placementId: any, scenario: any) {
|
|
150
|
-
if (undefined != platformBridge) {
|
|
151
|
-
platformBridge.showAdInScenario(placementId, scenario);
|
|
152
|
-
} else {
|
|
153
|
-
console.log("You must run on Android or iOS.");
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
entryAdScenario: function (placementId: any, scenario: any) {
|
|
158
|
-
if (undefined != platformBridge) {
|
|
159
|
-
platformBridge.entryAdScenario(placementId, scenario);
|
|
160
|
-
} else {
|
|
161
|
-
console.log("You must run on Android or iOS.");
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
const LoadedCallbackKey = "InterstitialLoaded";
|
|
169
|
-
const LoadFailCallbackKey = "InterstitialLoadFail";
|
|
170
|
-
const PlayStartCallbackKey = "InterstitialPlayStart";
|
|
171
|
-
const PlayEndCallbackKey = "InterstitialPlayEnd";
|
|
172
|
-
const PlayFailCallbackKey = "InterstitialPlayFail";
|
|
173
|
-
const CloseCallbackKey = "InterstitialClose";
|
|
174
|
-
const ClickCallbackKey = "InterstitialClick";
|
|
175
|
-
const ShowCallbackKey = "InterstitialAdShow";
|
|
176
|
-
const ShowFailCallbackKey = "InterstitialAdShowFail";
|
|
177
|
-
|
|
178
|
-
const BiddingAttempt = "InterstitialBiddingAttempt";
|
|
179
|
-
const BiddingFilled = "InterstitialBiddingFilled";
|
|
180
|
-
const BiddingFail = "InterstitialBiddingFail";
|
|
181
|
-
const Attemp = "InterstitialAttemp";
|
|
182
|
-
const LoadFilled = "InterstitialLoadFilled";
|
|
183
|
-
const LoadFail = "InterstitialLoadFail";
|
|
184
|
-
|
|
185
|
-
window["ATInterstitialSDK"] = ATInterstitialSDK;
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import {ATAndroidInterstitialAutoAdTS} from "./Android/ATAndroidInterstitialAutoTS";
|
|
2
|
-
import {ATiOSInterstitialAutoAdTS} from "./iOS/ATiOSInterstitiaAutolTS";
|
|
3
|
-
import {sys} from 'cc';
|
|
4
|
-
|
|
5
|
-
const initPlatformBridge = function () {
|
|
6
|
-
if (sys.os === sys.OS.IOS) {
|
|
7
|
-
return ATiOSInterstitialAutoAdTS;
|
|
8
|
-
} else if (sys.os === sys.OS.ANDROID) {
|
|
9
|
-
return ATAndroidInterstitialAutoAdTS;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const platformBridge = initPlatformBridge();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export const ATInterstitialAutoAdSDK = {
|
|
17
|
-
|
|
18
|
-
UseInterstitialAsInterstitial: "UseInterstitialAsInterstitial",
|
|
19
|
-
UseRewardedVideoAsInterstitial: "UseRewardedVideoAsInterstitial",
|
|
20
|
-
ATInterstitialListener: {
|
|
21
|
-
developerCallback: null,
|
|
22
|
-
|
|
23
|
-
onInterstitialAdLoaded: function (placementId: any) {
|
|
24
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdLoaded != null) {
|
|
25
|
-
this.developerCallback.onInterstitialAdLoaded(placementId);
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
onInterstitialAdLoadFail: function (placementId: any, errorInfo: any) {
|
|
30
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdLoadFail != null) {
|
|
31
|
-
this.developerCallback.onInterstitialAdLoadFail(placementId, errorInfo);
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
onInterstitialAdShow: function (placementId: any, callbackInfo: any) {
|
|
36
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdShow != null) {
|
|
37
|
-
this.developerCallback.onInterstitialAdShow(placementId, callbackInfo);
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
onInterstitialAdStartPlayingVideo: function (placementId: any, callbackInfo: any) {
|
|
42
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdStartPlayingVideo != null) {
|
|
43
|
-
this.developerCallback.onInterstitialAdStartPlayingVideo(placementId, callbackInfo);
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
onInterstitialAdEndPlayingVideo: function (placementId: any, callbackInfo: any) {
|
|
48
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdEndPlayingVideo != null) {
|
|
49
|
-
this.developerCallback.onInterstitialAdEndPlayingVideo(placementId, callbackInfo);
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
onInterstitialAdFailedToPlayVideo: function (placementId: any, errorInfo: any) {
|
|
54
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdFailedToPlayVideo != null) {
|
|
55
|
-
this.developerCallback.onInterstitialAdFailedToPlayVideo(placementId, errorInfo);
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
onInterstitialAdFailedToShow: function (placementId: any, errorInfo: any, callbackInfo: any) {
|
|
60
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdFailedToShow != null) {
|
|
61
|
-
this.developerCallback.onInterstitialAdFailedToShow(placementId, errorInfo, callbackInfo);
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
onInterstitialAdClose: function (placementId: any, callbackInfo: any) {
|
|
66
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdClose != null) {
|
|
67
|
-
this.developerCallback.onInterstitialAdClose(placementId, callbackInfo);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
onInterstitialAdClick: function (placementId: any, callbackInfo: any) {
|
|
72
|
-
if (this.developerCallback != null && this.developerCallback.onInterstitialAdClick != null) {
|
|
73
|
-
this.developerCallback.onInterstitialAdClick(placementId, callbackInfo);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
setAdExtraData: function (placementId: any, settings = {}) {
|
|
79
|
-
|
|
80
|
-
if (undefined != platformBridge) {
|
|
81
|
-
platformBridge.setAdExtraData(placementId, JSON.stringify(settings));
|
|
82
|
-
} else {
|
|
83
|
-
console.log("You must run on Android or iOS.");
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
addPlacementIds: function (placementIds: string[]) {
|
|
88
|
-
|
|
89
|
-
if (undefined != platformBridge) {
|
|
90
|
-
platformBridge.addPlacementIds(JSON.stringify(placementIds));
|
|
91
|
-
} else {
|
|
92
|
-
console.log("You must run on Android or iOS.");
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
removePlacementId: function (placementIds: any) {
|
|
97
|
-
|
|
98
|
-
if (undefined != platformBridge) {
|
|
99
|
-
platformBridge.removePlacementId(JSON.stringify(placementIds));
|
|
100
|
-
} else {
|
|
101
|
-
console.log("You must run on Android or iOS.");
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
setAdListener: function (listener: any) {
|
|
106
|
-
const eventJSON = {};
|
|
107
|
-
eventJSON[LoadedCallbackKey] = "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdLoaded";
|
|
108
|
-
eventJSON[LoadFailCallbackKey] = "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdLoadFail";
|
|
109
|
-
eventJSON[PlayStartCallbackKey] = "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdStartPlayingVideo";
|
|
110
|
-
eventJSON[PlayEndCallbackKey] = "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdEndPlayingVideo";
|
|
111
|
-
eventJSON[PlayFailCallbackKey] = "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdFailedToPlayVideo";
|
|
112
|
-
eventJSON[CloseCallbackKey] = "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdClose";
|
|
113
|
-
eventJSON[ClickCallbackKey] = "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdClick";
|
|
114
|
-
eventJSON[ShowCallbackKey] = "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdShow";
|
|
115
|
-
eventJSON[ShowFailCallbackKey] = "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdFailedToShow";
|
|
116
|
-
|
|
117
|
-
if (undefined != platformBridge) {
|
|
118
|
-
platformBridge.setAdListener(JSON.stringify(eventJSON));
|
|
119
|
-
} else {
|
|
120
|
-
console.log("You must run on Android or iOS.");
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
this.ATInterstitialListener.developerCallback = listener;
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
hasAdReady: function (placementId: any) {
|
|
127
|
-
if (undefined != platformBridge) {
|
|
128
|
-
return platformBridge.hasAdReady(placementId);
|
|
129
|
-
} else {
|
|
130
|
-
console.log("You must run on Android or iOS.");
|
|
131
|
-
}
|
|
132
|
-
return false;
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
checkAdStatus: function (placementId: any) {
|
|
136
|
-
if (undefined != platformBridge) {
|
|
137
|
-
return platformBridge.checkAdStatus(placementId);
|
|
138
|
-
} else {
|
|
139
|
-
console.log("You must run on Android or iOS.");
|
|
140
|
-
}
|
|
141
|
-
return "";
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
showAd: function (placementId: any) {
|
|
145
|
-
if (undefined != platformBridge) {
|
|
146
|
-
platformBridge.showAd(placementId);
|
|
147
|
-
} else {
|
|
148
|
-
console.log("You must run on Android or iOS.");
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
showAdInScenario: function (placementId: any, scenario: any) {
|
|
153
|
-
if (undefined != platformBridge) {
|
|
154
|
-
platformBridge.showAdInScenario(placementId, scenario);
|
|
155
|
-
} else {
|
|
156
|
-
console.log("You must run on Android or iOS.");
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
entryAdScenario: function (placementId: any, scenario: any) {
|
|
161
|
-
if (undefined != platformBridge) {
|
|
162
|
-
platformBridge.entryAdScenario(placementId, scenario);
|
|
163
|
-
} else {
|
|
164
|
-
console.log("You must run on Android or iOS.");
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
const LoadedCallbackKey = "InterstitialAutoAdLoaded";
|
|
171
|
-
const LoadFailCallbackKey = "InterstitialAutoAdLoadFail";
|
|
172
|
-
const PlayStartCallbackKey = "InterstitialAutoAdPlayStart";
|
|
173
|
-
const PlayEndCallbackKey = "InterstitialAutoAdPlayEnd";
|
|
174
|
-
const PlayFailCallbackKey = "InterstitialAutoAdPlayFail";
|
|
175
|
-
const CloseCallbackKey = "InterstitialAutoAdClose";
|
|
176
|
-
const ClickCallbackKey = "InterstitialAutoAdClick";
|
|
177
|
-
const ShowCallbackKey = "InterstitialAutoAdAdShow";
|
|
178
|
-
const ShowFailCallbackKey = "InterstitialAutoAdShowFail";
|
|
179
|
-
|
|
180
|
-
window["ATInterstitialAutoAdSDK"] = ATInterstitialAutoAdSDK;
|