View not updating after push notification

thebasix, I don’t remember. But I was doing it the wrong way.

The correct way is to use a shared service. A shared service is a provider which is declareted only in the app.component’s providers array and injected in the constructors of each pages or components that will use it. By declaring the shared service only in the app.component providers array, this provider will have a unique instance of the service shared among pages or components where it is injected.

Then you import a subject inside the shared service:

import { Subject } from 'rxjs/Subject';

And declare a subject as attribute of your SharedService class:

class SharedService {
       mySubject:Subject<any> = new Subject();
}

A subject allows to send and receive messages.

You can subscribe it in one module this way:

constructor(privete mySharedService: SharedService) {
      this.mySharedService.mySubject.subscribe (
            function (parameters) { console.log(parameters) }, 
            function (error) { console.error(error) } 
      );
}

This way you is always notified when other module sends a message:

constructor(private mySharedService: SharedService) {
      this.mySharedService.mySubject.next({ parameter: 'some value'})
}

Finally, you can create a shared service which receives push notications and adds this notifications to an array or send this nofications via subject. This array then can be linked to the template via data binding. Or the view can subscribe the service of the shared service and receive the message. This way view will always show, in a reactive way, the data received.