Commit e613619d authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 713061bc
...@@ -12,6 +12,8 @@ import com.duben.happyplayletu.utils.DeviceUuidFactory ...@@ -12,6 +12,8 @@ import com.duben.happyplayletu.utils.DeviceUuidFactory
import com.duben.happyplayletu.utils.LogUtil import com.duben.happyplayletu.utils.LogUtil
import com.duben.happyplayletu.utils.MateUtils.getAppMetaData import com.duben.happyplayletu.utils.MateUtils.getAppMetaData
import com.duben.library.utils.json.JsonUtil import com.duben.library.utils.json.JsonUtil
import com.duben.happyplayletu.BuildConfig
import org.json.JSONObject import org.json.JSONObject
...@@ -37,6 +39,9 @@ object GravityEngineManager { ...@@ -37,6 +39,9 @@ object GravityEngineManager {
try { try {
// 在主线程中配置并启动SDK // 在主线程中配置并启动SDK
val config: GEConfig = GEConfig.getInstance(application, ACCESS_TOKEN) val config: GEConfig = GEConfig.getInstance(application, ACCESS_TOKEN)
if (BuildConfig.DEBUG) {
config.mode = GEConfig.ModeEnum.DEBUG
}
// 保存此实例,后续调用方法均需要用到 // 保存此实例,后续调用方法均需要用到
val gravityEngineSDKInstance = GravityEngineSDK.setupAndStart(config) val gravityEngineSDKInstance = GravityEngineSDK.setupAndStart(config)
gravityEngineSDKInstance.initialize( gravityEngineSDKInstance.initialize(
...@@ -63,6 +68,8 @@ object GravityEngineManager { ...@@ -63,6 +68,8 @@ object GravityEngineManager {
ENABLE_SYNC_ATTRIBUTION ENABLE_SYNC_ATTRIBUTION
) )
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }
......
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