evollu / react-native-fcm

react native module for firebase cloud messaging and local notification
MIT License
1.73k stars 681 forks source link

When application is in background #1032

Closed Amit2530 closed 5 years ago

Amit2530 commented 5 years ago

When application is in background and when notification is received after that we click on that notification to navigate the particular screen but it the navigation is not working on,

FCM.getInitialNotification().then(notif => { console.log("Click from background", notif); setTimeout(() => { this.props.navigation.navigate('LoginScreen'); }, 500) });

It is giving error that 'undefine navigate property' ??

what is the proper way to navigate to the different screen when click on notification and application is in background?

which method will get call when application is in background and notification received ?

evollu commented 5 years ago

when app is in background, notification is triggered though listener callback. undefine navigate property sounds like unrelated issue