From 1ae98e13e65f980d77269f3e3241fa8d0980e827 Mon Sep 17 00:00:00 2001 From: huangminlinux <380108184@qq.com> Date: Thu, 19 Apr 2018 13:19:38 +0800 Subject: [PATCH] updage demo --- ionic/example/src/pages/home/home.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ionic/example/src/pages/home/home.ts b/ionic/example/src/pages/home/home.ts index dba5e08..d487fbd 100644 --- a/ionic/example/src/pages/home/home.ts +++ b/ionic/example/src/pages/home/home.ts @@ -36,6 +36,12 @@ export class HomePage { this.devicePlatform = device.platform; + document.addEventListener('jpush.openNotification', (event: any) => { + alert('jpush.openNotification' + JSON.stringify(event)); + this.jpush.setBadge(0); + this.jpush.setApplicationIconBadgeNumber(0); + }) + document.addEventListener('jpush.receiveNotification', (event: any) => { var content; if (this.devicePlatform == 'Android') { @@ -44,6 +50,9 @@ export class HomePage { content = event.aps.alert; } alert('Receive notification: ' + JSON.stringify(event)); + + this.jpush.setBadge(0); + this.jpush.setApplicationIconBadgeNumber(0); }, false); document.addEventListener('jpush.openNotification', (event: any) => {