<分区>
我根本找不到 NodeJS Admin SDK 在发送消息时可以返回给我的所有错误代码。例如使用此代码:
this.app
.messaging()
.sendToDevice(an_invalid_registration_token, message, {
priority: 'high',
})
.then((response: MessagingDevicesResponse) => {
console.log(response.results[0].error)
})
它会输出这个:
{
errorInfo: {
code: 'messaging/invalid-registration-token',
message: 'Invalid registration token provided. Make sure it matches the registration token the client app receives from registering with FCM.'
},
codePrefix: 'messaging'
}
首先,这个输出不同于documentation描述(我主动删除了这里的堆栈)你可以看到属性 codePrefix
没有在文档中定义。但我也无法处理所有错误代码,例如此处出现的错误代码 messaging/invalid-registration-token
。我确实找到了 all these error codes但我在我的示例中使用的是此处列出的注释。那么在其他地方还有另一个列表吗?
我是不是遗漏了什么或者我弄错了什么?