Commit e385dc3c authored by mengcuiguang's avatar mengcuiguang

添加流量配置

parent 606a7d0d
...@@ -830,6 +830,16 @@ ...@@ -830,6 +830,16 @@
-keep class com.baidu.mobad.** { *; } -keep class com.baidu.mobad.** { *; }
-keep class com.bun.miitmdid.core.** {*;} -keep class com.bun.miitmdid.core.** {*;}
#ks 快手 不接入ks sdk可以不引入
-keep class org.chromium.** {*;}
-keep class org.chromium.** { *; }
-keep class aegon.chrome.** { *; }
-keep class com.kwai.**{ *; }
-dontwarn com.kwai.**
-dontwarn com.kwad.**
-dontwarn com.ksad.**
-dontwarn aegon.chrome.**
# Admob 不接入admob sdk可以不引入 # Admob 不接入admob sdk可以不引入
-keep class com.google.android.gms.ads.MobileAds { -keep class com.google.android.gms.ads.MobileAds {
......
...@@ -43,7 +43,6 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd { ...@@ -43,7 +43,6 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd {
private static final String TAG = CsjGroMoreVideoAdManager.class.getSimpleName(); private static final String TAG = CsjGroMoreVideoAdManager.class.getSimpleName();
private static CsjGroMoreVideoAdManager _inst; private static CsjGroMoreVideoAdManager _inst;
private AppPreferences ps;
private int curCoin; private int curCoin;
private String extraId; private String extraId;
private String carrierType; private String carrierType;
...@@ -52,7 +51,6 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd { ...@@ -52,7 +51,6 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd {
private TTRewardAd mttRewardAd; private TTRewardAd mttRewardAd;
Activity activity; Activity activity;
private UserManager userManager;
private String adUnitId="946018378"; private String adUnitId="946018378";
...@@ -71,8 +69,6 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd { ...@@ -71,8 +69,6 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd {
private void init(Activity activity) { private void init(Activity activity) {
this.activity = activity; this.activity = activity;
ps = new AppPreferences(activity);
userManager = UserManager.getInstance();
} }
...@@ -83,7 +79,6 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd { ...@@ -83,7 +79,6 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd {
mttRewardAd.destroy(); mttRewardAd.destroy();
} }
ps = null;
activity = null; activity = null;
} }
...@@ -140,11 +135,8 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd { ...@@ -140,11 +135,8 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd {
//创建广告请求参数AdSlot,具体参数含义参考文档 //创建广告请求参数AdSlot,具体参数含义参考文档
com.bytedance.msdk.api.AdSlot.Builder adSlotBuilder = new com.bytedance.msdk.api.AdSlot.Builder() com.bytedance.msdk.api.AdSlot.Builder adSlotBuilder = new com.bytedance.msdk.api.AdSlot.Builder()
.setTTVideoOption(videoOption) .setTTVideoOption(videoOption)
.setRewardName("金币") //奖励的名称 .setUserID(UserManager.getInstance().getUserID())//用户id,必传参数
.setRewardAmount(3) //奖励的数量
.setUserID("user123")//用户id,必传参数
.setAdStyleType(AdSlot.TYPE_EXPRESS_AD) // 确保该聚合广告位下所有gdt代码位都是同一种类型(模版或非模版)。 .setAdStyleType(AdSlot.TYPE_EXPRESS_AD) // 确保该聚合广告位下所有gdt代码位都是同一种类型(模版或非模版)。
.setCustomData(customData) // 激励视频开启服务端验证时,透传给adn的自定义数据。
.setOrientation(orientation);//必填参数,期望视频的播放方向:TTAdConstant.HORIZONTAL 或 TTAdConstant.VERTICAL .setOrientation(orientation);//必填参数,期望视频的播放方向:TTAdConstant.HORIZONTAL 或 TTAdConstant.VERTICAL
//请求广告 //请求广告
......
...@@ -4,12 +4,15 @@ import android.app.Activity; ...@@ -4,12 +4,15 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.provider.Settings; import android.provider.Settings;
import com.bytedance.hume.readapk.HumeSDK;
import com.bytedance.msdk.api.TTAdConfig; import com.bytedance.msdk.api.TTAdConfig;
import com.bytedance.msdk.api.TTAdConstant; import com.bytedance.msdk.api.TTAdConstant;
import com.bytedance.msdk.api.TTMediationAdSdk; import com.bytedance.msdk.api.TTMediationAdSdk;
import com.bytedance.msdk.api.UserInfoForSegment; import com.bytedance.msdk.api.UserInfoForSegment;
import com.mints.goodmoney.BuildConfig; import com.mints.goodmoney.BuildConfig;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant; import com.mints.goodmoney.common.Constant;
import com.mints.library.utils.CommonUtils;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -44,16 +47,16 @@ public class TTGroMoreAdManagerHolder { ...@@ -44,16 +47,16 @@ public class TTGroMoreAdManagerHolder {
private static TTAdConfig buildConfig(Context context) { private static TTAdConfig buildConfig(Context context) {
UserInfoForSegment userInfo = new UserInfoForSegment(); UserInfoForSegment userInfo = new UserInfoForSegment();
userInfo.setUserId("msdk demo"); userInfo.setUserId(UserManager.getInstance().getUserID());
userInfo.setGender(UserInfoForSegment.GENDER_UNKNOWN); userInfo.setGender(UserInfoForSegment.GENDER_UNKNOWN);
userInfo.setChannel("msdk channel"); userInfo.setChannel(CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME"));
userInfo.setSubChannel("msdk sub channel"); userInfo.setSubChannel(HumeSDK.getChannel(MintsApplication.getContext()));
userInfo.setAge(999); userInfo.setAge(999);
userInfo.setUserValueGroup("msdk demo user value group"); userInfo.setUserValueGroup("msdk demo user value group");
Map<String, String> customInfos = new HashMap<>(); Map<String, String> customInfos = new HashMap<>();
customInfos.put("aaaa", "test111"); // customInfos.put("aaaa", "test111");
customInfos.put("bbbb", "test222"); // customInfos.put("bbbb", "test222");
userInfo.setCustomInfos(customInfos); userInfo.setCustomInfos(customInfos);
return new TTAdConfig.Builder() return new TTAdConfig.Builder()
.appId(TT_AD_APPID) //必填 ,不能为空 .appId(TT_AD_APPID) //必填 ,不能为空
......
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