@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,243 +0,0 @@
|
|
|
1
|
-
import {ATAndroidRewardedVideoJS} from "./Android/ATAndroidRewardedVideoTS";
|
|
2
|
-
import {ATiOSRewardedVideoTS} from "./iOS/ATiOSRewardedVideoTS";
|
|
3
|
-
import {ATSDK} from "./ATSDK";
|
|
4
|
-
import { _decorator, sys } from 'cc';
|
|
5
|
-
|
|
6
|
-
var initPlatformBridge = function () {
|
|
7
|
-
if (sys.os === sys.OS.IOS) {
|
|
8
|
-
return ATiOSRewardedVideoTS;
|
|
9
|
-
} else if (sys.os === sys.OS.ANDROID) {
|
|
10
|
-
return ATAndroidRewardedVideoJS;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const platformBridge = initPlatformBridge();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export const ATRewardedVideoSDK = {
|
|
18
|
-
userIdKey: "userID",
|
|
19
|
-
userDataKey: "media_ext",
|
|
20
|
-
|
|
21
|
-
ATRewardedVideoListener: {
|
|
22
|
-
developerCallback: null,
|
|
23
|
-
|
|
24
|
-
onRewardedVideoAdLoaded: function (placementId: string) {
|
|
25
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdLoaded(" + placementId + ")");
|
|
26
|
-
if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdLoaded != null) {
|
|
27
|
-
this.developerCallback.onRewardedVideoAdLoaded(placementId);
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
onRewardedVideoAdFailed: function (placementId: string, errorInfo: string) {
|
|
31
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdFailed(" + placementId + ", " + errorInfo + ")");
|
|
32
|
-
if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdFailed != null) {
|
|
33
|
-
this.developerCallback.onRewardedVideoAdFailed(placementId, errorInfo);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
onRewardedVideoAdPlayStart: function (placementId: string, callbackInfo: string) {
|
|
37
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayStart(" + placementId + ", " + callbackInfo + ")");
|
|
38
|
-
if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayStart != null) {
|
|
39
|
-
this.developerCallback.onRewardedVideoAdPlayStart(placementId, callbackInfo);
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
onRewardedVideoAdPlayEnd: function (placementId: string, callbackInfo: string) {
|
|
43
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayEnd(" + placementId + ", " + callbackInfo + ")");
|
|
44
|
-
if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayEnd != null) {
|
|
45
|
-
this.developerCallback.onRewardedVideoAdPlayEnd(placementId, callbackInfo);
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
onRewardedVideoAdPlayFailed: function (placementId: string, errorInfo: string, callbackInfo: string) {
|
|
49
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayFailed(" + placementId + ", " + errorInfo + ", " + callbackInfo + ")");
|
|
50
|
-
if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayFailed != null) {
|
|
51
|
-
this.developerCallback.onRewardedVideoAdPlayFailed(placementId, errorInfo, callbackInfo);
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
onRewardedVideoAdClosed: function (placementId: string, callbackInfo: string) {
|
|
55
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdClosed(" + placementId + ", " + callbackInfo + ")");
|
|
56
|
-
if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdClosed != null) {
|
|
57
|
-
this.developerCallback.onRewardedVideoAdClosed(placementId, callbackInfo);
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
onRewardedVideoAdPlayClicked: function (placementId: string, callbackInfo: string) {
|
|
61
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayClicked(" + placementId + ", " + callbackInfo + ")");
|
|
62
|
-
if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayClicked != null) {
|
|
63
|
-
this.developerCallback.onRewardedVideoAdPlayClicked(placementId, callbackInfo);
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
onReward: function (placementId: string, callbackInfo: string) {
|
|
67
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onReward(" + placementId + ", " + callbackInfo + ")");
|
|
68
|
-
if (this.developerCallback != null && this.developerCallback.onReward != null) {
|
|
69
|
-
this.developerCallback.onReward(placementId, callbackInfo);
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
//added v5.8.10
|
|
73
|
-
onAdSourceBiddingAttempt: function (placementId: string, callbackInfo: string) {
|
|
74
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceBiddingAttempt(" + placementId + ", " + callbackInfo + ")");
|
|
75
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingAttempt != null) {
|
|
76
|
-
this.developerCallback.onAdSourceBiddingAttempt(placementId, callbackInfo);
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
onAdSourceBiddingFilled: function (placementId: string, callbackInfo: string) {
|
|
80
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceBiddingFilled(" + placementId + ", " + callbackInfo + ")");
|
|
81
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFilled != null) {
|
|
82
|
-
this.developerCallback.onAdSourceBiddingFilled(placementId, callbackInfo);
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
onAdSourceBiddingFail: function (placementId: string, errorInfo: string, callbackInfo: string) {
|
|
86
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceBiddingFail(" + placementId + ", " + errorInfo + ", " + callbackInfo + ")");
|
|
87
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFail != null) {
|
|
88
|
-
this.developerCallback.onAdSourceBiddingFail(placementId, errorInfo, callbackInfo);
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
onAdSourceAttemp: function (placementId: string, callbackInfo: string) {
|
|
92
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceAttemp(" + placementId + ", " + callbackInfo + ")");
|
|
93
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceAttemp != null) {
|
|
94
|
-
this.developerCallback.onAdSourceAttemp(placementId, callbackInfo);
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
onAdSourceLoadFilled: function (placementId: string, callbackInfo: string) {
|
|
98
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceLoadFilled(" + placementId + ", " + callbackInfo + ")");
|
|
99
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFilled != null) {
|
|
100
|
-
this.developerCallback.onAdSourceLoadFilled(placementId, callbackInfo);
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
onAdSourceLoadFail: function (placementId: string, errorInfo: string, callbackInfo: string) {
|
|
104
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceLoadFail(" + placementId + ", " + errorInfo + ", " + callbackInfo + ")");
|
|
105
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFail != null) {
|
|
106
|
-
this.developerCallback.onAdSourceLoadFail(placementId, errorInfo, callbackInfo);
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
onRewardedVideoAdAgainPlayStart: function (placementId: string, callbackInfo: string) {
|
|
110
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayStart(" + placementId + ", " + callbackInfo + ")");
|
|
111
|
-
if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayStart != null) {
|
|
112
|
-
this.developerCallback.onRewardedVideoAdAgainPlayStart(placementId, callbackInfo);
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
onRewardedVideoAdAgainPlayEnd: function (placementId: string, callbackInfo: string) {
|
|
116
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayEnd(" + placementId + ", " + callbackInfo + ")");
|
|
117
|
-
if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayEnd != null) {
|
|
118
|
-
this.developerCallback.onRewardedVideoAdAgainPlayEnd(placementId, callbackInfo);
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
onRewardedVideoAdAgainPlayFailed: function (placementId: string, errorInfo: string, callbackInfo: string) {
|
|
122
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayFailed(" + placementId + ", " + errorInfo + ", " + callbackInfo + ")");
|
|
123
|
-
if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayFailed != null) {
|
|
124
|
-
this.developerCallback.onRewardedVideoAdAgainPlayFailed(placementId, errorInfo, callbackInfo);
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
onRewardedVideoAdAgainPlayClicked: function (placementId: string, callbackInfo: string) {
|
|
128
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayClicked(" + placementId + ", " + callbackInfo + ")");
|
|
129
|
-
if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayClicked != null) {
|
|
130
|
-
this.developerCallback.onRewardedVideoAdAgainPlayClicked(placementId, callbackInfo);
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
onAgainReward: function (placementId: string, callbackInfo: string) {
|
|
134
|
-
ATSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAgainReward(" + placementId + ", " + callbackInfo + ")");
|
|
135
|
-
if (this.developerCallback != null && this.developerCallback.onAgainReward != null) {
|
|
136
|
-
this.developerCallback.onAgainReward(placementId, callbackInfo);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
loadAd: function (placementId: any, settings = {}) {
|
|
142
|
-
|
|
143
|
-
if (undefined != platformBridge) {
|
|
144
|
-
platformBridge.loadRewardedVideo(placementId, JSON.stringify(settings));
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
setAdListener: function (listener: any) {
|
|
149
|
-
const eventJSON = {};
|
|
150
|
-
eventJSON[LoadedCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdLoaded",
|
|
151
|
-
eventJSON[LoadFailCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdFailed",
|
|
152
|
-
eventJSON[PlayStartCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayStart",
|
|
153
|
-
eventJSON[PlayEndCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayEnd",
|
|
154
|
-
eventJSON[PlayFailCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayFailed",
|
|
155
|
-
eventJSON[CloseCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdClosed",
|
|
156
|
-
eventJSON[ClickCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayClicked",
|
|
157
|
-
eventJSON[RewardCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onReward",
|
|
158
|
-
//added v5.8.10
|
|
159
|
-
eventJSON[BiddingAttempt] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceBiddingAttempt",
|
|
160
|
-
eventJSON[BiddingFilled] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceBiddingFilled",
|
|
161
|
-
eventJSON[BiddingFail] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceBiddingFail",
|
|
162
|
-
eventJSON[Attemp] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceAttemp",
|
|
163
|
-
eventJSON[LoadFilled] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceLoadFilled",
|
|
164
|
-
eventJSON[LoadFail] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceLoadFail",
|
|
165
|
-
//added v5.8.10 playAgain listener
|
|
166
|
-
eventJSON[AgainPlayStartCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayStart",
|
|
167
|
-
eventJSON[AgainPlayEndCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayEnd",
|
|
168
|
-
eventJSON[AgainPlayFailCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayFailed",
|
|
169
|
-
eventJSON[AgainClickCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayClicked",
|
|
170
|
-
eventJSON[AgainRewardCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAgainReward"
|
|
171
|
-
|
|
172
|
-
if (undefined != platformBridge) {
|
|
173
|
-
platformBridge.setAdListener(JSON.stringify(eventJSON));
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
this.ATRewardedVideoListener.developerCallback = listener;
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
hasAdReady: function (placementId: any) {
|
|
180
|
-
if (undefined != platformBridge) {
|
|
181
|
-
return platformBridge.hasAdReady(placementId);
|
|
182
|
-
}
|
|
183
|
-
return false;
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
checkAdStatus: function (placementId: any) {
|
|
187
|
-
if (undefined != platformBridge) {
|
|
188
|
-
return platformBridge.checkAdStatus(placementId);
|
|
189
|
-
} else {
|
|
190
|
-
console.log("You must run on Android or iOS.");
|
|
191
|
-
}
|
|
192
|
-
return "";
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
showAd: function (placementId: any) {
|
|
196
|
-
if (undefined != platformBridge) {
|
|
197
|
-
platformBridge.showAd(placementId);
|
|
198
|
-
} else {
|
|
199
|
-
console.log("You must run on Android or iOS.");
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
|
|
203
|
-
showAdInScenario: function (placementId: any, scenario: any) {
|
|
204
|
-
if (undefined != platformBridge) {
|
|
205
|
-
platformBridge.showAdInScenario(placementId, scenario);
|
|
206
|
-
} else {
|
|
207
|
-
console.log("You must run on Android or iOS.");
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
entryAdScenario: function (placementId: any, scenario: any) {
|
|
212
|
-
if (undefined != platformBridge) {
|
|
213
|
-
platformBridge.entryAdScenario(placementId, scenario);
|
|
214
|
-
} else {
|
|
215
|
-
console.log("You must run on Android or iOS.");
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
const LoadedCallbackKey = "RewardedVideoLoaded";
|
|
222
|
-
const LoadFailCallbackKey = "RewardedVideoLoadFail";
|
|
223
|
-
const PlayStartCallbackKey = "RewardedVideoPlayStart";
|
|
224
|
-
const PlayEndCallbackKey = "RewardedVideoPlayEnd";
|
|
225
|
-
const PlayFailCallbackKey = "RewardedVideoPlayFail";
|
|
226
|
-
const CloseCallbackKey = "RewardedVideoClose";
|
|
227
|
-
const ClickCallbackKey = "RewardedVideoClick";
|
|
228
|
-
const RewardCallbackKey = "RewardedVideoReward";
|
|
229
|
-
|
|
230
|
-
const BiddingAttempt = "RewardedVideoBiddingAttempt";
|
|
231
|
-
const BiddingFilled = "RewardedVideoBiddingFilled";
|
|
232
|
-
const BiddingFail = "RewardedVideoBiddingFail";
|
|
233
|
-
const Attemp = "RewardedVideoAttemp";
|
|
234
|
-
const LoadFilled = "RewardedVideoLoadFilled";
|
|
235
|
-
const LoadFail = "RewardedVideoLoadFail";
|
|
236
|
-
|
|
237
|
-
const AgainPlayStartCallbackKey = "RewardedVideoAgainPlayStart";
|
|
238
|
-
const AgainPlayEndCallbackKey = "RewardedVideoAgainPlayEnd";
|
|
239
|
-
const AgainPlayFailCallbackKey = "RewardedVideoAgainPlayFail";
|
|
240
|
-
const AgainClickCallbackKey = "RewardedVideoAgainClick";
|
|
241
|
-
const AgainRewardCallbackKey = "RewardedVideoAgainReward";
|
|
242
|
-
|
|
243
|
-
window["ATRewardedVideoSDK"] = ATRewardedVideoSDK;
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import {ATAndroidTS} from "./Android/ATAndroidTS"
|
|
2
|
-
import {ATiOSTS} from "./iOS/ATiOSTS";
|
|
3
|
-
import {sys} from 'cc';
|
|
4
|
-
|
|
5
|
-
let isDebugLog = false;
|
|
6
|
-
|
|
7
|
-
const initPlatformBridge = function () {
|
|
8
|
-
if (sys.os === sys.OS.IOS) {
|
|
9
|
-
return ATiOSTS;
|
|
10
|
-
} else if (sys.os === sys.OS.ANDROID) {
|
|
11
|
-
return ATAndroidTS;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const platformBridge = initPlatformBridge();
|
|
16
|
-
|
|
17
|
-
export const ATSDK = {
|
|
18
|
-
|
|
19
|
-
kATUserLocationUnknown: 0,
|
|
20
|
-
kATUserLocationInEU: 1,
|
|
21
|
-
kATUserLocationOutOfEU: 2,
|
|
22
|
-
|
|
23
|
-
PERSONALIZED: 0,
|
|
24
|
-
NONPERSONALIZED: 1,
|
|
25
|
-
UNKNOWN: 2,
|
|
26
|
-
|
|
27
|
-
//for android and ios
|
|
28
|
-
OS_VERSION_NAME: "os_vn",
|
|
29
|
-
OS_VERSION_CODE: "os_vc",
|
|
30
|
-
APP_PACKAGE_NAME: "package_name",
|
|
31
|
-
APP_VERSION_NAME: "app_vn",
|
|
32
|
-
APP_VERSION_CODE: "app_vc",
|
|
33
|
-
|
|
34
|
-
BRAND: "brand",
|
|
35
|
-
MODEL: "model",
|
|
36
|
-
DEVICE_SCREEN_SIZE: "screen",
|
|
37
|
-
MNC: "mnc",
|
|
38
|
-
MCC: "mcc",
|
|
39
|
-
|
|
40
|
-
LANGUAGE: "language",
|
|
41
|
-
TIMEZONE: "timezone",
|
|
42
|
-
USER_AGENT: "ua",
|
|
43
|
-
ORIENTATION: "orient",
|
|
44
|
-
NETWORK_TYPE: "network_type",
|
|
45
|
-
|
|
46
|
-
//for android
|
|
47
|
-
INSTALLER: "it_src",
|
|
48
|
-
ANDROID_ID: "android_id",
|
|
49
|
-
GAID: "gaid",
|
|
50
|
-
MAC: "mac",
|
|
51
|
-
IMEI: "imei",
|
|
52
|
-
OAID: "oaid",
|
|
53
|
-
|
|
54
|
-
//for ios
|
|
55
|
-
IDFA: "idfa",
|
|
56
|
-
IDFV: "idfv",
|
|
57
|
-
|
|
58
|
-
ATSDKListener: {
|
|
59
|
-
userLocationCallback: null,
|
|
60
|
-
getUserLocationCallback: function (userLocation: any) {
|
|
61
|
-
if (undefined != this.userLocationCallback) {
|
|
62
|
-
this.userLocationCallback(userLocation);
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
gdprCallback: null,
|
|
67
|
-
getGDPRCallback: function () {
|
|
68
|
-
if (undefined != this.gdprCallback) {
|
|
69
|
-
this.gdprCallback();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
initSDK: function (appId: any, appKey: any) {
|
|
75
|
-
|
|
76
|
-
if (undefined != platformBridge) {
|
|
77
|
-
platformBridge.initSDK(appId, appKey);
|
|
78
|
-
} else {
|
|
79
|
-
console.log("You must run on Android or iOS.");
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
initCustomMap: function (customMap: any) {
|
|
84
|
-
if (undefined != platformBridge) {
|
|
85
|
-
if (undefined != customMap) {
|
|
86
|
-
platformBridge.initCustomMap(JSON.stringify(customMap));
|
|
87
|
-
}
|
|
88
|
-
} else {
|
|
89
|
-
console.log("You must run on Android or iOS.");
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
setPlacementCustomMap: function (placmentId: any, customMap: any) {
|
|
94
|
-
if (undefined != platformBridge) {
|
|
95
|
-
if (undefined != customMap) {
|
|
96
|
-
platformBridge.setPlacementCustomMap(placmentId, JSON.stringify(customMap));
|
|
97
|
-
}
|
|
98
|
-
} else {
|
|
99
|
-
console.log("You must run on Android or iOS.");
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
setGDPRLevel: function (level: any) {
|
|
104
|
-
if (undefined != platformBridge) {
|
|
105
|
-
platformBridge.setGDPRLevel(level);
|
|
106
|
-
} else {
|
|
107
|
-
console.log("You must run on Android or iOS.");
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
getGDPRLevel: function () {
|
|
112
|
-
if (undefined != platformBridge) {
|
|
113
|
-
return platformBridge.getGDPRLevel();
|
|
114
|
-
} else {
|
|
115
|
-
console.log("You must run on Android or iOS.");
|
|
116
|
-
}
|
|
117
|
-
return this.UNKNOWN;
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
getUserLocation: function (userLocationCallback: any) {
|
|
121
|
-
this.ATSDKListener.userLocationCallback = userLocationCallback;
|
|
122
|
-
if (undefined != platformBridge) {
|
|
123
|
-
platformBridge.getUserLocation(GetUserLocationJsCallback);
|
|
124
|
-
} else {
|
|
125
|
-
console.log("You must run on Android or iOS.");
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
showGDPRAuth: function () {
|
|
130
|
-
if (undefined != platformBridge) {
|
|
131
|
-
platformBridge.showGDPRAuth();
|
|
132
|
-
} else {
|
|
133
|
-
console.log("You must run on Android or iOS.");
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
setLogDebug: function (debug: boolean) {
|
|
138
|
-
isDebugLog = debug;
|
|
139
|
-
if (undefined != platformBridge) {
|
|
140
|
-
platformBridge.setLogDebug(debug);
|
|
141
|
-
} else {
|
|
142
|
-
console.log("You must run on Android or iOS.");
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
printLog: function (msg: any) {
|
|
147
|
-
if (undefined != msg && isDebugLog) {
|
|
148
|
-
if (undefined != platformBridge) {
|
|
149
|
-
platformBridge.printJsLog(msg);
|
|
150
|
-
} else {
|
|
151
|
-
console.log("You must run on Android or iOS.");
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
printLogWithParams: function (tag: string, methodName: string, placementId: string, callbackInfo: string, errorInfo: string) {
|
|
158
|
-
this.printLog(tag + "::" + methodName + "()" + "\nplacementId=" + placementId + "\ncallbackInfo=" + callbackInfo + "\nerrorInfo=" + errorInfo);
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
deniedUploadDeviceInfo: function (deniedInfo: string | any[]) {
|
|
162
|
-
if (undefined != platformBridge) {
|
|
163
|
-
|
|
164
|
-
if (deniedInfo != null) {
|
|
165
|
-
const length = deniedInfo.length;
|
|
166
|
-
let deniedInfoString = "";
|
|
167
|
-
for (let i = 0; i < length; i++) {
|
|
168
|
-
const info = deniedInfo[i];
|
|
169
|
-
if (i == 0) {
|
|
170
|
-
deniedInfoString = info;
|
|
171
|
-
} else {
|
|
172
|
-
deniedInfoString = deniedInfoString + "," + info;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
console.log("test__" + deniedInfoString)
|
|
177
|
-
|
|
178
|
-
platformBridge.deniedUploadDeviceInfo(deniedInfoString);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
} else {
|
|
182
|
-
console.log("You must run on Android or iOS.");
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
setChannel: function (channel: any) {
|
|
187
|
-
if (undefined != platformBridge) {
|
|
188
|
-
platformBridge.setChannel(channel);
|
|
189
|
-
} else {
|
|
190
|
-
console.log("You must run on Android or iOS.");
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
setSubChannel: function (subChannel: any) {
|
|
195
|
-
if (undefined != platformBridge) {
|
|
196
|
-
platformBridge.setSubChannel(subChannel);
|
|
197
|
-
} else {
|
|
198
|
-
console.log("You must run on Android or iOS.");
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
showGDPRConsent: function (getGDPRCallback: any) {
|
|
203
|
-
this.ATSDKListener.gdprCallback = getGDPRCallback;
|
|
204
|
-
if (undefined != platformBridge) {
|
|
205
|
-
platformBridge.showGDPRConsent(GetGDPRCallback);
|
|
206
|
-
} else {
|
|
207
|
-
console.log("You must run on Android or iOS.");
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
showDebuggerUI: function (debugKey: any) {
|
|
212
|
-
if (undefined != platformBridge) {
|
|
213
|
-
platformBridge.showDebuggerUI(debugKey);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
const GetUserLocationJsCallback = "ATSDK.ATSDKListener.getUserLocationCallback";
|
|
220
|
-
const GetGDPRCallback = "ATSDK.ATSDKListener.getGDPRCallback";
|
|
221
|
-
|
|
222
|
-
window["ATSDK"] = ATSDK;
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import {ATAndroidSplashTS} from "./Android/ATAndroidSplashTS";
|
|
2
|
-
import {ATiOSSplashTS} from "./iOS/ATiOSSplashTS";
|
|
3
|
-
import {sys} from 'cc';
|
|
4
|
-
|
|
5
|
-
const initPlatformBridge = function () {
|
|
6
|
-
if (sys.os === sys.OS.IOS) {
|
|
7
|
-
return ATiOSSplashTS;
|
|
8
|
-
} else if (sys.os === sys.OS.ANDROID) {
|
|
9
|
-
return ATAndroidSplashTS;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const platformBridge = initPlatformBridge();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export const ATSplashSDK = {
|
|
17
|
-
|
|
18
|
-
ATSplashListener: {
|
|
19
|
-
developerCallback: null,
|
|
20
|
-
onSplashAdLoaded: function (placementId: any) {
|
|
21
|
-
if (this.developerCallback != null && this.developerCallback.onSplashAdLoaded != null) {
|
|
22
|
-
this.developerCallback.onSplashAdLoaded(placementId);
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
onSplashAdLoadFail: function (placementId: any, errorInfo: any) {
|
|
27
|
-
if (this.developerCallback != null && this.developerCallback.onSplashAdLoadFail != null) {
|
|
28
|
-
this.developerCallback.onSplashAdLoadFail(placementId, errorInfo);
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
onSplashAdShow: function (placementId: any, callbackInfo: any) {
|
|
33
|
-
if (this.developerCallback != null && this.developerCallback.onSplashAdShow != null) {
|
|
34
|
-
this.developerCallback.onSplashAdShow(placementId, callbackInfo);
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
onSplashAdClose: function (placementId: any, callbackInfo: any) {
|
|
39
|
-
if (this.developerCallback != null && this.developerCallback.onSplashAdClose != null) {
|
|
40
|
-
this.developerCallback.onSplashAdClose(placementId, callbackInfo);
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
onSplashAdClick: function (placementId: any, callbackInfo: any) {
|
|
45
|
-
if (this.developerCallback != null && this.developerCallback.onSplashAdClick != null) {
|
|
46
|
-
this.developerCallback.onSplashAdClick(placementId, callbackInfo);
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
onAdSourceBiddingAttempt: function (placementId: any, callbackInfo: any) {
|
|
51
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingAttempt != null) {
|
|
52
|
-
this.developerCallback.onAdSourceBiddingAttempt(placementId, callbackInfo);
|
|
53
|
-
}
|
|
54
|
-
}, onAdSourceBiddingFilled: function (placementId: any, callbackInfo: any) {
|
|
55
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFilled != null) {
|
|
56
|
-
this.developerCallback.onAdSourceBiddingFilled(placementId, callbackInfo);
|
|
57
|
-
}
|
|
58
|
-
}, onAdSourceBiddingFail: function (placementId: any, errorInfo: any, callbackInfo: any) {
|
|
59
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFail != null) {
|
|
60
|
-
this.developerCallback.onAdSourceBiddingFail(placementId, errorInfo, callbackInfo);
|
|
61
|
-
}
|
|
62
|
-
}, onAdSourceAttemp: function (placementId: any, callbackInfo: any) {
|
|
63
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceAttemp != null) {
|
|
64
|
-
this.developerCallback.onAdSourceAttemp(placementId, callbackInfo);
|
|
65
|
-
}
|
|
66
|
-
}, onAdSourceLoadFilled: function (placementId: any, callbackInfo: any) {
|
|
67
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFilled != null) {
|
|
68
|
-
this.developerCallback.onAdSourceLoadFilled(placementId, callbackInfo);
|
|
69
|
-
}
|
|
70
|
-
}, onAdSourceLoadFail: function (placementId: any, errorInfo: any, callbackInfo: any) {
|
|
71
|
-
if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFail != null) {
|
|
72
|
-
this.developerCallback.onAdSourceLoadFail(placementId, errorInfo, callbackInfo);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
loadAd: function (placementId: any, settings = {}) {
|
|
78
|
-
|
|
79
|
-
if (platformBridge != null) {
|
|
80
|
-
platformBridge.loadSplash(placementId, JSON.stringify(settings));
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
setAdListener: function (listener: any) {
|
|
85
|
-
const eventJSON = {};
|
|
86
|
-
eventJSON[LoadedCallbackKey] = " ATSplashSDK.ATSplashListener.onSplashAdLoaded", eventJSON[LoadFailCallbackKey] = " ATSplashSDK.ATSplashListener.onSplashAdLoadFail", eventJSON[CloseCallbackKey] = " ATSplashSDK.ATSplashListener.onSplashAdClose", eventJSON[ClickCallbackKey] = " ATSplashSDK.ATSplashListener.onSplashAdClick", eventJSON[ShowCallbackKey] = " ATSplashSDK.ATSplashListener.onSplashAdShow",
|
|
87
|
-
|
|
88
|
-
eventJSON[BiddingAttempt] = " ATSplashSDK.ATSplashListener.onAdSourceBiddingAttempt", eventJSON[BiddingFilled] = " ATSplashSDK.ATSplashListener.onAdSourceBiddingFilled", eventJSON[BiddingFail] = " ATSplashSDK.ATSplashListener.onAdSourceBiddingFail", eventJSON[Attemp] = " ATSplashSDK.ATSplashListener.onAdSourceAttemp", eventJSON[LoadFilled] = " ATSplashSDK.ATSplashListener.onAdSourceLoadFilled", eventJSON[LoadFail] = " ATSplashSDK.ATSplashListener.onAdSourceLoadFail"
|
|
89
|
-
|
|
90
|
-
if (undefined != platformBridge) {
|
|
91
|
-
platformBridge.setAdListener(JSON.stringify(eventJSON));
|
|
92
|
-
} else {
|
|
93
|
-
console.log("You must run on Android or iOS.");
|
|
94
|
-
}
|
|
95
|
-
this.ATSplashListener.developerCallback = listener;
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
hasAdReady: function (placementId: any) {
|
|
99
|
-
if (undefined != platformBridge) {
|
|
100
|
-
return platformBridge.hasAdReady(placementId);
|
|
101
|
-
} else {
|
|
102
|
-
console.log("You must run on Android or iOS.");
|
|
103
|
-
}
|
|
104
|
-
return false;
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
checkAdStatus: function (placementId: any) {
|
|
108
|
-
if (undefined != platformBridge) {
|
|
109
|
-
return platformBridge.checkAdStatus(placementId);
|
|
110
|
-
} else {
|
|
111
|
-
console.log("You must run on Android or iOS.");
|
|
112
|
-
}
|
|
113
|
-
return "";
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
showAd: function (placementId: any) {
|
|
117
|
-
if (undefined != platformBridge) {
|
|
118
|
-
console.log(this.TAG+ "showSplashAd333");
|
|
119
|
-
platformBridge.showAd(placementId);
|
|
120
|
-
} else {
|
|
121
|
-
console.log("You must run on Android or iOS.");
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
showAdInScenario: function (placementId: any, scenario: any) {
|
|
126
|
-
if (undefined != platformBridge) {
|
|
127
|
-
platformBridge.showAdInScenario(placementId, scenario);
|
|
128
|
-
} else {
|
|
129
|
-
console.log("You must run on Android or iOS.");
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
entryAdScenario: function (placementId: any, scenario: any) {
|
|
134
|
-
if (undefined != platformBridge) {
|
|
135
|
-
platformBridge.entryAdScenario(placementId, scenario);
|
|
136
|
-
} else {
|
|
137
|
-
console.log("You must run on Android or iOS.");
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
const LoadedCallbackKey = "SplashLoaded";
|
|
143
|
-
const LoadFailCallbackKey = "SplashLoadFail";
|
|
144
|
-
const CloseCallbackKey = "SplashClose";
|
|
145
|
-
const ClickCallbackKey = "SplashClick";
|
|
146
|
-
const ShowCallbackKey = "SplashAdShow";
|
|
147
|
-
|
|
148
|
-
const BiddingAttempt = "SplashBiddingAttempt";
|
|
149
|
-
const BiddingFilled = "SplashBiddingFilled";
|
|
150
|
-
const BiddingFail = "SplashBiddingFail";
|
|
151
|
-
const Attemp = "SplashAttemp";
|
|
152
|
-
const LoadFilled = "SplashLoadFilled";
|
|
153
|
-
const LoadFail = "SplashLoadFail";
|
|
154
|
-
|
|
155
|
-
window["ATSplashSDK"] = ATSplashSDK;
|