首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >令人敬畏的通知:无效通知,我正在使用

令人敬畏的通知:无效通知,我正在使用
EN

Stack Overflow用户
提问于 2022-10-07 05:12:41
回答 2查看 68关注 0票数 -1
代码语言:javascript
运行
复制
E/Android: Awesome Notifications: Invalid notification (no valid small icon): Notification(channel=basic_channel shortcut=null contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x11 color=0xff009688 vis=PRIVATE) (NotificationThread:58)
W/System.err(25254): me.carda.awesome_notifications.core.exceptions.AwesomeNotificationsException: Invalid notification (no valid small icon): Notification(channel=basic_channel shortcut=null contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x11 color=0xff009688 vis=PRIVATE)
W/System.err(25254): at android.app.NotificationManager.fixNotification(NotificationManager.java:606)
W/System.err(25254): at android.app.NotificationManager.notifyAsUser(NotificationManager.java:585)
W/System.err(25254): at android.app.NotificationManager.notify(NotificationManager.java:534)
W/System.err(25254): at android.app.NotificationManager.notify(NotificationManager.java:510)
W/System.err(25254): at me.carda.awesome_notifications.core.managers.StatusBarManager.showNotificationOnStatusBar(StatusBarManager.java:86)
W/System.err(25254): at me.carda.awesome_notifications.core.threads.NotificationSender.showNotification(NotificationSender.java:260)
W/System.err(25254): at me.carda.awesome_notifications.core.threads.NotificationSender.doInBackground(NotificationSender.java:147)
W/System.err(25254): at me.carda.awesome_notifications.core.threads.NotificationSender.doInBackground(NotificationSender.java:32)
W/System.err(25254): at me.carda.awesome_notifications.core.threads.NotificationThread.runOnForegroundThread(NotificationThread.java:106)
W/System.err(25254): at me.carda.awesome_notifications.core.threads.NotificationThread.execute(NotificationThread.java:34)
W/System.err(25254): at me.carda.awesome_notifications.core.threads.NotificationSender.send(NotificationSender.java:101)
W/System.err(25254): at me.carda.awesome_notifications.core.AwesomeNotifications.createNotification(AwesomeNotifications.java:569)
W/System.err(25254): at me.carda.awesome_notifications.AwesomeNotificationsPlugin.channelMethodCreateNotification(AwesomeNotificationsPlugin.java:1274)
EN

回答 2

Stack Overflow用户

发布于 2022-10-07 08:07:33

您是否像下面提到的代码一样初始化了您的出色的通知插件?

代码语言:javascript
运行
复制
Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await AwesomeNotifications().initialize(
      // set the icon to null if you want to use the default app icon
      'resource://drawable/res_app_icon',
      [
        NotificationChannel(
            channelGroupKey: 'basic_channel_group',
            channelKey: 'basic_channel',
            channelName: 'Basic notifications',
            channelDescription: 'Notification channel for basic tests',
            defaultColor: Color(0xFF9D50DD),
            ledColor: Colors.white)
      ],
      // Channel groups are only visual and are not required
      channelGroups: [
        NotificationChannelGroup(
            channelGroupKey: 'basic_channel_group',
            channelGroupName: 'Basic group')
      ],
      debug: true
  );
  
  runApp(const MyApp());
}
票数 0
EN

Stack Overflow用户

发布于 2022-10-28 12:52:11

从图像路径删除图像的扩展,如下所示:

代码语言:javascript
运行
复制
'resource://drawable/res_notf_icon'
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73982648

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档