I followed ResoCoder's guide on how to set up everything having to do with the Awesome Notifications Plugin. When I try creating a new basic notification, this error is called:
AwesomeNotifications().initialize('resource://drawable/res_notification_logo', [
NotificationChannel(
channelKey: 'basic_channel',
defaultColor: Colors.tealAccent,
channelName: 'Basic '
'Notifications',
importance: NotificationImportance.High,
channelShowBadge: true,
channelDescription: 'Basic notifications for Fredi.')]);
Future<void> createBasicNotification() async {
try {
await AwesomeNotifications().createNotification(
content: NotificationContent(
id: createUniqueId(),
channelKey: 'basic_channel',
title: '${Emojis.money_coin} Test Notification Title',
body: 'This is your first notification boy',
bigPicture: 'assets://assets/frediLogoSlogan.png',
notificationLayout: NotificationLayout.BigPicture));
} on PlatformException catch (error) {
print("$error");
}
}
Then I call:
onPressed: () async {
print('pressed');
await createBasicNotification();
},
pressed
flutter: PlatformException(exception, Unknow error, The operation couldn’t be completed. (awesome_notifications.AwesomeNotificationsException error 1.), null)
I don't know what to fix as there is no description.
Please Help! Thanks!
Finally found what was wrong, this line:
bigPicture: 'assets://assets/frediLogoSlogan.png'
should be:
bigPicture: 'asset://assets/frediLogoSlogan.png',
The error description was only given if I tried on the android simulator. So give that a try of no error description is given.