Commit 7ce9642e authored by jyx's avatar jyx

添加talkingdata

parent 85b94657
package com.duben.xixifree.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
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