props.exp.notification is not working

#1

I am trying to implement push notifications to our app. Now, when the app is closed, and opened by selecting the push notification, I am not able to receive the notification either by using props.exp.notification or by adding notification listener on the app root component. What is the right way to handle notification when app is not running in the background?

#2

Hey @avinashsetty,

Can you provide the relevant code that handle the push notifications so we can take a look and see if there is anything wrong with your implementation?

Cheers,

Adam

#3

Here is the steps I followed to reproduce this problem,

  1. Killed the Expo Client app in my iPhone
  2. Opened the Expo app through Push Notification
  3. Below is the code which I used to retrieve the notification object from this.props.exp
export default class App extends React.Component {  
  componentWillReceiveProps(nextProps) {
    console.log(nextProps);
    console.log(this.props);
  }

  render() {
    console.log(`Render App: ${Object.keys(this.props)}`);
    console.log(`Render App: ${Object.keys(this.props.exp)}`);
    return (
        <Provider store={store}>
            <Router />
        </Provider>
    );
  }
}

This is the console logs I got,

14:54:08 [exp] Render App: exp,rootTag
14:54:08 [exp] Render App: manifest,initialUri,appOwnership,shell

closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.