Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PDF Viewer Scanner White
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
PDF Viewer Scanner White
Commits
93e19780
Commit
93e19780
authored
Oct 12, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
67d6402e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
MessagingService.java
.../com/base/pdfviewerscannerwhite/fcm/MessagingService.java
+3
-2
NotificationUiUtil.kt
.../com/base/pdfviewerscannerwhite/fcm/NotificationUiUtil.kt
+10
-0
PopupConstObject.kt
...va/com/base/pdfviewerscannerwhite/fcm/PopupConstObject.kt
+2
-0
No files found.
app/src/main/java/com/base/pdfviewerscannerwhite/fcm/MessagingService.java
View file @
93e19780
...
@@ -2,9 +2,7 @@ package com.base.pdfviewerscannerwhite.fcm;
...
@@ -2,9 +2,7 @@ package com.base.pdfviewerscannerwhite.fcm;
import
android.annotation.SuppressLint
;
import
android.annotation.SuppressLint
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
com.base.pdfviewerscannerwhite.helper.EventUtils
;
import
com.base.pdfviewerscannerwhite.helper.EventUtils
;
import
com.base.pdfviewerscannerwhite.utils.LogEx
;
import
com.base.pdfviewerscannerwhite.utils.LogEx
;
import
com.google.firebase.messaging.FirebaseMessagingService
;
import
com.google.firebase.messaging.FirebaseMessagingService
;
...
@@ -20,6 +18,9 @@ public class MessagingService extends FirebaseMessagingService {
...
@@ -20,6 +18,9 @@ public class MessagingService extends FirebaseMessagingService {
super
.
onMessageReceived
(
remoteMessage
);
super
.
onMessageReceived
(
remoteMessage
);
LogEx
.
INSTANCE
.
logDebug
(
TAG
,
"onMessageReceived"
,
false
);
LogEx
.
INSTANCE
.
logDebug
(
TAG
,
"onMessageReceived"
,
false
);
EventUtils
.
INSTANCE
.
event
(
"FCM_Received"
,
null
,
null
,
false
);
EventUtils
.
INSTANCE
.
event
(
"FCM_Received"
,
null
,
null
,
false
);
String
action
=
NotificationUiUtil
.
INSTANCE
.
getNextActionId
();
NotificationUiUtil
.
INSTANCE
.
sendNotification
(
this
,
action
,
PopupConstObject
.
POPUP_WHERE_FCM
);
}
}
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/fcm/NotificationUiUtil.kt
View file @
93e19780
...
@@ -17,15 +17,18 @@ import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_NEW_I
...
@@ -17,15 +17,18 @@ import com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_NEW_I
import
com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_READ_DOCUMENTS
import
com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_READ_DOCUMENTS
import
com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_READ_PDF
import
com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_READ_PDF
import
com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_UN_VIEW_FILES
import
com.base.pdfviewerscannerwhite.bean.ConstObject.NOTIFICATION_ACTION_UN_VIEW_FILES
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.POPUP_WHERE_FCM
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.POPUP_WHERE_LOCK
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.POPUP_WHERE_LOCK
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.POPUP_WHERE_TIMBER
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.POPUP_WHERE_TIMBER
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_count
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_count
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_end
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_end
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_fcm_interval
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_interval
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_interval
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_lock_interval
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_lock_interval
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_start
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_start
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_status
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_status
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_timber_interval
import
com.base.pdfviewerscannerwhite.fcm.PopupConstObject.popup_timber_interval
import
com.base.pdfviewerscannerwhite.helper.EventUtils
import
com.base.pdfviewerscannerwhite.helper.MyApplication
import
com.base.pdfviewerscannerwhite.helper.MyApplication
import
com.base.pdfviewerscannerwhite.ui.splash.SplashActivity
import
com.base.pdfviewerscannerwhite.ui.splash.SplashActivity
import
com.base.pdfviewerscannerwhite.utils.AppPreferences
import
com.base.pdfviewerscannerwhite.utils.AppPreferences
...
@@ -75,6 +78,7 @@ object NotificationUiUtil {
...
@@ -75,6 +78,7 @@ object NotificationUiUtil {
//是否开启推送
//是否开启推送
val
status
=
AppPreferences
.
getInstance
().
getString
(
popup_status
,
"1"
).
toInt
()
val
status
=
AppPreferences
.
getInstance
().
getString
(
popup_status
,
"1"
).
toInt
()
if
(
status
==
0
)
{
if
(
status
==
0
)
{
EventUtils
.
event
(
"Notification_Error"
,
"status=$status"
)
LogEx
.
logDebug
(
"canSendNotification"
,
"status"
)
LogEx
.
logDebug
(
"canSendNotification"
,
"status"
)
return
false
return
false
}
}
...
@@ -82,6 +86,7 @@ object NotificationUiUtil {
...
@@ -82,6 +86,7 @@ object NotificationUiUtil {
val
count
=
AppPreferences
.
getInstance
().
getString
(
popup_count
,
"20"
).
toInt
()
val
count
=
AppPreferences
.
getInstance
().
getString
(
popup_count
,
"20"
).
toInt
()
if
(
dayPopupCount
>
count
)
{
if
(
dayPopupCount
>
count
)
{
LogEx
.
logDebug
(
"canSendNotification"
,
"count"
)
LogEx
.
logDebug
(
"canSendNotification"
,
"count"
)
EventUtils
.
event
(
"Notification_Error"
,
"dayPopupCount=$dayPopupCount count=$count"
)
return
false
return
false
}
}
//判断是否在时间区域
//判断是否在时间区域
...
@@ -91,6 +96,7 @@ object NotificationUiUtil {
...
@@ -91,6 +96,7 @@ object NotificationUiUtil {
val
currentHour
=
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)
val
currentHour
=
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)
if
(
currentHour
!
in
start
until
end
)
{
if
(
currentHour
!
in
start
until
end
)
{
LogEx
.
logDebug
(
"canSendNotification"
,
"start end"
)
LogEx
.
logDebug
(
"canSendNotification"
,
"start end"
)
EventUtils
.
event
(
"Notification_Error"
,
"start=$start end=$end currentHour=$currentHour"
)
return
false
return
false
}
}
...
@@ -102,7 +108,11 @@ object NotificationUiUtil {
...
@@ -102,7 +108,11 @@ object NotificationUiUtil {
if
(
where
==
POPUP_WHERE_LOCK
)
{
if
(
where
==
POPUP_WHERE_LOCK
)
{
interval
=
AppPreferences
.
getInstance
().
getString
(
popup_lock_interval
,
"1"
).
toInt
()
interval
=
AppPreferences
.
getInstance
().
getString
(
popup_lock_interval
,
"1"
).
toInt
()
}
}
if
(
where
==
POPUP_WHERE_FCM
)
{
interval
=
AppPreferences
.
getInstance
().
getString
(
popup_fcm_interval
,
"1"
).
toInt
()
}
if
(
System
.
currentTimeMillis
()
-
lastPopupTime
<
interval
*
60
*
1000L
)
{
if
(
System
.
currentTimeMillis
()
-
lastPopupTime
<
interval
*
60
*
1000L
)
{
EventUtils
.
event
(
"Notification_Error"
,
"where=$where interval=$interval"
)
LogEx
.
logDebug
(
"canSendNotification"
,
"interval"
)
LogEx
.
logDebug
(
"canSendNotification"
,
"interval"
)
return
false
return
false
}
}
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/fcm/PopupConstObject.kt
View file @
93e19780
...
@@ -4,6 +4,7 @@ object PopupConstObject {
...
@@ -4,6 +4,7 @@ object PopupConstObject {
const
val
POPUP_WHERE_TIMBER
=
"Timber"
const
val
POPUP_WHERE_TIMBER
=
"Timber"
const
val
POPUP_WHERE_LOCK
=
"Lock"
const
val
POPUP_WHERE_LOCK
=
"Lock"
const
val
POPUP_WHERE_FCM
=
"fcm"
//推送总开关 0 关 1开
//推送总开关 0 关 1开
val
popup_status
=
"popup_status"
val
popup_status
=
"popup_status"
...
@@ -16,6 +17,7 @@ object PopupConstObject {
...
@@ -16,6 +17,7 @@ object PopupConstObject {
val
popup_interval
=
"popup_interval"
val
popup_interval
=
"popup_interval"
val
popup_timber_interval
=
"popup_timber_interval"
val
popup_timber_interval
=
"popup_timber_interval"
val
popup_lock_interval
=
"popup_lock_interval"
val
popup_lock_interval
=
"popup_lock_interval"
val
popup_fcm_interval
=
"popup_fcm_interval"
//推送样式一配置
//推送样式一配置
val
popup_style1_start
=
"popup_style1_start"
val
popup_style1_start
=
"popup_style1_start"
...
...
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