mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-02-12 14:22:51 +08:00
Add event listener for jpush.receiveMessage
Add event listener for jpush.receiveMessage in ionic example
This commit is contained in:
parent
54b653e442
commit
65ea3c935d
@ -46,6 +46,16 @@ export class HomePage {
|
|||||||
alert('Receive notification: ' + JSON.stringify(event));
|
alert('Receive notification: ' + JSON.stringify(event));
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
document.addEventListener('jpush.receiveMessage', (event: any) => {
|
||||||
|
var content;
|
||||||
|
if (this.devicePlatform == 'Android') {
|
||||||
|
content = event.message;
|
||||||
|
} else {
|
||||||
|
content = event.content;
|
||||||
|
}
|
||||||
|
alert('Receive message: ' + JSON.stringify(event));
|
||||||
|
}, false);
|
||||||
|
|
||||||
document.addEventListener('jpush.openNotification', (event: any) => {
|
document.addEventListener('jpush.openNotification', (event: any) => {
|
||||||
var content;
|
var content;
|
||||||
if (this.devicePlatform == 'Android') {
|
if (this.devicePlatform == 'Android') {
|
||||||
|
Loading…
Reference in New Issue
Block a user