gpt4 book ai didi

flutter - 错误 : User must be valid and have a name

转载 作者:行者123 更新时间:2023-12-02 18:23:00 28 4
gpt4 key购买 nike

我已经设置好一切以使用 Firebase Messaging。后台消息工作正常。但是对于前台消息,我遇到了以下错误:用户必须有效并且有一个名字。

W/System.err(15714): java.lang.RuntimeException: User must be valid and have a name.
W/System.err(15714): at android.app.Notification$MessagingStyle.validate(Notification.java:7229)
W/System.err(15714): at android.app.Notification$Builder.build(Notification.java:6088)
W/System.err(15714): at androidx.core.app.NotificationCompatBuilder.buildInternal(NotificationCompatBuilder.java:410)
W/System.err(15714): at androidx.core.app.NotificationCompatBuilder.build(NotificationCompatBuilder.java:324)
W/System.err(15714): at androidx.core.app.NotificationCompat$Builder.build(NotificationCompat.java:2430)
W/System.err(15714): at me.carda.awesome_notifications.notifications.NotificationBuilder.getNotificationBuilderFromModel(NotificationBuilder.java:425)
W/System.err(15714): at me.carda.awesome_notifications.notifications.NotificationBuilder.createNotification(NotificationBuilder.java:110)
W/System.err(15714): at me.carda.awesome_notifications.notifications.NotificationSender.showNotification(NotificationSender.java:209)
W/System.err(15714): at me.carda.awesome_notifications.notifications.NotificationSender.doInBackground(NotificationSender.java:128)
W/System.err(15714): at me.carda.awesome_notifications.notifications.NotificationSender.doInBackground(NotificationSender.java:34)
W/System.err(15714): at android.os.AsyncTask$3.call(AsyncTask.java:394)
W/System.err(15714): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/System.err(15714): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
W/System.err(15714): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err(15714): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err(15714): at java.lang.Thread.run(Thread.java:923)

它是这样调用的:

     AwesomeNotifications().createNotification(
content: NotificationContent(
id: uniqueIdInt(),
channelKey: 'basic_channel',
title: notification!.title,
body: notification.body,
notificationLayout: NotificationLayout.Messaging,
),
);

有什么线索吗?!

最佳答案

我也遇到了这个问题,花了我一段时间。您需要提供摘要才能正常工作

试试这个

AwesomeNotifications().createNotification(
content: NotificationContent(
id: uniqueIdInt(),
channelKey: 'basic_channel',
title: notification!.title,
body: notification.body,
summary: 'summary' // Anything you want here
notificationLayout: NotificationLayout.Messaging,
),
);

关于flutter - 错误 : User must be valid and have a name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70624957/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com