未收到Firebase云消息传递收据

Vis*_*hnu 13 xmpp node.js firebase google-cloud-functions firebase-cloud-messaging

我通过fcm xmpp客户端发送以下消息.但我没有收到交付邮件的送达回执.

我正在使用node-xcs节点包发送XMPP消息.

var Sender = require('node-xcs').Sender;
var Message = require('node-xcs').Message;
var Notification = require('node-xcs').Notification;
var Result = require('node-xcs').Result;
var xcs = new Sender('123', 'xxxx', 1);
const uuidv4 = require('uuid/v4');
xcs.on('message', function(messageId, from, data, category) {
    console.log('received message', arguments);
}); 


xcs.on('receipt', function(messageId, from,  data, category){
    console.log(messageId,'dsafdsafdsaf')
});

xcs.on('connected', function(){console.log('connected')});
xcs.on('disconnected', function(){console.log('disconnected')});
xcs.on('online', function(){console.log('online')});
xcs.on('error', console.error);
xcs.on('message-error', function(){console.log('message-error')});

var notification = new Notification("./logo.png")
    .title("Hello buddy!")
    .clickAction("https://github.com/guness/node-xcs/blob/master/google/Notification.js")
    .body("test_body")
    .build();

var message = new Message(uuidv4())
    .priority("high")
    .dryRun(false)
    .deliveryReceiptRequested(true)
    .notification(notification)
    .build();

xcs.sendNoRetry(message, 'token', function(result) {
    if (result.getError()) {
        console.error(result.getErrorDescription());
    } else {
        console.log("message sent: #" + result.getMessageId());
    }
});
Run Code Online (Sandbox Code Playgroud)

以下是从包发送的XMPP消息

<gcm xmlns="google:mobile:data">{
  "to": "token",
  "message_id": "59171fc6-42ad-4f22-812f-d0c4f7fa63d0",
  "priority": "high",
  "delivery_receipt_requested": true,
  "notification": {
    "body": "test_body",
    "click_action": "https://github.com/guness/node-xcs/blob/master/google/Notification.js",
    "icon": "./logo.png",
    "title": "Hello buddy!"
  }
}</gcm>
Run Code Online (Sandbox Code Playgroud)

我收到了ack,但我没有收到送货收据,为什么即使邮件已送达,送货收据也没有送达?

小智 1

node-xcs基于node-gcm-ccs的作品,但没有得到适当的维护。请参阅node-xcs
最后的免责声明 您甚至无法向 ios 设备发送通知,因为它只是为了支持向 Android 和 Web 设备发送 FCM 而构建的。

这里,它说它没有以非常粗体的字母维护。
我建议使用fcm-push而不是使用 node-xcs

去年,我在这个库中遇到了类似的问题,在阅读了这些非常大胆的“未维护、未维护、未维护”消息后,我转向了 fcm-push。