xugenyuan

ref |> 消息推送--uat环境app的消息数量阅读后数量一直不变

http://192.168.1.3:8080/zentao/bug-view-19639.html

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -71,6 +71,8 @@ export class GetuiPush {
Logger.error(TAG, "个推SDK初始化失败,error = " + error)
}
})
this.setBadgeNumber(0)
}
async requestEnableNotifications(context: common.UIAbilityContext) : Promise<boolean> {
... ... @@ -120,6 +122,9 @@ export class GetuiPush {
this.setAlias(false, this.currentUserId)
}
})
EmitterUtils.receiveEvent(EmitterEventId.APP_ENTER_FOREGROUD, () => {
this.setBadgeNumber(0)
})
PushManager.setPushCallback({
// cid
... ... @@ -387,6 +392,7 @@ export class GetuiPush {
},
notificationSlotType: notificationManager.SlotType.CONTENT_INFORMATION,
wantAgent:want,
badgeNumber:1
};
notificationManager.publish(notificationRequest).then(() => {
Logger.debug(TAG, "本地发送系统通知完成")
... ...