FCM 交货收据行为

FCM delivery receipts behavior

我在发送的消息中设置了 delivery_receipt_requested 参数,以请求送达回执。

是否始终发送送货回执,或者如果应用程序是 运行 后台或前台,框架的行为是否不同?

文档解决了这个问题,但没有明确说明应用程序的行为方式是否相同。我想确定我没有遗漏任何东西。

我认为它没有 明确地 说明当您的客户端应用程序在前台或后台时是否收到它的原因是因为无论如何,它在技术上都是被设备视为收到,这是docs:

中明确提到的

For Android and Chrome client apps, you can get delivery receipts (sent from CCS to your app server) when a device confirms that it received a message sent by CCS.

我认为你应该警惕的行为是当 CSS 和设备之间的连接不良时收到重复的收据:

If the connection between CCS and the device is poor, GCM may send multiple, duplicate delivery receipts. You can safely ignore such duplicates.

除此之外,很确定在收到消息时客户端应用程序的状态没有其他区别。