我使用react-native-fcm进行推送通知。当通知到来时,它会重定向到另一个组件。它不会等待用户点击。
FCM.on("FCMNotificationReceived", (notif) => {
console.log("Notification", notif);
if(notif.click_action === "ACTION"){
Actions.login()
}
}
答案 0 :(得分:0)
创建本地通知时,您需要将auto_cancel添加为false。 (默认为true)
FCM.presentLocalNotification({
id: "UNIQ_ID_STRING",
title: "My Notification Title",
body: "My Notification Message",
sound: "default",
priority: "high",
click_action: "ACTION",
auto_cancel: false,
large_icon: "ic_launcher",
icon: "ic_launcher",
big_text: "Show when notification is expanded",
sub_text: "This is a subText",
vibrate: 300,
wake_screen: true,
group: "group",
picture: "https://google.png",
show_in_foreground
});