Receive Push notification when the app is inactive

Recently i started to use Ionic’s push notifications. I can receive them either if the app is open or of it is closed.
The issue is: if the app is closed i just see the notification and when i click it, the app opens up, but i cannot see the message or use the additional data in it.

Is there a way to use that data?

I tried to have this snippet in the constructor of app.component.ts, but it works only when the app is open:

platform.ready().then(() => {
        //Subscribe for the push noticiations
        this.push.rx.notification().subscribe((msg) => {
          //To get payload from the push msg.raw.additionalData which is an object
          //Comes up when the app is in foreground 
          if (msg.raw.additionalData.foreground) {
                        position: 'middle'
          } else {
            //Should popup when the app was waken up.

I’m using Ionic V1 and the OneSignal Push Plugin;
I’m currently dealing with the same situation.
I have an onOpen function/callback then I can make it trigger a
window.location.href='page.html'; but I don’t know how to pass data in the
background to understand the data to pass along with the window.location.

It should be e.g.: window.location.href='message.html?id=myid&from=other_id';.