Open custom page after notification opened on Ionic2


#1

Hi all,
I using onesignal to implement push notification into Ionic2 RC project, I want to open a custom page after user tab on notification, below is my code

@Component({
template: ‘<ion-nav #myNav [root]=“rootPage”>’
})
export class MyApp {
rootPage:any = LoginPage;
@ViewChild(‘myNav’) nav: NavController;

constructor(platform: Platform) {
platform.ready().then(() => {
StatusBar.styleDefault();
Splashscreen.hide();
window[“plugins”].OneSignal
.startInit(“xxxxxx”, “xxx”)
.handleNotificationOpened((jsonData) => {
this.nav.setRoot(TabsPage);
})
.endInit();
}

I debugged and see it still run code line “this.nav.setRoot(TabsPage)” but I don’t know why it only show a white page.

anyone can help me. thank so much


#2

Did you founded the solution?