android - FCM - 获取消息标签

标签 android firebase-cloud-messaging firebase-notifications

要从 FCM 后端发送消息,我们有以下 View :

enter image description here

我想从 RemoteMessage 获取消息标签 (libellé du message)。当我对该字段进行调试时,消息中的内容被标记为 google.c.a.c_l,我认为这是一个内部字段。

enter image description here

最佳答案

首先,我只是想和你的问题一样。但是在阅读文档后here玩弄它,我发现:

  • 您无法在客户端设备上获取消息标签,因为它只是一个仅在 firebase 控制台上显示的标签。
  • 要在客户端获得标题,您必须使用在底部自动折叠的高级选项。使用高级选项,您还可以通过键/值向客户端发送数据负载。
  • 然后 remoteMessage.getNotification().getBody() 用于通知的消息正文(来自 Message text/Texte du message),remoteMessage.getNotification().getTitle()用于通知标题(来自高级选项),remoteMessage.getData() 用于数据负载(来自高级选项)。

关于android - FCM - 获取消息标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39368248/

相关文章:

android - 使用 Appium + TestNG + Eclipse 在 Android 上运行自动测试

ios - "error": "InvalidRegistration" while sending push notifications

ios - Flutter [firebase_messaging] IOS 构建错误

c# - 异常 : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel

android - Android Marshmallow 中的NotificationListenerService

android - 无法展开 Firebase 通知

android - 带冒号的 GCM 注册 token 是否有效?

java - Android:如何从中创建 Switch 机箱?

android - Hadoop 移动应用程序

Android Push Notifications : Icon not displaying in notification, 显示为白色方 block