我有一个 Asp.net,它在 FCM 传统 HTTP 端点上每天发出大约 10 万个请求
https://fcm.googleapis.com/fcm/send
但是每天大约有 500 个随机请求抛出 (502) Bad Gateway,如果我在一段时间后手动尝试这些请求,它会起作用并且通知到达。
我得到的错误:
Error 502 (Server Error)!!1
<p><b>502.</b>
<ins>That’s an error.</ins>
<p>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.
<ins>That’s all we know.</ins>
有时会抛出异常的请求:{
"registration_ids":[
"token 1",
"token 2"
],
"data":{
"type":"navigation",
"routeName":"Order",
"Id":"18360"
},
"notification":{
"title":"New Order Placed Successfully",
"body":"Click here for more details #8073",
"badge":1,
"sound":"default"
}
}
此致
最佳答案
迁移到 Http v1 解决了这个问题。
迁移指南:
https://firebase.google.com/docs/cloud-messaging/migrate-v1
注意:任何使用设备群组消息的应用必须继续使用旧 API 来管理设备群组(创建、更新等)。 HTTP v1 可以向设备组发送消息,但不支持管理。
关于c# - FCM 旧版 http 随机抛出 (502) 错误网关异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64446699/