I’m getting push notification messages and once I receive the message, I want to redirect to another page or show another page instead of home page.
NavController<
I don't see any reason why you can't use the NavController
like so:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Push, PushToken } from '@ionic/cloud-angular';
import { SomeOtherPage } from '...';
export class HomePage {
constructor(private push: Push
public navCtrl: NavController) {
push.register().then((t: PushToken) => {
return this.push.saveToken(t);
}).then((t: PushToken) => {
console.log('Token saved:', t.token);
});
this.push.rx.notification().subscribe((msg) => {
this.navCtrl.push(SomeOtherPage, { msg: msg });
});
}
}