Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
Scan QR Code Barcode Reader
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
Scan QR Code Barcode Reader
Commits
e3fd4a4c
Commit
e3fd4a4c
authored
Jan 08, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...fcm直接模式
parent
4543ca83
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
12 deletions
+24
-12
MyApplication.kt
app/src/main/java/com/base/scanqr/MyApplication.kt
+2
-2
LimitUtils.kt
app/src/main/java/com/base/scanqr/ads/LimitUtils.kt
+3
-2
PopupConfigBean.kt
.../main/java/com/base/scanqr/bean/config/PopupConfigBean.kt
+1
-0
MyNotificationManager.kt
...com/base/scanqr/fcm/notification/MyNotificationManager.kt
+18
-8
No files found.
app/src/main/java/com/base/scanqr/MyApplication.kt
View file @
e3fd4a4c
...
...
@@ -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.popup
Count
}"
)
LogEx
.
logDebug
(
"initConfig"
,
"popupConfigBean=${PopupConfigBean.popupConfigBean.popup
ForegroundCanPush
}"
)
//启动定时器
changeTimer
()
...
...
app/src/main/java/com/base/scanqr/ads/LimitUtils.kt
View file @
e3fd4a4c
...
...
@@ -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
}
...
...
app/src/main/java/com/base/scanqr/bean/config/PopupConfigBean.kt
View file @
e3fd4a4c
...
...
@@ -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
,
...
...
app/src/main/java/com/base/scanqr/fcm/notification/MyNotificationManager.kt
View file @
e3fd4a4c
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment