gpt4 book ai didi

firebase - 注册 token 不是有效的 FCM 注册 token

转载 作者:行者123 更新时间:2023-12-02 11:21:09 29 4
gpt4 key购买 nike

我正在尝试使用从我的 Android 设备的 PassWallet 应用程序中保存的票证中获取的 token 向我的设备发送消息。

设备发送使用苹果钱包规范更新通行证所需的所有信息。但是,我正在使用 FCM 发送通知,但出现此错误:“注册 token 不是有效的 FCM 注册 token ”

{
errorInfo:
{ code: 'messaging/invalid-argument',
message: 'The registration token is not a valid FCM registration token' },
codePrefix: 'messaging'
}

我用来发送消息的代码是来自 Admin SDK 示例的代码:
var message = {
token: device.pushToken
};

admin.messaging().send(message)
.then((response) => {
console.log('Successfully sent message:', response);
})
.catch((error) => {
console.log('Error sending message:', error);
});
  • 我不确定我的消息是否不完整,我需要其他内容
    body 。
  • 如果 token 过期(您可以在 Firebase 上验证这一点)。
  • 如果消息需要指定是Android、iOS(APNS)等...

  • 这是完整的堆栈跟踪:
    Error: The registration token is not a valid FCM registration token
    at FirebaseMessagingError.FirebaseError [as constructor] (/srv/node_modules/firebase-admin/lib/utils/error.js:39:28)
    at FirebaseMessagingError.PrefixedFirebaseError [as constructor] (/srv/node_modules/firebase-admin/lib/utils/error.js:85:28)
    at new FirebaseMessagingError (/srv/node_modules/firebase-admin/lib/utils/error.js:241:16)
    at Function.FirebaseMessagingError.fromServerError (/srv/node_modules/firebase-admin/lib/utils/error.js:271:16)
    at FirebaseMessagingRequestHandler.handleHttpError (/srv/node_modules/firebase-admin/lib/messaging/messaging-api-request.js:125:50)
    at /srv/node_modules/firebase-admin/lib/messaging/messaging-api-request.js:113:23
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:229:7)
    errorInfo:
    { code: 'messaging/invalid-argument',
    message: 'The registration token is not a valid FCM registration token' },
    codePrefix: 'messaging' }

    最佳答案

    您应该发送到 Passwallet 服务器的有关更新的通行证的所有信息。
    请在此处找到最新说明:https://github.com/Kwiket/passwallet

    通行证团队

    关于firebase - 注册 token 不是有效的 FCM 注册 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54047803/

    29 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com