Commit e3fd4a4c authored by wanglei's avatar wanglei

...fcm直接模式

parent 4543ca83
......@@ -244,8 +244,8 @@ class MyApplication : Application() {
NewComUtils.requestCfg { config ->
if (config != null) {
AppPreferences.getInstance().put("config", config)
initConfig(config)
LogEx.logDebug("requestCfg", "config=$config")
initConfig(config)
} else {
EventUtils.event("configNull")
writeLogFile("config", "configNull")
......@@ -274,7 +274,7 @@ class MyApplication : Application() {
//通知
PopupConfigBean.popupConfigBean = configBean.popupConfigBean
LogEx.logDebug("initConfig", "popupConfigBean=${PopupConfigBean.popupConfigBean.popupCount}")
LogEx.logDebug("initConfig", "popupConfigBean=${PopupConfigBean.popupConfigBean.popupForegroundCanPush}")
//启动定时器
changeTimer()
......
......@@ -139,9 +139,10 @@ object LimitUtils {
* @param lastTime 上一次显示的时间
*/
fun isIntervalLimited(lastTime: Long, adEvent: AdEvent): Boolean {
val flag = ((System.currentTimeMillis() - lastTime) / 1000).toInt() < (AdConfigBean.adsConfigBean.timeInterval)
val passTime = ((System.currentTimeMillis() - lastTime) / 1000).toInt()
val flag = passTime < (AdConfigBean.adsConfigBean.timeInterval)
if (flag) {
adEvent.adShowError("ad in timeInterval")
adEvent.adShowError("ad in timeInterval passTime=$passTime timeInterval=${AdConfigBean.adsConfigBean.timeInterval}")
}
return flag
}
......
......@@ -2,6 +2,7 @@ package com.base.scanqr.bean.config
class PopupConfigBean(
var popupForegroundCanPush: Boolean = false,
var popupStatus: Boolean = true,
var popupCount: Int = 100,
var popupStart: Int = 0,
......
......@@ -89,10 +89,20 @@ object MyNotificationManager {
while (isActive) {
val bean = sendBeanBlockingQueue.take()
LogEx.logDebug(TAG, "sendNotificationIfCan where=${bean.where}")
LogEx.logDebug(
TAG,
"sendNotificationIfCan where=${bean.where} " +
"popupForegroundCanPush=${popupConfigBean.popupForegroundCanPush}"
)
EventUtils.event("Notification_Popup_Start", "where=${bean.where}")
if (!isUnLimit) {
//应用在前台不推
if (MyApplication.PAUSED_VALUE == 1 && !popupConfigBean.popupForegroundCanPush) {
LogEx.logDebug(TAG, "app Foreground")
continue
}
//总的限制条件
if (!canSendNotification(bean.context)) continue
......@@ -197,13 +207,13 @@ object MyNotificationManager {
* 只测某些类型
*/
private var testWhere = listOf(
// POPUP_WHERE_LOCK,
// POPUP_WHERE_BATTERY,
// POPUP_WHERE_PACKAGE,
// POPUP_WHERE_WORK_MANAGER,
// POPUP_WHERE_ALARM,
// POPUP_WHERE_TIMER,
// POPUP_WHERE_FILE_JOB,
POPUP_WHERE_LOCK,
POPUP_WHERE_BATTERY,
POPUP_WHERE_PACKAGE,
POPUP_WHERE_WORK_MANAGER,
POPUP_WHERE_ALARM,
POPUP_WHERE_TIMER,
POPUP_WHERE_FILE_JOB,
POPUP_WHERE_FCM
)
}
\ 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