Commit 326e87ad authored by mengcuiguang2's avatar mengcuiguang2

添加第一次打开开屏随机弹出

parent 71b1d6aa
...@@ -12,8 +12,8 @@ android { ...@@ -12,8 +12,8 @@ android {
applicationId "com.mints.helivideo" applicationId "com.mints.helivideo"
minSdkVersion rootProject.ext.androidMinSdkVersion minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 11 versionCode 12
versionName "1.1.0" versionName "1.1.1"
flavorDimensions "default" flavorDimensions "default"
// dex突破65535的限制 // dex突破65535的限制
......
...@@ -54,13 +54,12 @@ public class MintsApplication extends MultiDexApplication { ...@@ -54,13 +54,12 @@ public class MintsApplication extends MultiDexApplication {
super.onCreate(); super.onCreate();
mContext = this.getApplicationContext(); mContext = this.getApplicationContext();
// 友盟SDK预初始化函数 // // 友盟SDK预初始化函数
// preInit预初始化函数耗时极少,不会影响App首次冷启动用户体验 // // preInit预初始化函数耗时极少,不会影响App首次冷启动用户体验
UmengManager.INSTANCE.preInit(this, // UmengManager.INSTANCE.preInit(this,
MateUtils.INSTANCE.getAppMetaData(this, "CHANNEL_NAME")); // MateUtils.INSTANCE.getAppMetaData(this, "CHANNEL_NAME"));
// 判断应用是否在前台
ForegroundOrBackground.init(this);
// 三方配置 // 三方配置
thirdConfig(); thirdConfig();
...@@ -80,6 +79,8 @@ public class MintsApplication extends MultiDexApplication { ...@@ -80,6 +79,8 @@ public class MintsApplication extends MultiDexApplication {
if (AppPreferencesManager.INSTANCE.get() if (AppPreferencesManager.INSTANCE.get()
.getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) return; .getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) return;
// 判断应用是否在前台
ForegroundOrBackground.init(this);
initMiitHelper(); initMiitHelper();
......
...@@ -34,10 +34,10 @@ object TalkingDataManager { ...@@ -34,10 +34,10 @@ object TalkingDataManager {
} }
fun onResume(cxt:Context,name:String){ fun onResume(cxt:Context,name:String){
TCAgent.onPageStart(cxt, name) // TCAgent.onPageStart(cxt, name)
} }
fun onPause(cxt:Context,name:String){ fun onPause(cxt:Context,name:String){
TCAgent.onPageEnd(cxt, name) // TCAgent.onPageEnd(cxt, name)
} }
} }
\ No newline at end of file
...@@ -22,31 +22,31 @@ object UmengManager { ...@@ -22,31 +22,31 @@ object UmengManager {
* 友盟初始化 * 友盟初始化
*/ */
fun initUm(application: Application, channel: String) { fun initUm(application: Application, channel: String) {
try { // try {
/* // /*
* 参数4:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机。 // * 参数4:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机。
* 参数5:Push推送业务的secret,需要集成Push功能时必须传入Push的secret,否则传空。 // * 参数5:Push推送业务的secret,需要集成Push功能时必须传入Push的secret,否则传空。
*/ // */
UMConfigure.init( // UMConfigure.init(
application, // application,
MateUtils.getAppMetaData(application, "UMENG_KEY"), // MateUtils.getAppMetaData(application, "UMENG_KEY"),
channel, // channel,
UMConfigure.DEVICE_TYPE_PHONE, // UMConfigure.DEVICE_TYPE_PHONE,
"" // ""
) // )
UMConfigure.setLogEnabled(BuildConfig.DEBUG) // UMConfigure.setLogEnabled(BuildConfig.DEBUG)
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.LEGACY_MANUAL) // MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.LEGACY_MANUAL)
} catch (e: java.lang.Exception) { // } catch (e: java.lang.Exception) {
e.printStackTrace() // e.printStackTrace()
} // }
} }
fun onResume(context: Context) { fun onResume(context: Context) {
MobclickAgent.onResume(context) // MobclickAgent.onResume(context)
} }
fun onPause(context: Context) { fun onPause(context: Context) {
MobclickAgent.onPause(context) // MobclickAgent.onPause(context)
} }
} }
\ 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