ref |> 消息推送--uat环境app的消息数量阅读后数量一直不变
http://192.168.1.3:8080/zentao/bug-view-19639.html Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Showing
1 changed file
with
6 additions
and
0 deletions
| @@ -71,6 +71,8 @@ export class GetuiPush { | @@ -71,6 +71,8 @@ export class GetuiPush { | ||
| 71 | Logger.error(TAG, "个推SDK初始化失败,error = " + error) | 71 | Logger.error(TAG, "个推SDK初始化失败,error = " + error) |
| 72 | } | 72 | } |
| 73 | }) | 73 | }) |
| 74 | + | ||
| 75 | + this.setBadgeNumber(0) | ||
| 74 | } | 76 | } |
| 75 | 77 | ||
| 76 | async requestEnableNotifications(context: common.UIAbilityContext) : Promise<boolean> { | 78 | async requestEnableNotifications(context: common.UIAbilityContext) : Promise<boolean> { |
| @@ -120,6 +122,9 @@ export class GetuiPush { | @@ -120,6 +122,9 @@ export class GetuiPush { | ||
| 120 | this.setAlias(false, this.currentUserId) | 122 | this.setAlias(false, this.currentUserId) |
| 121 | } | 123 | } |
| 122 | }) | 124 | }) |
| 125 | + EmitterUtils.receiveEvent(EmitterEventId.APP_ENTER_FOREGROUD, () => { | ||
| 126 | + this.setBadgeNumber(0) | ||
| 127 | + }) | ||
| 123 | 128 | ||
| 124 | PushManager.setPushCallback({ | 129 | PushManager.setPushCallback({ |
| 125 | // cid | 130 | // cid |
| @@ -387,6 +392,7 @@ export class GetuiPush { | @@ -387,6 +392,7 @@ export class GetuiPush { | ||
| 387 | }, | 392 | }, |
| 388 | notificationSlotType: notificationManager.SlotType.CONTENT_INFORMATION, | 393 | notificationSlotType: notificationManager.SlotType.CONTENT_INFORMATION, |
| 389 | wantAgent:want, | 394 | wantAgent:want, |
| 395 | + badgeNumber:1 | ||
| 390 | }; | 396 | }; |
| 391 | notificationManager.publish(notificationRequest).then(() => { | 397 | notificationManager.publish(notificationRequest).then(() => { |
| 392 | Logger.debug(TAG, "本地发送系统通知完成") | 398 | Logger.debug(TAG, "本地发送系统通知完成") |
-
Please register or login to post a comment