mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-02-08 03:42:52 +08:00
commit
b5d3661240
@ -36,6 +36,12 @@ export class HomePage {
|
|||||||
|
|
||||||
this.devicePlatform = device.platform;
|
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) => {
|
document.addEventListener('jpush.receiveNotification', (event: any) => {
|
||||||
var content;
|
var content;
|
||||||
if (this.devicePlatform == 'Android') {
|
if (this.devicePlatform == 'Android') {
|
||||||
@ -44,6 +50,9 @@ export class HomePage {
|
|||||||
content = event.aps.alert;
|
content = event.aps.alert;
|
||||||
}
|
}
|
||||||
alert('Receive notification: ' + JSON.stringify(event));
|
alert('Receive notification: ' + JSON.stringify(event));
|
||||||
|
|
||||||
|
this.jpush.setBadge(0);
|
||||||
|
this.jpush.setApplicationIconBadgeNumber(0);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
document.addEventListener('jpush.openNotification', (event: any) => {
|
document.addEventListener('jpush.openNotification', (event: any) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user