When i try to call this.nav.setRoot(TabsPage) or this.nav.push(TabsPage), the ngAfterViewInit callback is calling twice on the TabsPage (page with Tabs component). And the child tab page creates twice.
This problem happen only when i try to navigate from Push plugin notification callback.
Does anyone have any idea?
Related code:
var push = PushNotification.init({
android: {
senderID: "12345679"
},
browser: {
pushServiceURL: 'http://push.api.phonegap.com/v1/push'
},
ios: {
alert: "true",
badge: true,
sound: 'false'
},
windows: {}
});
push.on('notification', => (data) {
this.navCtrl.push(TabsPage, { data: data }); // or this.navCrtl.setRoot(...). it does not metter.
});
Ionic info:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.1.12
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.45
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v6.6.0
Xcode version: Not installed
Without doing this, tabs inits twice, starts the root page of tab 0 twice, but the second copy doesn’t have a tabbar and seems to be pushed onto the nav stack.