Commit 74768dd7 authored by mengcuiguang's avatar mengcuiguang

添加ecpm

parent 5422f347
...@@ -10,8 +10,8 @@ android { ...@@ -10,8 +10,8 @@ android {
applicationId "com.duben.speedplayletu" applicationId "com.duben.speedplayletu"
minSdkVersion rootProject.ext.androidMinSdkVersion minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 717 versionCode 718
versionName "7.1.7" versionName "7.1.8"
flavorDimensions "default" flavorDimensions "default"
// dex突破65535的限制 // dex突破65535的限制
......
...@@ -7,9 +7,9 @@ import com.bytedance.sdk.openadsdk.* ...@@ -7,9 +7,9 @@ import com.bytedance.sdk.openadsdk.*
import com.bytedance.sdk.openadsdk.mediation.ad.IMediationNativeAdInfo import com.bytedance.sdk.openadsdk.mediation.ad.IMediationNativeAdInfo
import com.bytedance.sdk.openadsdk.mediation.ad.MediationAdSlot import com.bytedance.sdk.openadsdk.mediation.ad.MediationAdSlot
import com.bytedance.sdk.openadsdk.mediation.ad.MediationNativeToBannerListener import com.bytedance.sdk.openadsdk.mediation.ad.MediationNativeToBannerListener
import com.duben.speedplayletu.BuildConfig
import com.duben.speedplayletu.MintsApplication import com.duben.speedplayletu.MintsApplication
import com.duben.speedplayletu.manager.UserManager import com.duben.speedplayletu.common.Constant
import com.duben.speedplayletu.manager.TrackManager
import com.duben.speedplayletu.utils.LogUtil import com.duben.speedplayletu.utils.LogUtil
import com.duben.speedplayletu.utils.UIUtils import com.duben.speedplayletu.utils.UIUtils
import java.lang.ref.WeakReference import java.lang.ref.WeakReference
...@@ -40,7 +40,10 @@ object BannerManager { ...@@ -40,7 +40,10 @@ object BannerManager {
// ) // )
// 单位px // 单位px
.supportRenderControl() //支持模板样式 .supportRenderControl() //支持模板样式
.setExpressViewAcceptedSize(UIUtils.getAdWidth2(MintsApplication.getContext()), 0f)//设置模板宽高(dp) .setExpressViewAcceptedSize(
UIUtils.getAdWidth2(MintsApplication.getContext()),
0f
)//设置模板宽高(dp)
.setUserID("1234") .setUserID("1234")
.setMediationAdSlot( .setMediationAdSlot(
MediationAdSlot.Builder() MediationAdSlot.Builder()
...@@ -67,6 +70,13 @@ object BannerManager { ...@@ -67,6 +70,13 @@ object BannerManager {
if (it.size > 0) { if (it.size > 0) {
val ad: TTNativeExpressAd = it[0] val ad: TTNativeExpressAd = it[0]
bannerAd = ad bannerAd = ad
if (bannerAd != null) {
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE3
vo["ecpm"] = bannerAd!!.mediationManager.showEcpm.ecpm
TrackManager.getInstance().cmtEcpm(vo)
}
bannerAd?.setExpressInteractionListener(object : bannerAd?.setExpressInteractionListener(object :
TTNativeExpressAd.ExpressAdInteractionListener { TTNativeExpressAd.ExpressAdInteractionListener {
override fun onAdClicked(view: View?, type: Int) { override fun onAdClicked(view: View?, type: Int) {
......
...@@ -11,10 +11,11 @@ import com.bumptech.glide.Glide ...@@ -11,10 +11,11 @@ import com.bumptech.glide.Glide
import com.bytedance.sdk.openadsdk.* import com.bytedance.sdk.openadsdk.*
import com.bytedance.sdk.openadsdk.mediation.ad.MediationExpressRenderListener import com.bytedance.sdk.openadsdk.mediation.ad.MediationExpressRenderListener
import com.bytedance.sdk.openadsdk.mediation.ad.MediationViewBinder import com.bytedance.sdk.openadsdk.mediation.ad.MediationViewBinder
import com.duben.speedplayletu.BuildConfig
import com.duben.speedplayletu.MintsApplication import com.duben.speedplayletu.MintsApplication
import com.duben.speedplayletu.R import com.duben.speedplayletu.R
import com.duben.speedplayletu.ad.AdManager import com.duben.speedplayletu.ad.AdManager
import com.duben.speedplayletu.common.Constant
import com.duben.speedplayletu.manager.TrackManager
import com.duben.speedplayletu.utils.ForegroundOrBackground import com.duben.speedplayletu.utils.ForegroundOrBackground
import com.duben.speedplayletu.utils.LogUtil import com.duben.speedplayletu.utils.LogUtil
import com.duben.speedplayletu.utils.TimeRender import com.duben.speedplayletu.utils.TimeRender
...@@ -117,6 +118,11 @@ class ExpressManager { ...@@ -117,6 +118,11 @@ class ExpressManager {
private fun showAd() { private fun showAd() {
mTTFeedAd?.let { mTTFeedAd?.let {
val ecpm = it.mediationManager.showEcpm.ecpm
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE1
vo["ecpm"] = ecpm
TrackManager.getInstance().cmtEcpm(vo)
if (it.mediationManager.isExpress) { if (it.mediationManager.isExpress) {
//--------------信息流模板广告渲染---------------- //--------------信息流模板广告渲染----------------
showExpressView(it) showExpressView(it)
......
...@@ -6,8 +6,9 @@ import android.view.ViewGroup ...@@ -6,8 +6,9 @@ import android.view.ViewGroup
import android.widget.* import android.widget.*
import com.bytedance.sdk.openadsdk.* import com.bytedance.sdk.openadsdk.*
import com.bytedance.sdk.openadsdk.mediation.ad.MediationExpressRenderListener import com.bytedance.sdk.openadsdk.mediation.ad.MediationExpressRenderListener
import com.duben.speedplayletu.BuildConfig
import com.duben.speedplayletu.MintsApplication import com.duben.speedplayletu.MintsApplication
import com.duben.speedplayletu.common.Constant
import com.duben.speedplayletu.manager.TrackManager
import com.duben.speedplayletu.utils.ForegroundOrBackground import com.duben.speedplayletu.utils.ForegroundOrBackground
import com.duben.speedplayletu.utils.LogUtil import com.duben.speedplayletu.utils.LogUtil
import com.duben.speedplayletu.utils.UIUtils import com.duben.speedplayletu.utils.UIUtils
...@@ -78,6 +79,11 @@ class MainExpressManager { ...@@ -78,6 +79,11 @@ class MainExpressManager {
expressAdCallback: ExpressAdCallback expressAdCallback: ExpressAdCallback
) { ) {
ttNativeAd?.let { ttNativeAd?.let {
val ecpm = it.mediationManager.showEcpm.ecpm
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE1
vo["ecpm"] = ecpm
TrackManager.getInstance().cmtEcpm(vo)
if (it.mediationManager.isExpress) { if (it.mediationManager.isExpress) {
//--------------信息流模板广告渲染---------------- //--------------信息流模板广告渲染----------------
showExpressView(it, expressAdCallback) showExpressView(it, expressAdCallback)
......
...@@ -12,9 +12,10 @@ import com.bytedance.sdk.openadsdk.* ...@@ -12,9 +12,10 @@ import com.bytedance.sdk.openadsdk.*
import com.bytedance.sdk.openadsdk.mediation.ad.MediationExpressRenderListener import com.bytedance.sdk.openadsdk.mediation.ad.MediationExpressRenderListener
import com.bytedance.sdk.openadsdk.mediation.ad.MediationViewBinder import com.bytedance.sdk.openadsdk.mediation.ad.MediationViewBinder
import com.duben.speedplayletu.MintsApplication import com.duben.speedplayletu.MintsApplication
import com.duben.speedplayletu.BuildConfig
import com.duben.speedplayletu.R import com.duben.speedplayletu.R
import com.duben.speedplayletu.ad.AdManager import com.duben.speedplayletu.ad.AdManager
import com.duben.speedplayletu.common.Constant
import com.duben.speedplayletu.manager.TrackManager
import com.duben.speedplayletu.utils.ForegroundOrBackground import com.duben.speedplayletu.utils.ForegroundOrBackground
import com.duben.speedplayletu.utils.LogUtil import com.duben.speedplayletu.utils.LogUtil
import com.duben.speedplayletu.utils.TimeRender import com.duben.speedplayletu.utils.TimeRender
...@@ -117,6 +118,11 @@ class MyExpressManager { ...@@ -117,6 +118,11 @@ class MyExpressManager {
private fun showAd() { private fun showAd() {
mTTFeedAd?.let { mTTFeedAd?.let {
val ecpm = it.mediationManager.showEcpm.ecpm
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE1
vo["ecpm"] = ecpm
TrackManager.getInstance().cmtEcpm(vo)
if (it.mediationManager.isExpress) { if (it.mediationManager.isExpress) {
//--------------信息流模板广告渲染---------------- //--------------信息流模板广告渲染----------------
showExpressView(it) showExpressView(it)
......
package com.duben.speedplayletu.ad.splash package com.duben.speedplayletu.ad.splash
import android.app.Activity import android.app.Activity
import android.util.Log
import android.view.View import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout import android.widget.FrameLayout
import com.bytedance.sdk.openadsdk.* import com.bytedance.sdk.openadsdk.*
import com.bytedance.sdk.openadsdk.mediation.MediationConstant import com.bytedance.sdk.openadsdk.mediation.MediationConstant
import com.bytedance.sdk.openadsdk.mediation.ad.MediationAdSlot import com.bytedance.sdk.openadsdk.mediation.ad.MediationAdSlot
import com.bytedance.sdk.openadsdk.mediation.ad.MediationSplashRequestInfo import com.bytedance.sdk.openadsdk.mediation.ad.MediationSplashRequestInfo
import com.duben.speedplayletu.BuildConfig
import com.duben.speedplayletu.MintsApplication import com.duben.speedplayletu.MintsApplication
import com.duben.speedplayletu.ad.AdStatusListener import com.duben.speedplayletu.ad.AdStatusListener
import com.duben.speedplayletu.utils.GromorePrintUtil import com.duben.speedplayletu.common.Constant
import com.duben.speedplayletu.manager.TrackManager
import com.duben.speedplayletu.utils.LogUtil import com.duben.speedplayletu.utils.LogUtil
import com.duben.speedplayletu.utils.UIUtils import com.duben.speedplayletu.utils.UIUtils
import java.lang.ref.WeakReference import java.lang.ref.WeakReference
import java.util.HashMap
/** /**
* 应用内-网赚开屏 * 应用内-网赚开屏
...@@ -162,6 +161,15 @@ object SplashManager { ...@@ -162,6 +161,15 @@ object SplashManager {
override fun onAdShow(p0: View?, p1: Int) { override fun onAdShow(p0: View?, p1: Int) {
isShowAd = true isShowAd = true
LogUtil.d(TAG, "gromore 开屏广告--> 6、onAdShow ") LogUtil.d(TAG, "gromore 开屏广告--> 6、onAdShow ")
if (mTTSplashAd != null) {
val vo = HashMap<String, Any>()
mTTSplashAd?.let {
vo["ecpm"] = it.mediationManager.showEcpm.ecpm
vo["adType"] = Constant.GRO_MORE_ADTYPE0
TrackManager.getInstance().cmtEcpm(vo)
}
}
} }
override fun onAdSkip() { override fun onAdSkip() {
......
...@@ -13,6 +13,7 @@ import com.duben.speedplayletu.BuildConfig; ...@@ -13,6 +13,7 @@ import com.duben.speedplayletu.BuildConfig;
import com.duben.speedplayletu.ad.AdManager; import com.duben.speedplayletu.ad.AdManager;
import com.duben.speedplayletu.ad.AdStatusListener; import com.duben.speedplayletu.ad.AdStatusListener;
import com.duben.speedplayletu.common.Constant; import com.duben.speedplayletu.common.Constant;
import com.duben.speedplayletu.manager.TrackManager;
import com.duben.speedplayletu.utils.AppPreferencesManager; import com.duben.speedplayletu.utils.AppPreferencesManager;
import com.duben.speedplayletu.utils.LogUtil; import com.duben.speedplayletu.utils.LogUtil;
import com.duben.speedplayletu.utils.TimeRender; import com.duben.speedplayletu.utils.TimeRender;
...@@ -192,6 +193,10 @@ public class InMoneyVideo { ...@@ -192,6 +193,10 @@ public class InMoneyVideo {
nowAdcode = mttRewardAd.getMediationManager().getShowEcpm().getSlotId(); nowAdcode = mttRewardAd.getMediationManager().getShowEcpm().getSlotId();
nowEcpm = mttRewardAd.getMediationManager().getShowEcpm().getEcpm(); nowEcpm = mttRewardAd.getMediationManager().getShowEcpm().getEcpm();
nowAdSource = mttRewardAd.getMediationManager().getShowEcpm().getSdkName(); nowAdSource = mttRewardAd.getMediationManager().getShowEcpm().getSdkName();
HashMap<String, Object> vo = new HashMap<>();
vo.put("adType", Constant.GRO_MORE_ADTYPE2);
vo.put("ecpm", nowEcpm);
TrackManager.getInstance().cmtEcpm(vo);
} }
} }
LogUtil.d(TAG, "gromore预加载 激励视频广告-->onAdShow"); LogUtil.d(TAG, "gromore预加载 激励视频广告-->onAdShow");
......
...@@ -13,6 +13,7 @@ import com.duben.speedplayletu.BuildConfig; ...@@ -13,6 +13,7 @@ import com.duben.speedplayletu.BuildConfig;
import com.duben.speedplayletu.ad.AdManager; import com.duben.speedplayletu.ad.AdManager;
import com.duben.speedplayletu.ad.AdStatusListener; import com.duben.speedplayletu.ad.AdStatusListener;
import com.duben.speedplayletu.common.Constant; import com.duben.speedplayletu.common.Constant;
import com.duben.speedplayletu.manager.TrackManager;
import com.duben.speedplayletu.utils.AppPreferencesManager; import com.duben.speedplayletu.utils.AppPreferencesManager;
import com.duben.speedplayletu.utils.LogUtil; import com.duben.speedplayletu.utils.LogUtil;
...@@ -131,6 +132,10 @@ public class InMoneyVideoNoPre { ...@@ -131,6 +132,10 @@ public class InMoneyVideoNoPre {
nowAdcode = mttRewardAd.getMediationManager().getShowEcpm().getSlotId(); nowAdcode = mttRewardAd.getMediationManager().getShowEcpm().getSlotId();
nowEcpm = mttRewardAd.getMediationManager().getShowEcpm().getEcpm(); nowEcpm = mttRewardAd.getMediationManager().getShowEcpm().getEcpm();
nowAdSource = mttRewardAd.getMediationManager().getShowEcpm().getSdkName(); nowAdSource = mttRewardAd.getMediationManager().getShowEcpm().getSdkName();
HashMap<String, Object> vo = new HashMap<>();
vo.put("adType", Constant.GRO_MORE_ADTYPE2);
vo.put("ecpm", nowEcpm);
TrackManager.getInstance().cmtEcpm(vo);
} }
} }
LogUtil.d(TAG, "gromore实时加载 激励视频广告-->onAdShow"); LogUtil.d(TAG, "gromore实时加载 激励视频广告-->onAdShow");
......
...@@ -54,4 +54,10 @@ object Constant { ...@@ -54,4 +54,10 @@ object Constant {
var REGISTER_URL = BuildConfig.MainIp+"/agreements/${VersionUtils.getEndPkg()}/yhxy.html"//注册协议 var REGISTER_URL = BuildConfig.MainIp+"/agreements/${VersionUtils.getEndPkg()}/yhxy.html"//注册协议
var PRIVACY_URL = BuildConfig.MainIp+"/agreements/${VersionUtils.getEndPkg()}/syzc.html"//隐私协议 var PRIVACY_URL = BuildConfig.MainIp+"/agreements/${VersionUtils.getEndPkg()}/syzc.html"//隐私协议
var MEMBERS_URL = BuildConfig.MainIp+"/agreements/${VersionUtils.getEndPkg()}/gmxy.html"//会员付费服务协议 var MEMBERS_URL = BuildConfig.MainIp+"/agreements/${VersionUtils.getEndPkg()}/gmxy.html"//会员付费服务协议
//0-开屏,1-信息流,2-激励视频,3-banner
const val GRO_MORE_ADTYPE0 = "0"
const val GRO_MORE_ADTYPE1 = "1"
const val GRO_MORE_ADTYPE2 = "2"
const val GRO_MORE_ADTYPE3 = "3"
} }
\ No newline at end of file
...@@ -80,4 +80,10 @@ public class TrackManager { ...@@ -80,4 +80,10 @@ public class TrackManager {
trackPresenter.commitCsjShotInfo(json); trackPresenter.commitCsjShotInfo(json);
} }
} }
public void cmtEcpm(HashMap<String, Object> vo) {
if (trackPresenter != null) {
trackPresenter.cmtEcpm(vo);
}
}
} }
...@@ -250,4 +250,23 @@ public class TrackPresenter extends BaseTrackPresenter { ...@@ -250,4 +250,23 @@ public class TrackPresenter extends BaseTrackPresenter {
}); });
} }
public void cmtEcpm(HashMap<String, Object> vo) {
AppHttpManager.getInstance(loanApplication)
.call(loanService.cmtEcpm(vo),
new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
}
});
}
} }
...@@ -329,6 +329,15 @@ public interface LoanService { ...@@ -329,6 +329,15 @@ public interface LoanService {
@POST("api/vedioV1/vedio4List") @POST("api/vedioV1/vedio4List")
Observable<BaseResponse<BannerList>> vedio4List(@Body Map<String, Object> vo); Observable<BaseResponse<BannerList>> vedio4List(@Body Map<String, Object> vo);
/**
* 调用事件
*
* @return
*/
@POST("stasticis/adCall/add")
Observable<BaseResponse<Object>> cmtEcpm(@Body Map<String, Object> vo);
/** /**
* 默认http工厂 * 默认http工厂
*/ */
......
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