向特定设备发送通知

Sending notification to a particular device

显示通知很简单

function spawnNotification(theBody,theIcon,theTitle) {
  var options = {
    body: theBody,
    icon: theIcon
  }
  var n = new Notification(theTitle,options);
}

如何将它发送到特定设备(通过 firebase-messaging 收到的令牌)。是否有 to 参数,如果有,我应该把它放在哪里?

有一个to参数。你把它放在你的消息负载中。

其他相关文档: