Push notifications in Ionic - On opening the notification the app launches the home page first and then navigates to desired page


#1

So i have a side menu ionic 2 app.
I have a home page and the side menu pages.
And on receiving a push notification i want to land into one of the side menu page.

Scenario1: When the app is NOT running in background.
On clicking the notification, i first land into home page and then redirected to specific side menu page.

Scenario2: When the app is running in background.
On clicking the notification, i directly land into specific side menu page.

I want the scenario1 to also behave as scenario2. Any pointer on how this can be done.
I have tried using nav.SetRoot(desiresPage) for scenario1 but dint work.

push.on(‘notification’, (data:NotificationEventResponse) => {
if(data.additionalData.additionalData.type == “someValue”){
this.nav.setRoot(SideMenuPage1);
} else {
this.nav.setRoot(SideMenuPage2);
}
});


#2

Hey, I am facing the same issue. Have you found a solution? Thanks


#3

Not yet :frowning:
Am not sure there would be any solution to this theoretically in Ionic2 Push notification case. The app should be launched for it to go to desired page. Wondering how the native apps like facebook does it?


#4

Same problem here, I’m loosing faith this can be done.