React Native: как перейти из приложения. js - PullRequest
0 голосов
/ 11 марта 2020

При нажатии на уведомление, я хочу перейти на вкладку уведомлений или любой другой экран из app.js. Там в любом случае?

Я использовал облачную функцию firebase для отправки уведомлений. Вот мое приложение. js

    this.notificationOpenedListener = firebase
      .notifications()
      .onNotificationOpened(notificationOpen => {
        // const {title, body} = notificationOpen.notification;

        /*
         * To navigate notification tab instead of TimeLine tab
         * */
        this.props.navigation.navigate('Notifications');
        /*
         * Or navigate other screen like ProfileView
         * */
        // this.props.navigation.navigate('ProfileView');
      });

    const notificationOpen = await firebase
      .notifications()
      .getInitialNotification();
    if (notificationOpen) {
      /*
       * To navigate notification tab instead of TimeLine tab
       * */
      this.props.navigation.navigate('Notifications');
      /*
       * Or navigate other screen like ProfileView
       * */
      // this.props.navigation.navigate('ProfileView');
    }


Ошибка: TypeError: undefined is not an object (evaluating '_this.props.navigation.navigate')

...