【问题标题】:Where can I find all error returns code of the NodeJS Firebase Admin SDK? [closed]在哪里可以找到 NodeJS Firebase Admin SDK 的所有错误返回代码? [关闭]
【发布时间】:2021-01-28 13:55:35
【问题描述】:

我根本找不到 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,但我在我的示例中找到的是此处列出的注释。那么在其他地方还有其他列表吗?

是我遗漏了什么还是我做错了什么?

【问题讨论】:

    标签: node.js firebase firebase-cloud-messaging


    【解决方案1】:

    错误代码列表在FCM documentation中。

    【讨论】:

      猜你喜欢
      • 2010-11-08
      • 2021-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-23
      • 1970-01-01
      • 2016-03-26
      • 2012-08-19
      相关资源
      最近更新 更多