You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Firebase Cloud Messaging发送MulticastMessage时出现404错误求助

Firebase Cloud Messaging发送MulticastMessage时出现404错误求助

各位开发者好,我最近在使用Firebase Cloud Messaging发送批量通知时遇到了一个棘手的问题,想求助大家帮忙排查下原因。

我运行了以下批量发送通知的代码:

cred = credentials.Certificate('x.json')
firebase_admin.initialize_app(cred)
registration_tokens = [
    'GET REAL TOKEN1',
    'GET REAL TOKEN2',
]

message = messaging.MulticastMessage(
    notification=messaging.Notification(
        title="Notification Title",
        body="Notification Text",
    ),
    tokens=registration_tokens
)

response = messaging.send_multicast(message)
print('response', response.success_count, response.failure_count)

但执行这段代码后,我收到了404错误,具体错误内容如下:

<a href=//www.google.com/></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>The requested URL <code>/batch</code> was not found on this server.  <ins>That’s all we know.</ins>

特别说明:我使用messaging.Message()单独给单个用户发送消息时完全正常,没有任何问题,只有批量发送时会触发这个404错误。

备注:内容来源于stack exchange,提问作者Alireza.e

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.14 13:53:06