简体   繁体   English

Flutter Firebase 消息推送通知格式 3 行

[英]Flutter firebase messaging push notification format 3 lines

I am working on firebase push notification for my project.我正在为我的项目处理 firebase 推送通知。 I am receiving notification on all my devices.我在所有设备上都收到通知。

My problem is iOS devices showing notifications in below format.我的问题是iOS 设备以以下格式显示通知。

Title  :
Subtitle :
text/body:

My android devices showing notifications in below format.我的 android 设备以以下格式显示通知。

Title :
text/body:

below is the payload i am using for sending notification.下面是我用于发送通知的有效负载。

 var payload = {   "notification":{
          "title":"New Price Alert! "+ clientDataAfter.productname,
"subtitle":"Get before its gone",
          "body":"Old Price "+clientDataAfter.oldprice+" || New Price "+ clientDataAfter.newprice,
          "click_action":"FLUTTER_NOTIFICATION_CLICK",
        },
        "data" : {
          "id":ID,
          "name": Name,
          "newprice":newprice
        }, }

I want to show notifications in 3 line format on both iOS and android.我想在 iOS 和 android 上以 3 行格式显示通知。 How can i achieve this?我怎样才能做到这一点?

Thanks in advance.提前致谢。

使用“id”、“name”、...向“data”添加“subtitle”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM