【发布时间】:2020-05-27 07:26:25
【问题描述】:
Firebase 文档要求像这样实现,它会在 node.js 服务器上获得成功返回值。但是通知没有送达。
从 Firebase 云消息传递控制台,所有通知/消息都会被传递。 除了以下情况,普通的 APNS 也可以使用。
此特定 JSON 签名不会向 APNS 确认。当我提供与 APNS 兼容的 JSON 时,Firebase 会返回错误。
// This registration token comes from the client FCM SDKs.
var registrationToken = 'YOUR_REGISTRATION_TOKEN';
var message = {
data: {
score: '850',
time: '2:45'
},
token: registrationToken
};
// Send a message to the device corresponding to the provided
// registration token.
admin.messaging().send(message)
.then((response) => {
// Response is a message ID string.
console.log('Successfully sent message:', response);
})
.catch((error) => {
console.log('Error sending message:', error);
});
做什么才能工作?
【问题讨论】:
-
请看我的回答。
标签: ios swift firebase firebase-cloud-messaging