【发布时间】:2018-02-27 13:46:29
【问题描述】:
我正在使用 react-native-fcm 进行通知并成功接收通知。我的问题是当我点击该通知时,它必须导航到特定屏幕。
我有一个带有主页和警报的堆栈导航器。 我正在登录时编写我的代码,其中很多导航到警报。
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",
});
}
}
这里我使用 presentLocalNotification() 来显示通知。我应该在哪里使用this.props.navigation.navigate('alerts');
【问题讨论】:
标签: javascript reactjs react-native react-navigation react-native-fcm