I am new to flutter.I have started to create a reminder app.I am trying to call a push notification on android alarm call back.I am using awesome_notifications. On call back I am calling _ringAlarm()
.I have pasted it below.
It says D/NotificationSender( 5192): Notification created
, but nothing shows on screen.
This exception was thrown while running:
W/System.err( 5192): java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(channel=basic_channel shortcut=null contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x11 color=0xff9d50dd vis=UNKNOWN(2))
Future _ringAlarm() async {
AwesomeNotifications().initialize(
'resource://drawable/logo.png',
[
NotificationChannel(
channelKey: 'basic_channel',
channelName: 'Basic notifications',
channelDescription: 'Notification channel for basic tests',
defaultColor: Color(0xFF9D50DD),
ledColor: Colors.white
)
]
);
AwesomeNotifications().isNotificationAllowed().then((isAllowed) {
if (!isAllowed) {
AwesomeNotifications().requestPermissionToSendNotifications();
}
});
AwesomeNotifications().createNotification(
content: NotificationContent(
id: 10,
channelKey: 'basic_channel',
title: 'Simple Notification',
body: 'Simple body'
)
);
}