FCM-获取消息标签 [英] FCM - Get Message Label

查看:103
本文介绍了FCM-获取消息标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

To send a message from FCM backend, we have this view :

我想从RemoteMessage获取邮件标签(邮件的电子邮件).当我调试该字段时,消息中的内容被标记为google.c.a.c_l,我认为这是一个内部字段.

I wanna to get the message label (libellé du message) from RemoteMessage. When I debug for the field, the content in the message is labeled as google.c.a.c_l, which I think is an internal field.

推荐答案

首先,我想知道与您的问题相同的问题.但是在阅读文档此处并对其进行处理之后,我发现:

First, I just wonder the same as your question. But after read the document here and played around with it, I found that:

  • 您无法在客户端设备上获得消息标签,因为它仅是在Firebase控制台上显示的标签.
  • 要在客户端获得标题,您必须使用高级选项,该选项自动在底部折叠.使用高级"选项,您还可以按键/值向客户端发送数据有效载荷.
  • 然后remoteMessage.getNotification().getBody()表示通知的消息正文(来自消息文本/文本消息),remoteMessage.getNotification().getTitle()表示通知的标题(来自高级"选项),remoteMessage.getData()表示数据有效载荷(来自高级"选项).
  • You cannot get the message label on client device, because it is just a label for display on firebase console only.
  • To get title at client side, you have to use Advanced options which is auto collapse at the bottom. With Advanced options, you can also send a data payload to the client by key/value.
  • Then remoteMessage.getNotification().getBody() for notification's message body (from Message text/Texte du message), remoteMessage.getNotification().getTitle() for notitifcation's title (from Advanced options), remoteMessage.getData() for data payload (from Advanced options).

这篇关于FCM-获取消息标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆