我已经创建了这样的通知:
const notification = new firebase.notifications.Notification()
.setNotificationId('1')
.setTitle('Reminder')
.setBody('Looooooooooooooooooooooonggggggg messageeeeeeeeeeeeeeeeeeeeee longggggggggggggg messsssssagggeeeeeeeeee')
.setData({
key: true,
data: {},
})
.android.setChannelId('test-channel')
.android.setAutoCancel(true)
.android.setPriority(firebase.notifications.Android.Priority.Max);
我想在通知中显示所有正文消息。但它只显示一行消息。
答案 0 :(得分:1)
android对象中有一个bigText道具。您可以在https://rnfirebase.io/docs/v5.x.x/notifications/reference/AndroidNotification#setBigText此处查看文档,但为了总结一下这种做法
const notification = new firebase.notifications.Notification()
.setNotificationId('1')
.setTitle('Reminder')
.setBody('Looooooooooooooooooooooonggggggg messageeeeeeeeeeeeeeeeeeeeee longggggggggggggg messsssssagggeeeeeeeeee')
.setData({
key: true,
data: {},
})
.android.setChannelId('test-channel')
.android.setAutoCancel(true)
.android.setBigText('Looooooooooooooooooooooonggggggg messageeeeeeeeeeeeeeeeeeeeee longggggggggggggg messsssssagggeeeeeeeeee')
.android.setPriority(firebase.notifications.Android.Priority.Max);