From 9ea65add1f02ab1eb32d779b4c3e9588f8529a53 Mon Sep 17 00:00:00 2001 From: huangminlinux <380108184@qq.com> Date: Tue, 12 Dec 2017 14:26:55 +0800 Subject: [PATCH] update demo add receiveLocalNotification Event --- ionic/example/src/pages/home/home.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ionic/example/src/pages/home/home.ts b/ionic/example/src/pages/home/home.ts index b0bd0c2..8d725a7 100644 --- a/ionic/example/src/pages/home/home.ts +++ b/ionic/example/src/pages/home/home.ts @@ -55,6 +55,16 @@ export class HomePage { } alert('Open notification: ' + content); }, false); + + document.addEventListener('jpush.receiveLocalNotification', (event: any) => { + // iOS(*,9) Only , iOS(10,*) 将在 jpush.openNotification 和 jpush.receiveNotification 中触发。 + var content; + if (this.devicePlatform == 'Android') { + } else { + content = event.content; + } + alert('receive local notification: ' + JSON.stringify(event)); + }, false); } getRegistrationID() {