Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
fa58e04a
Commit
fa58e04a
authored
Jul 30, 2021
by
chengkun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log.i -> timber
parent
8bb3ee7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
30 deletions
+32
-30
HuaweiPushGetDataService.java
...ush/push/huaweipush/service/HuaweiPushGetDataService.java
+32
-30
No files found.
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/push/huaweipush/service/HuaweiPushGetDataService.java
View file @
fa58e04a
...
...
@@ -8,6 +8,8 @@ import com.huawei.hms.push.RemoteMessage;
import
java.util.Arrays
;
import
timber.log.Timber
;
public
class
HuaweiPushGetDataService
extends
HmsMessageService
{
private
static
final
String
TAG
=
"PushGetDataService"
;
...
...
@@ -15,7 +17,7 @@ public class HuaweiPushGetDataService extends HmsMessageService {
// extends HmsMessageService super class
@Override
public
void
onNewToken
(
String
token
)
{
Log
.
i
(
TAG
,
"received refresh token:"
+
token
);
Timber
.
i
(
"received refresh token:"
+
token
);
// send the token to your app server.
if
(!
TextUtils
.
isEmpty
(
token
))
{
refreshedTokenToServer
(
token
);
...
...
@@ -24,40 +26,40 @@ public class HuaweiPushGetDataService extends HmsMessageService {
@Override
public
void
onMessageReceived
(
RemoteMessage
message
)
{
Log
.
i
(
TAG
,
"onMessageReceived is called"
);
Timber
.
i
(
"onMessageReceived is called"
);
if
(
message
==
null
)
{
Log
.
e
(
TAG
,
"Received message entity is null!"
);
return
;
}
Log
.
i
(
TAG
,
"getCollapseKey: "
+
message
.
getCollapseKey
()
+
"\n getData: "
+
message
.
getData
()
+
"\n getFrom: "
+
message
.
getFrom
()
+
"\n getTo: "
+
message
.
getTo
()
+
"\n getMessageId: "
+
message
.
getMessageId
()
+
"\n getSendTime: "
+
message
.
getSentTime
()
+
"\n getDataMap: "
+
message
.
getDataOfMap
()
+
"\n getMessageType: "
+
message
.
getMessageType
()
+
"\n getTtl: "
+
message
.
getTtl
()
+
"\n getToken: "
+
message
.
getToken
());
Timber
.
i
(
"getCollapseKey: "
+
message
.
getCollapseKey
()
+
"\n getData: "
+
message
.
getData
()
+
"\n getFrom: "
+
message
.
getFrom
()
+
"\n getTo: "
+
message
.
getTo
()
+
"\n getMessageId: "
+
message
.
getMessageId
()
+
"\n getSendTime: "
+
message
.
getSentTime
()
+
"\n getDataMap: "
+
message
.
getDataOfMap
()
+
"\n getMessageType: "
+
message
.
getMessageType
()
+
"\n getTtl: "
+
message
.
getTtl
()
+
"\n getToken: "
+
message
.
getToken
());
RemoteMessage
.
Notification
notification
=
message
.
getNotification
();
if
(
notification
!=
null
)
{
Log
.
i
(
TAG
,
"\n getImageUrl: "
+
notification
.
getImageUrl
()
+
"\n getTitle: "
+
notification
.
getTitle
()
+
"\n getTitleLocalizationKey: "
+
notification
.
getTitleLocalizationKey
()
+
"\n getTitleLocalizationArgs: "
+
Arrays
.
toString
(
notification
.
getTitleLocalizationArgs
())
+
"\n getBody: "
+
notification
.
getBody
()
+
"\n getBodyLocalizationKey: "
+
notification
.
getBodyLocalizationKey
()
+
"\n getBodyLocalizationArgs: "
+
Arrays
.
toString
(
notification
.
getBodyLocalizationArgs
())
+
"\n getIcon: "
+
notification
.
getIcon
()
+
"\n getSound: "
+
notification
.
getSound
()
+
"\n getTag: "
+
notification
.
getTag
()
+
"\n getColor: "
+
notification
.
getColor
()
+
"\n getClickAction: "
+
notification
.
getClickAction
()
+
"\n getChannelId: "
+
notification
.
getChannelId
()
+
"\n getLink: "
+
notification
.
getLink
()
+
"\n getNotifyId: "
+
notification
.
getNotifyId
());
Timber
.
i
(
"\n getImageUrl: "
+
notification
.
getImageUrl
()
+
"\n getTitle: "
+
notification
.
getTitle
()
+
"\n getTitleLocalizationKey: "
+
notification
.
getTitleLocalizationKey
()
+
"\n getTitleLocalizationArgs: "
+
Arrays
.
toString
(
notification
.
getTitleLocalizationArgs
())
+
"\n getBody: "
+
notification
.
getBody
()
+
"\n getBodyLocalizationKey: "
+
notification
.
getBodyLocalizationKey
()
+
"\n getBodyLocalizationArgs: "
+
Arrays
.
toString
(
notification
.
getBodyLocalizationArgs
())
+
"\n getIcon: "
+
notification
.
getIcon
()
+
"\n getSound: "
+
notification
.
getSound
()
+
"\n getTag: "
+
notification
.
getTag
()
+
"\n getColor: "
+
notification
.
getColor
()
+
"\n getClickAction: "
+
notification
.
getClickAction
()
+
"\n getChannelId: "
+
notification
.
getChannelId
()
+
"\n getLink: "
+
notification
.
getLink
()
+
"\n getNotifyId: "
+
notification
.
getNotifyId
());
}
Boolean
judgeWhetherIn10s
=
false
;
// If the messages are not processed in 10 seconds, the app needs to use WorkManager for processing.
...
...
@@ -69,13 +71,13 @@ public class HuaweiPushGetDataService extends HmsMessageService {
}
}
private
void
startWorkManagerJob
(
RemoteMessage
message
)
{
Log
.
d
(
TAG
,
"Start new job processing."
);
Timber
.
d
(
"Start new job processing."
);
}
private
void
processWithin10s
(
RemoteMessage
message
)
{
Log
.
d
(
TAG
,
"Processing now."
);
Timber
.
d
(
"Processing now."
);
}
private
void
refreshedTokenToServer
(
String
token
)
{
Log
.
i
(
TAG
,
"sending token to server. token:"
+
token
);
Timber
.
i
(
"sending token to server. token:"
+
token
);
}
}
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