Merge pull request #340 from jpush/dev

updage demo
This commit is contained in:
huangminlinux 2018-04-19 13:20:16 +08:00 committed by GitHub
commit b5d3661240
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) => {