即使应用被杀死,我的通知仍会显示,但是当我单击通知并导致应用崩溃时,不会调用onNotificationOpened
this.notificationOpenedListener=
firebase.notifications().onNotificationOpened((
notificationOpen: NotificationOpen) => {
const action = notificationOpen.action;
const notification: Notification = notificationOpen.notification;
var data = notification._data;
if (data.action_target.toUpperCase() == "PROFILE".toUpperCase()) {
Actions.profile();
}
else if (data.action_target.toUpperCase() == "Leaderboard".toUpperCase()) {
Actions.skills();
}
else if (data.action_target.toUpperCase() == "home".toUpperCase()) {
Actions.homepage();
}
});