简体   繁体   English

反应本机firebase删除通知仍然收到消息

[英]react native firebase remove notification still receive message

I get notification from sender, if I click the notification I will receive the message data when componentDidMount() , if I swipe out the notification (remove). 我收到来自发件人的通知,如果我单击通知,则当我刷除通知(删除)时,当componentDidMount()接收到消息数据。 I reopen the app, message not receive. 我重新打开应用程序,未收到消息。

componentDidMount(){
  firebase.messaging().getInitialNotification().then((payload) => {
    console.log("Initial Message: ", payload); 
  });
  firebase.messaging().onMessage((payload) =>{
    console.log("Message received. ", payload);
    // ...
  });
}

This can't be done in Javascript. 这不能用Javascript完成。 Background Tasks can't be done using Javascript. 使用Javascript无法完成后台任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM