记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
94c34eb5
Commit
94c34eb5
authored
Nov 30, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推送增加 badge
parent
17b80e87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
AdminUpushServiceImpl.java
...in/zhengzai/admin/service/impl/AdminUpushServiceImpl.java
+2
-1
AndroidNotification.java
...admin/zhengzai/kylin/utils/upush/AndroidNotification.java
+6
-3
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/admin/service/impl/AdminUpushServiceImpl.java
View file @
94c34eb5
...
...
@@ -189,6 +189,7 @@ public class AdminUpushServiceImpl extends ServiceImpl<AdminUpushMapper, AdminUp
AdminUpush
updatePush
=
new
AdminUpush
();
try
{
AndroidBroadcast
broadcast
=
new
AndroidBroadcast
(
androidAppkey
,
androidAppMasterSecret
);
broadcast
.
setBadge
(
1
);
broadcast
.
setTicker
(
adminUpush
.
getPushTitle
());
broadcast
.
setTitle
(
adminUpush
.
getPushTitle
());
broadcast
.
setText
(
adminUpush
.
getPushContent
());
...
...
@@ -257,7 +258,7 @@ public class AdminUpushServiceImpl extends ServiceImpl<AdminUpushMapper, AdminUp
IOSBroadcast
broadcast
=
new
IOSBroadcast
(
iosAppkey
,
iosAppMasterSecret
);
//alert的值设置为字典
broadcast
.
setAlert
(
adminUpush
.
getPushTitle
(),
""
,
adminUpush
.
getPushContent
());
broadcast
.
setBadge
(
0
);
broadcast
.
setBadge
(
1
);
broadcast
.
setSound
(
"default"
);
if
(
Arrays
.
asList
(
LnsEnum
.
ENV
.
dev
.
name
(),
LnsEnum
.
ENV
.
test
.
name
()).
contains
(
environment
.
getProperty
(
CurrentUtil
.
CK_ENV_ACTIVE
)))
{
broadcast
.
setTestMode
();
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/utils/upush/AndroidNotification.java
View file @
94c34eb5
...
...
@@ -13,7 +13,7 @@ public abstract class AndroidNotification extends UmengNotification {
// Keys can be set in the body level
protected
static
final
HashSet
<
String
>
BODY_KEYS
=
new
HashSet
<
String
>(
Arrays
.
asList
(
new
String
[]{
"ticker"
,
"title"
,
"text"
,
"builder_id"
,
"icon"
,
"largeIcon"
,
"img"
,
"play_vibrate"
,
"play_lights"
,
"play_sound"
,
"sound"
,
"after_open"
,
"url"
,
"activity"
,
"custom"
}));
"sound"
,
"after_open"
,
"url"
,
"activity"
,
"custom"
,
"badge"
}));
public
enum
DisplayType
{
NOTIFICATION
{
public
String
getValue
(){
return
"notification"
;}},
///通知:消息送达到用户设备后,由友盟SDK接管处理并在通知栏上显示通知内容。
...
...
@@ -81,6 +81,10 @@ public abstract class AndroidNotification extends UmengNotification {
}
return
true
;
}
public
void
setBadge
(
Integer
badge
)
throws
Exception
{
setPredefinedKeyValue
(
"badge"
,
badge
);
}
// Set extra key/value for Android notification
public
boolean
setExtraField
(
String
key
,
String
value
)
throws
Exception
{
...
...
@@ -102,8 +106,7 @@ public abstract class AndroidNotification extends UmengNotification {
extraJson
.
put
(
key
,
value
);
return
true
;
}
//
public
void
setDisplayType
(
DisplayType
d
)
throws
Exception
{
setPredefinedKeyValue
(
"display_type"
,
d
.
getValue
());
}
...
...
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