Commit ff98aa59 authored by mengcuiguang's avatar mengcuiguang

接入talkingdata

parent de46dbe1
......@@ -67,6 +67,7 @@ android {
buildConfigField "String", "GROMORE_DRAW_CODE", GROMORE_DRAW_CODE
buildConfigField "String", "GROMORE_EXPRESS_CODE", GROMORE_EXPRESS_CODE
buildConfigField "String", "GROMORE_BANNER_CODE", GROMORE_BANNER_CODE
buildConfigField "String", "RELEASE_TALKING_DATA_KEY", RELEASE_TALKING_DATA_KEY
buildConfigField "String", "WEIXIN_APP_PAY_ID", WEIXIN_APP_PAY_ID
//混淆
......@@ -89,6 +90,7 @@ android {
buildConfigField "String", "GROMORE_DRAW_CODE", GROMORE_DRAW_CODE
buildConfigField "String", "GROMORE_EXPRESS_CODE", GROMORE_EXPRESS_CODE
buildConfigField "String", "GROMORE_BANNER_CODE", GROMORE_BANNER_CODE
buildConfigField "String", "RELEASE_TALKING_DATA_KEY", RELEASE_TALKING_DATA_KEY
buildConfigField "String", "WEIXIN_APP_PAY_ID", WEIXIN_APP_PAY_ID
//混淆
......
......@@ -12,6 +12,7 @@ import com.downloader.PRDownloaderConfig;
import com.mints.helivideo.ad.TTAdManagerHolder;
import com.mints.helivideo.common.Constant;
import com.mints.helivideo.manager.TXCSDKService;
import com.mints.helivideo.manager.TalkingDataManager;
import com.mints.helivideo.manager.UmengManager;
import com.mints.helivideo.net.LoanService;
import com.mints.helivideo.net.V6Service;
......@@ -86,6 +87,7 @@ public class MintsApplication extends MultiDexApplication {
TXCSDKService.init(this);
TalkingDataManager.INSTANCE.init(this);
// PR下载附件
initPRDownloader();
......
package com.mints.helivideo.manager
import android.app.Application
import android.content.Context
import com.mints.helivideo.BuildConfig
import com.mints.helivideo.utils.MateUtils
import com.tendcloud.tenddata.TCAgent
/**
* TalkingData
*/
object TalkingDataManager {
private const val APP_KEY =BuildConfig.RELEASE_TALKING_DATA_KEY
fun init(application:Application) {
try {
//打开日志
TCAgent.LOG_ON = BuildConfig.LOG_DEBUG
/**
* 动态获取渠道ID(类似友盟)
* AppID说是xml文件里的密钥?
*/
TCAgent.init(application, APP_KEY
, MateUtils.getAppMetaData(application, "CHANNEL_NAME"))
/**
* true-开启自动捕获错误
*/
TCAgent.setReportUncaughtExceptions(true)
} catch (e: Exception) {
e.printStackTrace()
}
}
fun onResume(cxt:Context,name:String){
TCAgent.onPageStart(cxt, name)
}
fun onPause(cxt:Context,name:String){
TCAgent.onPageEnd(cxt, name)
}
}
\ No newline at end of file
......@@ -15,6 +15,7 @@ import android.view.Window;
import android.view.WindowManager;
import com.google.android.material.snackbar.Snackbar;
import com.mints.helivideo.manager.TalkingDataManager;
import com.mints.helivideo.manager.UmengManager;
import com.mints.library.utils.CommonUtils;
import com.mints.helivideo.R;
......@@ -109,6 +110,7 @@ public abstract class BaseAppCompatActivity extends TransitionActivity {
super.onResume();
UmengManager.INSTANCE.onResume(this);
TalkingDataManager.INSTANCE.onResume(this,getClass().getSimpleName());
}
@Override
......@@ -116,6 +118,7 @@ public abstract class BaseAppCompatActivity extends TransitionActivity {
super.onPause();
UmengManager.INSTANCE.onPause(this);
TalkingDataManager.INSTANCE.onPause(this,getClass().getSimpleName());
}
@Override
......
......@@ -40,6 +40,9 @@ WEIXIN_APP_PAY_ID ="wx7e946f66585ca00a"
WEIXIN_APP_ID =wx7e946f66585ca00a
WEIXIN_APP_SECRET =6fe41783e736bea36504b271cea484f1
#TalkingData
RELEASE_TALKING_DATA_KEY="E91735A7978140A8ABD1BB32D337CCAB"
#umeng
RELEASE_UMENG_KEY=64b8de13a1a164591b5133df
......
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