Page not working properly after pushing it in subscribe Firebase.onNotificationOpen Ionic 2

时间:2017-06-20 12:36:11

标签: html typescript firebase ionic2 ionic3

I have an Ionic 2 app which uses Firebase to send notifications to users. In the app.component.ts file I have a _setupFirebase function in which I subscribe to Firebase.onNotificationOpen.

private _setupFirebase() {
    //if I push the page here it works properly
    this.nav.push(MyPage);
    Firebase.onNotificationOpen()
        .subscribe(data => {
            //if I push the page here it doesn't work
            this.nav.push(MyPage);
    });
}

The problem is that I need the data obtained in the onNotificationOpen method to choose which page to open depending on the notification and send some data through to that page. The page I'm pushing has a form that has a few checkboxes. If I push that page in the subscription of onNotificationOpen, like on line 7 of the code, when I click on a checkbox the value changes but the view doesn't get updated.

0 个答案:

没有答案