Commit 453a163e authored by wanglei's avatar wanglei

...前台不推送限制

parent 9d19c889
...@@ -2,6 +2,7 @@ package com.base.appzxhy.bean.config ...@@ -2,6 +2,7 @@ package com.base.appzxhy.bean.config
class PopupConfigBean( class PopupConfigBean(
var popupForegroundCanPush: Boolean = false,
var popupStatus: Boolean = true, var popupStatus: Boolean = true,
var popupCount: Int = 24, var popupCount: Int = 24,
var popupStart: Int = 0, var popupStart: Int = 0,
......
...@@ -2,6 +2,7 @@ package com.base.appzxhy.fcm.notification ...@@ -2,6 +2,7 @@ package com.base.appzxhy.fcm.notification
import android.content.Context import android.content.Context
import com.base.appzxhy.BuildConfig import com.base.appzxhy.BuildConfig
import com.base.appzxhy.MyApplication
import com.base.appzxhy.bean.NotificationSendBean import com.base.appzxhy.bean.NotificationSendBean
import com.base.appzxhy.bean.NotificationSendBean.Companion.ACTION_ID_SCAN import com.base.appzxhy.bean.NotificationSendBean.Companion.ACTION_ID_SCAN
import com.base.appzxhy.bean.NotificationSendBean.Companion.POPUP_WHERE_TIMER import com.base.appzxhy.bean.NotificationSendBean.Companion.POPUP_WHERE_TIMER
...@@ -65,10 +66,15 @@ object MyNotificationManager { ...@@ -65,10 +66,15 @@ object MyNotificationManager {
EventUtils.event("Notification_Popup_Start", "where=${bean.where}") EventUtils.event("Notification_Popup_Start", "where=${bean.where}")
if (!isUnLimit) { if (!isUnLimit) {
//应用在前台不推
if (MyApplication.PAUSED_VALUE == 1 && !popupConfigBean.popupForegroundCanPush) {
LogEx.logDebug(TAG, "app Foreground")
continue
}
//总的限制条件 //总的限制条件
if (!canSendNotification(bean.context)) continue if (!canSendNotification(bean.context)) continue
//条推送是否可以推送 //其他条推送是否可以推送
if (!bean.canSend.invoke()) continue if (!bean.canSend.invoke()) continue
} }
......
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