@cc-component/cc-ex-component 1.1.0 → 1.1.2

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.
Files changed (89) hide show
  1. package/assets/ex/BaseEx.ts +1 -10
  2. package/assets/platform/Interface.ts +73 -0
  3. package/assets/platform/Interface.ts.meta +9 -0
  4. package/assets/platform/android/AndroidSDK.ts +176 -0
  5. package/assets/platform/android/AndroidSDK.ts.meta +1 -0
  6. package/assets/platform/android/AnyThinkAds/ATBanner.ts +266 -0
  7. package/assets/platform/android/AnyThinkAds/ATBanner.ts.meta +9 -0
  8. package/assets/platform/android/AnyThinkAds/ATInterstitial.ts +185 -0
  9. package/assets/platform/android/AnyThinkAds/ATInterstitial.ts.meta +9 -0
  10. package/assets/platform/android/AnyThinkAds/ATInterstitialAuto.ts +180 -0
  11. package/assets/platform/android/AnyThinkAds/ATInterstitialAuto.ts.meta +9 -0
  12. package/assets/platform/android/AnyThinkAds/ATNative.ts +256 -0
  13. package/assets/platform/android/AnyThinkAds/ATNative.ts.meta +9 -0
  14. package/assets/platform/android/AnyThinkAds/ATRewardedAutoVideo.ts +175 -0
  15. package/assets/platform/android/AnyThinkAds/ATRewardedAutoVideo.ts.meta +9 -0
  16. package/assets/platform/android/AnyThinkAds/ATRewardedVideo.ts +243 -0
  17. package/assets/platform/android/AnyThinkAds/ATRewardedVideo.ts.meta +9 -0
  18. package/assets/platform/android/AnyThinkAds/ATSDK.ts +222 -0
  19. package/assets/platform/android/AnyThinkAds/ATSDK.ts.meta +9 -0
  20. package/assets/platform/android/AnyThinkAds/ATSplash.ts +155 -0
  21. package/assets/platform/android/AnyThinkAds/ATSplash.ts.meta +9 -0
  22. package/assets/platform/android/AnyThinkAds/Android/ATAndroidBannerTS.ts +71 -0
  23. package/assets/platform/android/AnyThinkAds/Android/ATAndroidBannerTS.ts.meta +9 -0
  24. package/assets/platform/android/AnyThinkAds/Android/ATAndroidInterstitialAutoTS.ts +52 -0
  25. package/assets/platform/android/AnyThinkAds/Android/ATAndroidInterstitialAutoTS.ts.meta +9 -0
  26. package/assets/platform/android/AnyThinkAds/Android/ATAndroidInterstitialTS.ts +41 -0
  27. package/assets/platform/android/AnyThinkAds/Android/ATAndroidInterstitialTS.ts.meta +9 -0
  28. package/assets/platform/android/AnyThinkAds/Android/ATAndroidNativeTS.ts +47 -0
  29. package/assets/platform/android/AnyThinkAds/Android/ATAndroidNativeTS.ts.meta +9 -0
  30. package/assets/platform/android/AnyThinkAds/Android/ATAndroidRewardedVideoAutoTS.ts +52 -0
  31. package/assets/platform/android/AnyThinkAds/Android/ATAndroidRewardedVideoAutoTS.ts.meta +9 -0
  32. package/assets/platform/android/AnyThinkAds/Android/ATAndroidRewardedVideoTS.ts +41 -0
  33. package/assets/platform/android/AnyThinkAds/Android/ATAndroidRewardedVideoTS.ts.meta +9 -0
  34. package/assets/platform/android/AnyThinkAds/Android/ATAndroidSplashTS.ts +42 -0
  35. package/assets/platform/android/AnyThinkAds/Android/ATAndroidSplashTS.ts.meta +9 -0
  36. package/assets/platform/android/AnyThinkAds/Android/ATAndroidTS.ts +73 -0
  37. package/assets/platform/android/AnyThinkAds/Android/ATAndroidTS.ts.meta +9 -0
  38. package/assets/platform/android/AnyThinkAds/Android.meta +9 -0
  39. package/assets/platform/android/AnyThinkAds/iOS/ATiOSBannerTS.ts +66 -0
  40. package/assets/platform/android/AnyThinkAds/iOS/ATiOSBannerTS.ts.meta +9 -0
  41. package/assets/platform/android/AnyThinkAds/iOS/ATiOSInterstitiaAutolTS.ts +54 -0
  42. package/assets/platform/android/AnyThinkAds/iOS/ATiOSInterstitiaAutolTS.ts.meta +9 -0
  43. package/assets/platform/android/AnyThinkAds/iOS/ATiOSInterstitialTS.ts +43 -0
  44. package/assets/platform/android/AnyThinkAds/iOS/ATiOSInterstitialTS.ts.meta +9 -0
  45. package/assets/platform/android/AnyThinkAds/iOS/ATiOSNativeTS.ts +47 -0
  46. package/assets/platform/android/AnyThinkAds/iOS/ATiOSNativeTS.ts.meta +9 -0
  47. package/assets/platform/android/AnyThinkAds/iOS/ATiOSRewardedAutoVideoTS.ts +55 -0
  48. package/assets/platform/android/AnyThinkAds/iOS/ATiOSRewardedAutoVideoTS.ts.meta +9 -0
  49. package/assets/platform/android/AnyThinkAds/iOS/ATiOSRewardedVideoTS.ts +43 -0
  50. package/assets/platform/android/AnyThinkAds/iOS/ATiOSRewardedVideoTS.ts.meta +9 -0
  51. package/assets/platform/android/AnyThinkAds/iOS/ATiOSSplashTS.ts +47 -0
  52. package/assets/platform/android/AnyThinkAds/iOS/ATiOSSplashTS.ts.meta +9 -0
  53. package/assets/platform/android/AnyThinkAds/iOS/ATiOSTS.ts +76 -0
  54. package/assets/platform/android/AnyThinkAds/iOS/ATiOSTS.ts.meta +9 -0
  55. package/assets/platform/android/AnyThinkAds/iOS.meta +9 -0
  56. package/assets/platform/android/AnyThinkAds.meta +9 -0
  57. package/assets/platform/android/iOSSDK.ts +14 -0
  58. package/assets/platform/android/iOSSDK.ts.meta +1 -0
  59. package/assets/platform/android.meta +11 -0
  60. package/assets/platform/base/EditorSDK.ts +29 -0
  61. package/assets/platform/base/EditorSDK.ts.meta +1 -0
  62. package/assets/platform/base/PlatfprmModule.ts +138 -0
  63. package/assets/platform/base/PlatfprmModule.ts.meta +9 -0
  64. package/assets/platform/base/SDKBase.ts +59 -0
  65. package/assets/platform/base/SDKBase.ts.meta +9 -0
  66. package/assets/platform/base/SDKEnum.ts +127 -0
  67. package/assets/platform/base/SDKEnum.ts.meta +9 -0
  68. package/assets/platform/base/TTSDK.ts +355 -0
  69. package/assets/platform/base/TTSDK.ts.meta +9 -0
  70. package/assets/platform/base/WXSDK.ts +150 -0
  71. package/assets/platform/base/WXSDK.ts.meta +1 -0
  72. package/assets/platform/base.meta +9 -0
  73. package/assets/platform/wx/MiniSDK.ts +1001 -0
  74. package/assets/platform/wx/MiniSDK.ts.meta +9 -0
  75. package/assets/platform/wx/lib.douyin.d.ts +168 -0
  76. package/assets/platform/wx/lib.douyin.d.ts.meta +9 -0
  77. package/assets/platform/wx/wxmini.d.ts +2452 -0
  78. package/assets/platform/wx/wxmini.d.ts.meta +9 -0
  79. package/assets/platform/wx.meta +9 -0
  80. package/assets/platform.meta +9 -0
  81. package/assets/video/IVideo.ts +2 -2
  82. package/assets/video/Interface.ts +0 -1
  83. package/assets/video/VideoComponent.ts +1 -1
  84. package/assets/video/VideoManager.ts +5 -1
  85. package/assets/video/VideoModule.ts +30 -7
  86. package/assets/video/VideoPlayTT.ts +22 -3
  87. package/assets/video/VideoPlayWX.ts +34 -6
  88. package/assets/video/VideoPlayWeb.ts +2 -2
  89. package/package.json +1 -1
@@ -0,0 +1,175 @@
1
+ import {ATAndroidRewardedVideoAutoAdTS} from "./Android/ATAndroidRewardedVideoAutoTS";
2
+ import {ATiOSRewardedVideoAutoAdJS} from "./iOS/ATiOSRewardedAutoVideoTS";
3
+ import {sys} from 'cc';
4
+
5
+ const initPlatformBridge = function () {
6
+ if (sys.os === sys.OS.IOS) {
7
+ return ATiOSRewardedVideoAutoAdJS;
8
+ } else if (sys.os === sys.OS.ANDROID) {
9
+ return ATAndroidRewardedVideoAutoAdTS;
10
+ }
11
+ };
12
+
13
+ const platformBridge = initPlatformBridge();
14
+ export const ATRewardedVideoAutoAdSDK = {
15
+ userIdKey: "userID", userDataKey: "media_ext",
16
+
17
+ ATRewardedVideoListener: {
18
+ developerCallback: null,
19
+
20
+ onRewardedVideoAdLoaded: function (placementId: string) {
21
+ if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdLoaded != null) {
22
+ this.developerCallback.onRewardedVideoAdLoaded(placementId);
23
+ }
24
+ }, onRewardedVideoAdFailed: function (placementId: string, errorInfo: string) {
25
+ if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdFailed != null) {
26
+ this.developerCallback.onRewardedVideoAdFailed(placementId, errorInfo);
27
+ }
28
+ }, onRewardedVideoAdPlayStart: function (placementId: string, callbackInfo: string) {
29
+ if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayStart != null) {
30
+ this.developerCallback.onRewardedVideoAdPlayStart(placementId, callbackInfo);
31
+ }
32
+ }, onRewardedVideoAdPlayEnd: function (placementId: string, callbackInfo: string) {
33
+ if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayEnd != null) {
34
+ this.developerCallback.onRewardedVideoAdPlayEnd(placementId, callbackInfo);
35
+ }
36
+ }, onRewardedVideoAdPlayFailed: function (placementId: string, errorInfo: string, callbackInfo: string) {
37
+ if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayFailed != null) {
38
+ this.developerCallback.onRewardedVideoAdPlayFailed(placementId, errorInfo, callbackInfo);
39
+ }
40
+ }, onRewardedVideoAdClosed: function (placementId: string, callbackInfo: string) {
41
+ if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdClosed != null) {
42
+ this.developerCallback.onRewardedVideoAdClosed(placementId, callbackInfo);
43
+ }
44
+ }, onRewardedVideoAdPlayClicked: function (placementId: string, callbackInfo: string) {
45
+ if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayClicked != null) {
46
+ this.developerCallback.onRewardedVideoAdPlayClicked(placementId, callbackInfo);
47
+ }
48
+ }, onReward: function (placementId: string, callbackInfo: string) {
49
+ if (this.developerCallback != null && this.developerCallback.onReward != null) {
50
+ this.developerCallback.onReward(placementId, callbackInfo);
51
+ }
52
+ }, onRewardedVideoAdAgainPlayStart: function (placementId: string, callbackInfo: string) {
53
+ if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayStart != null) {
54
+ this.developerCallback.onRewardedVideoAdAgainPlayStart(placementId, callbackInfo);
55
+ }
56
+ }, onRewardedVideoAdAgainPlayEnd: function (placementId: string, callbackInfo: string) {
57
+ if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayEnd != null) {
58
+ this.developerCallback.onRewardedVideoAdAgainPlayEnd(placementId, callbackInfo);
59
+ }
60
+ }, onRewardedVideoAdAgainPlayFailed: function (placementId: string, errorInfo: string, callbackInfo: string) {
61
+ if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayFailed != null) {
62
+ this.developerCallback.onRewardedVideoAdAgainPlayFailed(placementId, errorInfo, callbackInfo);
63
+ }
64
+ }, onRewardedVideoAdAgainPlayClicked: function (placementId: string, callbackInfo: string) {
65
+ if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayClicked != null) {
66
+ this.developerCallback.onRewardedVideoAdAgainPlayClicked(placementId, callbackInfo);
67
+ }
68
+ }, onAgainReward: function (placementId: string, callbackInfo: string) {
69
+ if (this.developerCallback != null && this.developerCallback.onAgainReward != null) {
70
+ this.developerCallback.onAgainReward(placementId, callbackInfo);
71
+ }
72
+ }
73
+ },
74
+
75
+ setAdExtraData: function (placementId: any, settings = {}) {
76
+
77
+ if (undefined != platformBridge) {
78
+ platformBridge.setAdExtraData(placementId, JSON.stringify(settings));
79
+ } else {
80
+ console.log("You must run on Android or iOS.");
81
+ }
82
+ },
83
+
84
+ addPlacementIds: function (placementIds: string[]) {
85
+
86
+ if (undefined != platformBridge) {
87
+ platformBridge.addPlacementIds(JSON.stringify(placementIds));
88
+ } else {
89
+ console.log("You must run on Android or iOS.");
90
+ }
91
+ },
92
+
93
+ removePlacementId: function (placementIds: any) {
94
+
95
+ if (undefined != platformBridge) {
96
+ platformBridge.removePlacementId(JSON.stringify(placementIds));
97
+ } else {
98
+ console.log("You must run on Android or iOS.");
99
+ }
100
+ },
101
+
102
+ setAdListener: function (listener: any) {
103
+ const eventJSON = {};
104
+ eventJSON[LoadedCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdLoaded", eventJSON[LoadFailCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdFailed", eventJSON[PlayStartCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdPlayStart", eventJSON[PlayEndCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdPlayEnd", eventJSON[PlayFailCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdPlayFailed", eventJSON[CloseCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdClosed", eventJSON[ClickCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdPlayClicked", eventJSON[RewardCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onReward", //playAgain listener
105
+ eventJSON[AgainPlayStartCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayStart", eventJSON[AgainPlayEndCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayEnd", eventJSON[AgainPlayFailCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayFailed", eventJSON[AgainClickCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayClicked", eventJSON[AgainRewardCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onAgainReward"
106
+
107
+ if (undefined != platformBridge) {
108
+ platformBridge.setAdListener(JSON.stringify(eventJSON));
109
+ } else {
110
+ console.log("You must run on Android or iOS.");
111
+ }
112
+
113
+ this.ATRewardedVideoListener.developerCallback = listener;
114
+ },
115
+
116
+ hasAdReady: function (placementId: any) {
117
+ if (undefined != platformBridge) {
118
+ return platformBridge.hasAdReady(placementId);
119
+ } else {
120
+ console.log("You must run on Android or iOS.");
121
+ }
122
+ return false;
123
+ },
124
+
125
+ checkAdStatus: function (placementId: any) {
126
+ if (undefined != platformBridge) {
127
+ return platformBridge.checkAdStatus(placementId);
128
+ } else {
129
+ console.log("You must run on Android or iOS.");
130
+ }
131
+ return "";
132
+ },
133
+
134
+ showAd: function (placementId: any) {
135
+ if (undefined != platformBridge) {
136
+ platformBridge.showAd(placementId);
137
+ } else {
138
+ console.log("You must run on Android or iOS.");
139
+ }
140
+ },
141
+
142
+ showAdInScenario: function (placementId: any, scenario: any) {
143
+ if (undefined != platformBridge) {
144
+ platformBridge.showAdInScenario(placementId, scenario);
145
+ } else {
146
+ console.log("You must run on Android or iOS.");
147
+ }
148
+ },
149
+
150
+ entryAdScenario: function (placementId: any, scenario: any) {
151
+ if (undefined != platformBridge) {
152
+ platformBridge.entryAdScenario(placementId, scenario);
153
+ } else {
154
+ console.log("You must run on Android or iOS.");
155
+ }
156
+ }
157
+
158
+ };
159
+
160
+ const LoadedCallbackKey = "RewardedVideoAutoAdLoaded";
161
+ const LoadFailCallbackKey = "RewardedVideoAutoAdLoadFail";
162
+ const PlayStartCallbackKey = "RewardedVideoAutoAdPlayStart";
163
+ const PlayEndCallbackKey = "RewardedVideoAutoAdPlayEnd";
164
+ const PlayFailCallbackKey = "RewardedVideoAutoAdPlayFail";
165
+ const CloseCallbackKey = "RewardedVideoAutoAdClose";
166
+ const ClickCallbackKey = "RewardedVideoAutoAdClick";
167
+ const RewardCallbackKey = "RewardedVideoAutoAdReward";
168
+
169
+ const AgainPlayStartCallbackKey = "RewardedVideoAutoAdAgainPlayStart";
170
+ const AgainPlayEndCallbackKey = "RewardedVideoAutoAdAgainPlayEnd";
171
+ const AgainPlayFailCallbackKey = "RewardedVideoAutoAdAgainPlayFail";
172
+ const AgainClickCallbackKey = "RewardedVideoAutoAdAgainClick";
173
+ const AgainRewardCallbackKey = "RewardedVideoAutoAdAgainReward";
174
+
175
+ window["ATRewardedVideoAutoAdSDK"] = ATRewardedVideoAutoAdSDK;
@@ -0,0 +1,9 @@
1
+ {
2
+ "ver": "4.0.24",
3
+ "importer": "typescript",
4
+ "imported": true,
5
+ "uuid": "24f02659-7d54-453e-b094-f8a41c091ee0",
6
+ "files": [],
7
+ "subMetas": {},
8
+ "userData": {}
9
+ }
@@ -0,0 +1,243 @@
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;
@@ -0,0 +1,9 @@
1
+ {
2
+ "ver": "4.0.24",
3
+ "importer": "typescript",
4
+ "imported": true,
5
+ "uuid": "aa3f24f6-bad5-45bb-bdf3-0ed1939e6af2",
6
+ "files": [],
7
+ "subMetas": {},
8
+ "userData": {}
9
+ }
@@ -0,0 +1,222 @@
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;
@@ -0,0 +1,9 @@
1
+ {
2
+ "ver": "4.0.24",
3
+ "importer": "typescript",
4
+ "imported": true,
5
+ "uuid": "f02af091-32b0-44a2-9014-cf72a7469cd1",
6
+ "files": [],
7
+ "subMetas": {},
8
+ "userData": {}
9
+ }