应用被杀死时,通知点击使应用崩溃

时间:2018-10-30 11:17:15

标签: react-native push-notification react-native-firebase

即使应用被杀死,我的通知仍会显示,但是当我单击通知并导致应用崩溃时,不会调用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(); 
 } 
});

0 个答案:

没有答案