在react native firebase中处理组通知

在react native firebase中处理组通知,firebase,react-native,notifications,firebase-cloud-messaging,Firebase,React Native,Notifications,Firebase Cloud Messaging,我正在尝试使用firebase云消息处理react本机项目中的组通知。在前台/后台以及应用程序被终止时,通知会正确发送,但我无法对通知进行分组。正如文档所述,我使用了groupChannel,但当通知发送到设备时,新的通知将取代旧的通知。 以下是我通过邮递员发送的邮件: { “收件人”:“我的代币”, “优先级”:“高”, “数据”:{ “头衔”:“我的头衔”, “body”:“Lorem”, “远程”:对, “声音”:“默认值”, “优先级”:“高”, “groupId”:“Group2”,

我正在尝试使用firebase云消息处理react本机项目中的组通知。在前台/后台以及应用程序被终止时,通知会正确发送,但我无法对通知进行分组。正如文档所述,我使用了groupChannel,但当通知发送到设备时,新的通知将取代旧的通知。 以下是我通过邮递员发送的邮件: { “收件人”:“我的代币”, “优先级”:“高”, “数据”:{ “头衔”:“我的头衔”, “body”:“Lorem”, “远程”:对, “声音”:“默认值”, “优先级”:“高”, “groupId”:“Group2”, “标记”:“组标记” }

}

这是我的密码:

   this.notificationListener =  firebase.messaging().onMessage(async message=>{
  console.log(message,'foreground')

    const {body,title,sound,groupId,tag} = message.data;
    const GroupChannelId = new firebase.notifications.Android.ChannelGroup(
      groupId,
      'Group')
      firebase.notifications().android.createChannelGroup(GroupChannelId);
      const localNotification = new firebase.notifications.Notification()
      .setTitle(title)
      .setBody(body)
      .setData(message.data)
      .setNotificationId(groupId)
      .android.setGroup(groupId)
      .android.setBigText(body)
      .android.setVibrate([600,300,200,300,500])
      .android.setAutoCancel(true)
      .android.setChannelId(groupId)
      .android.setGroupAlertBehaviour(firebase.notifications.Android.GroupAlert.Children)
      .android.setPriority(firebase.notifications.Android.Priority.High);

const date = new Date();
date.setMinutes(date.getMinutes() + 1);
firebase.notifications().scheduleNotification(localNotification,{
  fireDate:date.getTime()
})

  firebase.notifications().displayNotification(localNotification);

})