@@ -39,32 +39,22 @@ package com.mike.utils
39
39
isIos = DeviceUtil. isIos();
40
40
if (isIos || PlatUtil. isCertainPlat(PlatType. GOOGLE_PLAY ))
41
41
{
42
- // if (Admob.getInstance().supportDevice)
43
- // {
44
- // if (isIos)
45
- // Admob.getInstance().setKeys("ca-app-pub-7801284693895243/1462394619","ca-app-pub-7801284693895243/4415861017");
46
- // else
47
- // Admob.getInstance().setKeys("ca-app-pub-7801284693895243/8332539819","ca-app-pub-7801284693895243/3762739414");
48
- // Admob.getInstance().cacheInterstitial();
49
- // Admob.getInstance().addEventListener(AdmobEvent.onInterstitialDismiss, onFullMiss);
50
- // Admob.getInstance().addEventListener(AdmobEvent.onInterstitialReceive, onFullReveive);
51
- // Admob.getInstance().addEventListener(AdmobEvent.onInterstitialFailedReceive, onFullFailedReveive);
52
- // Admob.getInstance().addEventListener(AdmobEvent.onInterstitialLeaveApplication, onFullLeave);
53
- // Admob.getInstance().addEventListener(AdmobEvent.onInterstitialPresent, onFullPresent);
54
- // }
42
+ if (Admob. getInstance (). supportDevice)
43
+ {
44
+ if (isIos)
45
+ Admob. getInstance (). setKeys("ca-app-pub-7801284693895243/1462394619" ,"ca-app-pub-7801284693895243/4415861017" );
46
+ else
47
+ Admob. getInstance (). setKeys("ca-app-pub-7801284693895243/8332539819" ,"ca-app-pub-7801284693895243/3762739414" );
48
+ Admob. getInstance (). cacheInterstitial();
49
+ Admob. getInstance (). addEventListener (AdmobEvent. onInterstitialDismiss, onFullMiss);
50
+ Admob. getInstance (). addEventListener (AdmobEvent. onInterstitialReceive, onFullReveive);
51
+ Admob. getInstance (). addEventListener (AdmobEvent. onInterstitialFailedReceive, onFullFailedReveive);
52
+ Admob. getInstance (). addEventListener (AdmobEvent. onInterstitialLeaveApplication, onFullLeave);
53
+ Admob. getInstance (). addEventListener (AdmobEvent. onInterstitialPresent, onFullPresent);
54
+ }
55
55
}else if (PlatUtil. isCertainPlat(PlatType. ANDROID_4399 )){
56
56
// SsjjAdsManager.getInstance().init();
57
57
// SsjjAdsManager.getInstance().addEventListener(Constants.EVENT_TYPE_ADS_CALLBACK, onAdsCallback);
58
- }else if (PlatUtil. isCertainPlat(PlatType. ANDROID_360 )){
59
- Ad360. instance. init ("48415163d9dfe2657656da45dc523132" ,"9b826737771399dcc63fa76155db0fa7" );
60
- // Ad360.instance.init("bb92999153bbc9861de3399be84c3a14","78c5db4fd9bb8367ba26868893847738");
61
- Ad360. instance. loadInsert();
62
- Ad360. instance. addEventListener (Ad360BannerEvent. REQUEST_SUCCESS , onAd360Banner);
63
- Ad360. instance. addEventListener (Ad360BannerEvent. REQUEST_FAILED , onAd360Banner);
64
- Ad360. instance. addEventListener (Ad360BannerEvent. SHOW_SUCCESS , onAd360Banner);
65
- Ad360. instance. addEventListener (Ad360InsertEvent. SHOW_SUCCESS , onAd360Insert);
66
- Ad360. instance. addEventListener (Ad360InsertEvent. REQUEST_FAILED , onAd360Insert);
67
- Ad360. instance. addEventListener (Ad360InsertEvent. REQUEST_SUCCESS , onAd360Insert);
68
58
}else {
69
59
// if (BaiDu.getInstance().supportDevice)
70
60
// {
@@ -79,15 +69,6 @@ package com.mike.utils
79
69
}
80
70
}
81
71
82
- protected static function onAd360Insert (event :Ad360InsertEvent ):void
83
- {
84
- trace ("insert" + event. type );
85
- }
86
-
87
- protected static function onAd360Banner (event :Ad360BannerEvent ):void
88
- {
89
- trace ("banner" + event. type );
90
- }
91
72
92
73
/*private static function onAdsCallback(e:AdsCallbackEvent):void{
93
74
//广告类展示、关闭、失败回调
@@ -138,7 +119,7 @@ package com.mike.utils
138
119
{
139
120
trace ("全屏广告关闭" );
140
121
// if (isIos || PlatUtil.isCertainPlat(PlatType.GOOGLE_PLAY))
141
- // Admob.getInstance().cacheInterstitial();
122
+ Admob. getInstance (). cacheInterstitial();
142
123
// else
143
124
// BaiDu.getInstance().cacheInterstitial();
144
125
}
@@ -149,41 +130,35 @@ package com.mike.utils
149
130
{
150
131
trace (stage . orientation );
151
132
// if (isIos || PlatUtil.isCertainPlat(PlatType.GOOGLE_PLAY))
152
- // Admob.getInstance().showBanner(Admob.BANNER,AdmobPosition.BOTTOM_CENTER);
133
+ Admob. getInstance (). showBanner(Admob. BANNER ,AdmobPosition. BOTTOM_CENTER );
153
134
// else if (PlatUtil.isCertainPlat(PlatType.ANDROID_4399))
154
135
// SsjjAdsManager.getInstance().showBanner();
155
- // else if (PlatUtil.isCertainPlat(PlatType.ANDROID_360)
156
- Ad360. instance. showBanner();
157
136
// else
158
137
// BaiDu.getInstance().showBanner(BaiDu.BANNER,RelationPosition.BOTTOM_CENTER);
159
138
}
160
139
161
140
public static function hideBaiDuBanner ():void
162
141
{
163
142
// if (isIos || PlatUtil.isCertainPlat(PlatType.GOOGLE_PLAY))
164
- // Admob.getInstance().hideBanner();
143
+ Admob. getInstance (). hideBanner();
165
144
// else if (PlatUtil.isCertainPlat(PlatType.ANDROID_4399))
166
145
// SsjjAdsManager.getInstance().hideBanner();
167
- // else if (PlatUtil.isCertainPlat(PlatType.ANDROID_360)
168
- Ad360. instance. hideBanner();
169
146
// else
170
147
// BaiDu.getInstance().hideBanner();
171
148
}
172
149
173
150
public static function cacheInterstitial ():void
174
151
{
175
152
// if (isIos || PlatUtil.isCertainPlat(PlatType.GOOGLE_PLAY))
176
- // Admob.getInstance().cacheInterstitial();
177
- // else if (PlatUtil.isCertainPlat(PlatType.ANDROID_360)
178
- Ad360. instance. loadInsert();
153
+ Admob. getInstance (). cacheInterstitial();
179
154
// else
180
155
// BaiDu.getInstance().cacheInterstitial();
181
156
}
182
157
183
158
public static function isInterstitialReady ():Boolean
184
159
{
185
160
// if (isIos || PlatUtil.isCertainPlat(PlatType.GOOGLE_PLAY))
186
- // return Admob.getInstance().isInterstitialReady();
161
+ return Admob. getInstance (). isInterstitialReady();
187
162
// else
188
163
// return BaiDu.getInstance().isInterstitialReady();
189
164
return true ;
@@ -193,23 +168,19 @@ package com.mike.utils
193
168
{
194
169
trace (GameInstance. instance. sceneWidth, GameInstance. instance. sceneHeight,stage . orientation ,stage . autoOrients);
195
170
// if (isIos || PlatUtil.isCertainPlat(PlatType.GOOGLE_PLAY))
196
- // Admob.getInstance().showInterstitial();
171
+ Admob. getInstance (). showInterstitial();
197
172
// else if (PlatUtil.isCertainPlat(PlatType.ANDROID_4399))
198
173
// SsjjAdsManager.getInstance().showFullScreen();
199
- // else if (PlatUtil.isCertainPlat(PlatType.ANDROID_360)
200
- Ad360. instance. showInsert();
201
174
// else
202
175
// BaiDu.getInstance().showInterstitial();
203
176
}
204
177
205
178
public static function getBaiDuInstance ():EventDispatcher
206
179
{
207
180
// if (isIos || PlatUtil.isCertainPlat(PlatType.GOOGLE_PLAY))
208
- // return Admob.getInstance();
181
+ return Admob. getInstance ();
209
182
// else if (PlatUtil.isCertainPlat(PlatType.ANDROID_4399))
210
183
// return SsjjAdsManager.getInstance();
211
- // else if (PlatUtil.isCertainPlat(PlatType.ANDROID_360)
212
- Ad360. instance;
213
184
// else
214
185
// return BaiDu.getInstance();
215
186
return null ;
0 commit comments