我正在尝试使用多行文本消息进行推送通知,已经尝试了许多更改,如在FCMService.java中使用setBigStyle文本格式、HTML.fromHTML和其他一些方法。但是无法获取多行消息。
我查看了多个网站和解决方案,但均未奏效。请帮忙标记为重复或投票否决,并给出答案,我会点赞您的回答。
我查看了多个网站和解决方案,但均未奏效。请帮忙标记为重复或投票否决,并给出答案,我会点赞您的回答。
对不起,大家!我已经找到了解决方案。
在使用Push Notification V5时,无需修改任何文件(如FCMService.java或其他自定义消息),即可显示多行通知。
从您发送通知的对象中删除“style”字段。
通知的多行将自动显示。
如需更多信息,请点赞此答案并提出您的问题。我会帮助您解决。
{
"registration_ids" : ["XXXXXX"],
"priority" : "high",
"content-available": "0",
"notification": {
"title": "New Message",
"body": "You have an Instruction received. Please contact your admin to process further and more queries“,
"badge": "2",
"sound" : "default"
},
"data" : {
"message": "New Message",
"body": "You have an Instruction received RM",
"sound" : "default",
"actionId": "123456",
"badgeCount": "1",
"instructionType": "History",
"targetFunction": "actions",
"notificationType": "pvm"
}
}