title: React Native Expo Push notification redirect not working properly
body: <p>I am successfully able to receive push notifications in my react native app but I am unable to make a redirect based on them. What happens is that on android, when I touch the notification, the app completely reloads and the notification data is lost. How can I handle this? </p>
  
  <p>This is my code</p>
  
  <pre><code>import React from 'react';
  import { AppState, View, StatusBar } from 'react-native';
  import { ScreenHost } from './src/app/screen-host';
  import { AppHost } from './src/debug/app-host';
  import { settings } from './src/constants/settings';
  import { services } from './src/services/services';
  import Expo from 'expo';
  
  async function getToken() {
    // Remote notifications do not work in simulators, only on device
    if (!Expo.Constants.isDevice) {
      return;
    }
    let { status } = await Expo.Permissions.askAsync(
      Expo.Permissions.NOTIFICATIONS,
    );
    if (status !== 'granted') {
      return;
    }
    let value = await Expo.Notifications.getExpoPushTokenAsync();
    console.log('Our token', value);
  }
  
  export default class App extends React.Component {
  
    state = {
      appState: AppState.currentState,
      conv_id: ''
    }
  
    componentDidMount() {
      getToken();
      AppState.addEventListener('change', this._handleAppStateChange);
      //Expo.Notifications.setBadgeNumberAsync(0);
    }  
  
    componentWillUnmount() {
      this.listener &amp;&amp; this.listener.remove();
      AppState.removeEventListener('change', this._handleAppStateChange);
    }
  
    _handleAppStateChange = (nextAppState) =&gt; {
      if(this.state.conv_id == ''){
        this.listener = Expo.Notifications.addListener(this.handleNotification);
      }
      if (this.state.appState.match(/inactive|background/) &amp;&amp; nextAppState === 'active') {
        console.log('App has come to the foreground!');
        if(this.state.conv_id != ''){
          services.store.gotoConversation(this.state.conv_id);
        }
      }
      Expo.Notifications.setBadgeNumberAsync(0);
      this.setState({appState: nextAppState});
    }
  
    handleNotification = ({ origin, data }) =&gt; {
      console.log(origin);
      this.state.conv_id = data.conv_id;
    };
  
    render() {
      if (settings.useDebugLayout) {
        return (
          &lt;AppHost&gt;
            &lt;AppMain /&gt;
          &lt;/AppHost&gt;
        );
      } else {
        return (
          &lt;AppMain /&gt;
        );
      }
    }
  }
  
  class AppMain extends React.Component {
    render() {
      return (
        &lt;View style={{ flex: 1 }}&gt;
          &lt;StatusBar barStyle="light-content" /&gt;
          &lt;ScreenHost data={services.store._showNav}/&gt;
        &lt;/View&gt;
      );
    }
  }
  </code></pre>
  
  <p>I want to call my <code>services.store.gotoConversation(this.state.conv_id);</code> but the screen loads the splash screen and the notification data is lost.</p>
  
  <p>I went through</p>
  
  <blockquote>
    <p><a href="https://docs.expo.io/versions/latest/guides/push-notifications" rel="nofollow noreferrer">https://docs.expo.io/versions/latest/guides/push-notifications</a></p>
  </blockquote>
  
  <p>But i can't seem to figure what is the main issue. Please help me. I will award <code>50 Bounty</code> to who so ever helps me with my issue. Thankyou.</p>