- i am implementing push notification in IONIC 3 and using phonegap-plugin-push
- now i want to modify data before displaying notification on notification bar
here is my code
pushNotificationSetup() { const options: PushOptions = { android: { senderID: 'xxxxxxxxx', icon: 'icon', sound: true, vibrate: true }, ios: { alert: true, badge: true, sound: true, } }; const pushObject: PushObject = this.push.init(options); pushObject.on('notification').subscribe((notification: any) => { this.utilService.showToastMsg("success", notification.message); }); pushObject.on('registration').subscribe((registration: any) => { this.storageService.setLocalStorage('registered-device', registration.registrationId); }); pushObject.on('error').subscribe(error => console.error('Error with Push plugin', error)); }
Asked
Active
Viewed 69 times
1

Bhavin
- 441
- 1
- 4
- 17
-
So what is the problem? can you specify what exactly is challenge for you here? it feels like you have this method here: this.utilService.showToastMsg("success", notification.message); - which deals with 'presentation' of the message to user. This is where I guess you can modify the message. Unsure what is the problem here. – Sergey Rudenko Jan 07 '19 at 15:40