Hi, I’d like to open specific screen when the user click on the notification(like whatsapp) but I don’t know how to do it, I try to add a listener to the notification:
Notifications.addListener(notification => {
var user= AsyncStorage.getItem('user').then(function(userStr){
if (userStr !== null) {
var user = JSON.parse(userStr);
this.props.navigation.navigate('Chat', {conversationId: -1,user: user});
}
});
});
But every time I’m in the main screen for example and send a push notification this Listener is triggered without the push notification, how can I do it? I don’t know how to trigger a custom action when the notification is “click” and not when is received