1
  1. i am implementing push notification in IONIC 3 and using phonegap-plugin-push
  2. now i want to modify data before displaying notification on notification bar
  3. 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));
    }
    
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

0 Answers0