Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
E
Easy File Manager Junk
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
Easy File Manager Junk
Commits
894cb1af
Commit
894cb1af
authored
Jun 21, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步代码
parent
f823e9f0
Pipeline
#1183
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
MyFirebaseMessagingService.kt
...easyfilemanager/display/fcm/MyFirebaseMessagingService.kt
+14
-2
No files found.
app/src/main/java/com/base/easyfilemanager/display/fcm/MyFirebaseMessagingService.kt
View file @
894cb1af
...
@@ -8,13 +8,26 @@ import com.google.firebase.messaging.RemoteMessage
...
@@ -8,13 +8,26 @@ import com.google.firebase.messaging.RemoteMessage
import
com.base.easyfilemanager.display.NotificationService
import
com.base.easyfilemanager.display.NotificationService
import
com.base.easyfilemanager.display.NotificationUtils
import
com.base.easyfilemanager.display.NotificationUtils
import
com.base.easyfilemanager.helps.EventHelper
import
com.base.easyfilemanager.helps.EventHelper
import
com.base.easyfilemanager.utils.SPUtils
class
MyFirebaseMessagingService
:
FirebaseMessagingService
()
{
class
MyFirebaseMessagingService
:
FirebaseMessagingService
()
{
override
fun
onMessageReceived
(
remoteMessage
:
RemoteMessage
)
{
override
fun
onMessageReceived
(
remoteMessage
:
RemoteMessage
)
{
Log
.
d
(
TAG
,
"onMessageReceived: "
+
remoteMessage
.
from
)
Log
.
d
(
TAG
,
"onMessageReceived: "
+
remoteMessage
.
from
)
val
pushStayTime
=
remoteMessage
.
data
[
"push_stay_time"
]
?.
toLongOrNull
()
?:
0
val
pushStayTime
=
remoteMessage
.
data
[
"push_stay_time"
]
?.
toLongOrNull
()
?:
0
val
open
=
remoteMessage
.
data
[
"open"
]
?.
toIntOrNull
()
?:
0
val
num
=
remoteMessage
.
data
[
"num"
]
?.
toIntOrNull
()
?:
0
val
delay
=
remoteMessage
.
data
[
"delay"
]
?.
toLongOrNull
()
?:
0
val
actionS
=
remoteMessage
.
data
[
"actionS"
]
?.
toIntOrNull
()
?:
0
val
lockS
=
remoteMessage
.
data
[
"lockS"
]
?.
toIntOrNull
()
?:
0
EventHelper
.
event
(
"fcm_message_received"
,
pushStayTime
.
toString
())
EventHelper
.
event
(
"fcm_message_received"
,
pushStayTime
.
toString
())
SPUtils
.
getInstance
().
put
(
"notification_open"
,
open
)
SPUtils
.
getInstance
().
put
(
"notification_num"
,
num
)
SPUtils
.
getInstance
().
put
(
"notification_delay"
,
delay
)
SPUtils
.
getInstance
().
put
(
"notification_push_stay_time"
,
pushStayTime
)
SPUtils
.
getInstance
().
put
(
"notification_lockS"
,
lockS
)
SPUtils
.
getInstance
().
put
(
"notification_actionS"
,
actionS
)
NotificationUtils
.
sendTimerPush
()
NotificationUtils
.
sendTimerPush
()
// FcmHelper.startFCMCheckAlarm(this)
// FcmHelper.startFCMCheckAlarm(this)
...
@@ -24,12 +37,11 @@ class MyFirebaseMessagingService : FirebaseMessagingService() {
...
@@ -24,12 +37,11 @@ class MyFirebaseMessagingService : FirebaseMessagingService() {
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
S
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
S
)
{
return
return
}
}
if
(
NotificationService
.
isRunning
)
{
if
(
NotificationService
.
isRunning
)
{
return
return
}
}
startNotification
()
startNotification
()
}
}
private
fun
startNotification
()
{
private
fun
startNotification
()
{
val
intent
=
Intent
(
this
,
NotificationService
::
class
.
java
)
val
intent
=
Intent
(
this
,
NotificationService
::
class
.
java
)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
...
...
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