Commit 7d00f0f5 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 482672df
......@@ -46,6 +46,10 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
private long adLoadTime = 0;// 广告展示时间,45分钟后当前广告失效,重新预加载广告
private long adPreingTime = 0;// 防止预加载超时 2分钟
private String adcode = "";
private String ecpm = "";
private int adSource = 0;
public static PreCsjGroMoreVideoAdManager getInstance() {
if (_inst == null) {
_inst = new PreCsjGroMoreVideoAdManager();
......@@ -138,13 +142,6 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
//该方法直接展示广告
//展示广告,并传入广告展示的场景
mttRewardAd.showRewardAd(this.activity.get(), mTTRewardedAdListener);
HashMap<String, Object> vo = new HashMap<>();
vo.put("adcode", mttRewardAd.getAdNetworkRitId());
vo.put("ecpm", mttRewardAd.getPreEcpm());
vo.put("adSource", mttRewardAd.getAdNetworkPlatformId());
vo.put("carrierType", carrierType);
TrackManager.getInstance().reporGromeEcpm(vo);
} else {
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_GROMORE, Constant.EVENT_TYPE_ONE, "999999", "Cached Fail");
LogUtil.d(TAG, "5、展示广告时失败了,广告可能超时45分钟 onError ");
......@@ -235,6 +232,18 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
* 广告的展示回调 每个广告仅回调一次
*/
public void onRewardedAdShow() {
if (mttRewardAd != null) {
HashMap<String, Object> vo = new HashMap<>();
adcode = mttRewardAd.getAdNetworkRitId();
ecpm = mttRewardAd.getPreEcpm();
adSource = mttRewardAd.getAdNetworkPlatformId();
vo.put("adcode", adcode);
vo.put("ecpm", ecpm);
vo.put("adSource", adSource);
vo.put("carrierType", carrierType);
TrackManager.getInstance().reporGromeEcpm(vo);
}
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_GROMORE, Constant.EVENT_TYPE_ZERO, "", "");
preLoadAd(activity.get());
......@@ -272,46 +281,42 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_GROMORE, Constant.EVENT_TYPE_THREE, "", "");
HashMap<String, Object> voTemp = getAdMapVO(carrierType, Constant.AD_SOURCE_GROMORE, extraId, curCoin);
if (mttRewardAd != null) {
String groAdsouce = String.valueOf(mttRewardAd.getAdNetworkPlatformId());
switch (mttRewardAd.getAdNetworkPlatformId()) {
case 1:
groAdsouce = "CSJ";
break;
case 3:
groAdsouce = "YLH";
break;
case 7:
groAdsouce = "KS";
break;
}
voTemp.put("gromoreAdsource", groAdsouce);
voTemp.put("ecpmId", AppConfig.gromoreId);
String groAdsouce = String.valueOf(adSource);
switch (adSource) {
case 1:
groAdsouce = "CSJ";
break;
case 3:
groAdsouce = "YLH";
break;
case 7:
groAdsouce = "KS";
break;
}
voTemp.put("gromoreAdsource", groAdsouce);
voTemp.put("ecpmId", AppConfig.gromoreId);
TrackManager.getInstance().reportAddCoinMsg(activity.get(), voTemp);
if (mttRewardAd != null) {
/**
* SDK_NAME_NO_PERMISSION = -3; //无权限
* * SDK_NAME_NO_DATA = -2; //暂无数据
* * SDK_NAME_PANGLE = 1;
* * SDK_NAME_ADMOB = 2;
* * SDK_NAME_GDT = 3;
* * SDK_NAME_MT = 4;
* * SDK_NAME_UNITY = 5;
* * SDK_NAME_BAIDU = 6;
* * SDK_NAME_KS = 7;
* * SDK_NAME_SIGMOB = 8;
*/
HashMap<String, Object> vo = new HashMap<>();
vo.put("adcode", mttRewardAd.getAdNetworkRitId());
vo.put("ecpm", mttRewardAd.getPreEcpm());
vo.put("adSource", mttRewardAd.getAdNetworkPlatformId());
vo.put("adType", Constant.GRO_MORE_ADTYPE2);
vo.put("ecpmId", AppConfig.gromoreId);
vo.put("adid", CsjGroMoreManager.INSTANCE.getAPP_IN_MAIN_AD_UNIT_VIDEO_ID());
TrackManager.getInstance().cmtGroMoreInfo(vo);
}
/**
* SDK_NAME_NO_PERMISSION = -3; //无权限
* * SDK_NAME_NO_DATA = -2; //暂无数据
* * SDK_NAME_PANGLE = 1;
* * SDK_NAME_ADMOB = 2;
* * SDK_NAME_GDT = 3;
* * SDK_NAME_MT = 4;
* * SDK_NAME_UNITY = 5;
* * SDK_NAME_BAIDU = 6;
* * SDK_NAME_KS = 7;
* * SDK_NAME_SIGMOB = 8;
*/
HashMap<String, Object> vo = new HashMap<>();
vo.put("adcode", adcode);
vo.put("ecpm", ecpm);
vo.put("adSource", adSource);
vo.put("adType", Constant.GRO_MORE_ADTYPE2);
vo.put("ecpmId", AppConfig.gromoreId);
vo.put("adid", CsjGroMoreManager.INSTANCE.getAPP_IN_MAIN_AD_UNIT_VIDEO_ID());
TrackManager.getInstance().cmtGroMoreInfo(vo);
if (videoAdStatusListener != null) {
videoAdStatusListener.adSuccess();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment