2

运行:发送https://fcm.googleapis.com/fcm/send

{
  "to" : "xxxxxxxxxxxxxxxxxxxxxxxxx",   
  "priority" : "normal",
   "time_to_live" : 3,
  "notification" : {
    "body" : " test mensaje",
    "color":"#FF2301",
    "icon" : "ic_logo_noti_mini",
    "sound":"notificacion.mp3",
    "title" : "Notification ",
    "click_action" : "OPEN_ACTIVITY_1"
  },
   "data" : {
      "url_fiori" : "http://www.goole.com.ar"
    }
}

如果应用程序打开,则消息以正确的格式到达。如果 APP 是消息以错误的格式到达,它不会通过扩展 FirebaseMessagingService 的类的逻辑。

在此处输入图像描述

我必须通过关闭应用程序来获取消息 FCM 后台 simpre 开放格式。

可能是什么问题呢?

问候,

4

1 回答 1

0

问题解决了:

如果我们使用 FCM,并且我们希望从 SOAPUI、SAP、PI 等发送消息,并且消息由前台或后台 APP 接收,并且样式始终相同,则只能使用“数据”。通过 onMessageReceived 方法传递。

{ "data": {
"Title": "Firebase notification"
"Detail": "I am firebase notification."
  },
  "To": "efaOvIXDbik: APA91bEkNUVWNaoA ...."
  }

如果我们使用“通知”消息,如果应用程序处于前台或后台,它们将会有所不同

{
"To": "bk3RNwTe3H0: CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1 ..."

"Notification": {
   "Body": "great match!"
   "Title": "Portugal vs. Denmark"
   "Icon": "MyIcon"
   "Sound": "mySound"
}

}
于 2016-07-06T14:45:48.670 回答