I’m a new developer use Ionic v2 framework. I have a issue about navigation in “app.ts”. Currently, I implemented code to receive notification from server push to in the “app.ts” file.
push.on(‘notification’, (data) => {
console.log(data);
// navigate to a specific page
// code here
});
But I can’t think anyway to work. Please help me If you can.
In “app.ts”, I have “this.rootPage = TabsPage;” when I receive a push notification, I invoke:
var _rootPage = this.rootPage; // get TabsPage
var rootTab = _rootPage.getRootTab(); // In class TabsPage I have a function getRootTab()
rootTab.nav.push(Tabb);
But I get a error “Error in Success callbackId: PushNotification1881844672 : TypeError: undefined is not a function (evaluating ‘_rootPage.getRootTab()’)”