【问题标题】:Firebase Cloud Messaging - Identify delivery status for a particular push notification messageFirebase Cloud Messaging - 识别特定推送通知消息的传递状态
【发布时间】:2020-07-31 10:20:37
【问题描述】:

是否可以通过 Firebase 云消息传递识别特定推送通知消息是否已传递到特定令牌?如果是这样,是否可以通过 API 调用或侦听一些回调来做到这一点?

我知道我可以在控制台中查看汇总统计信息,甚至可以通过分析标签对这些统计信息进行细分,但无法找到获取更多离散信息的方法。

我还知道,如果令牌无效,API 将同步响应,但 Apple 和 Google 使令牌无效的过程有点不透明(对我而言),如果有人简单地关闭了我的应用程序的推送通知,也无济于事.

谢谢! 杰森

【问题讨论】:

  • 碰一下这个,以防有人有想法!

标签: push-notification firebase-cloud-messaging


【解决方案1】:

如果有人关闭了推送通知 - 您可以使用代码检查它
Swift ios check if remote push notifications are enabled in ios9 and ios10
Android app - detect if app push notification is off

但用户可能处于离线状态,或者 APNs/Firebase 服务可能会出现一些问题,并且您的通知将被丢弃。您可以在 iOS 和 Android 应用程序中使用一些代码检查交货状态。

如果您需要检查某些推送的交付状态,您可以制作推送通知扩展(在 iOS 中)。在您的 API 中发送有关已发送通知的状态。更多关于推送通知扩展的信息。
https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension

可能会有所帮助
https://developer.apple.com/documentation/usernotifications
https://developer.apple.com/documentation/usernotifications/modifying_content_in_newly_delivered_notifications

https://firebase.google.com/docs/cloud-messaging/understand-delivery https://firebase.google.com/docs/cloud-messaging/android/receive#handling_messages关于在Android中处理消息(你也可以发送状态传递)

我希望这个答案对您的问题有所帮助。

UPD:
https://firebase.google.com/docs/cloud-messaging/understand-delivery

已接收(仅适用于 Android 设备)- 数据消息或 应用程序已收到通知消息。这个数据是 当接收 Android 设备具有 FCM SDK 18.0.1 或 安装更高。

【讨论】:

  • 谢谢@Eysner。所以,换句话说,有没有办法使用 firebase API 检查状态,唯一的方法是使用我的应用程序直接通知我的后端?
  • @jdimmerman 您只能在 Android 上使用 firebase API。如果您需要有关所有平台的信息,您应该使用其他 API。
猜你喜欢
  • 2016-12-13
  • 1970-01-01
  • 2022-12-14
  • 1970-01-01
  • 1970-01-01
  • 2017-11-18
  • 2017-01-05
  • 2016-11-21
  • 2016-11-03
相关资源
最近更新 更多