I am using react-native-fcm for notification and successfully receiving notification. My problem is when i click on that notification it must navigate to specific screen.
I have a stack navigator with home and alerts. i am writing my code in login which much navigate to alerts.
FCM.on(FCMEvent.Notification, async (notif) => {
if (notificationData.message === 'New alert generated.') {
FCM.presentLocalNotification({
vibrate: 500,
title: 'title',
priority: "high",
show_in_foreground: true,
group: 'test',
large_icon: "ic_launcher",
icon: "ic_launcher",
});
}
}
Here im using presentLocalNotification() to show notification. where should i use this.props.navigation.navigate('alerts');