As per flutter package I implemented code on my project but it threw exception while making build, "Notification channel 'call_channel' does not exist., n.a.a.k.f.a:". I don't understand why it's happen?
Here is my code.
WidgetsFlutterBinding.ensureInitialized();
await AwesomeNotifications().initialize(
'resource://drawable/ic_launcher',
[
NotificationChannel(
channelGroupKey: 'category_tests',
channelKey: 'call_channel',
channelName: 'Calls Channel',
channelDescription: 'Channel with call ringtone',
defaultColor: Color(0xFF9D50DD),
importance: NotificationImportance.Max,
ledColor: Colors.white,
channelShowBadge: true,
locked: true,
defaultRingtoneType: DefaultRingtoneType.Ringtone),
],
channelGroups: [
NotificationChannelGroup(
channelGroupkey: 'category_tests',
channelGroupName: 'Category tests',
)
],
debug: true);
await Firebase.initializeApp();
///Exception occure while run Api.
I/flutter ( 5032): PlatformException(createNewNotification, Notification channel 'basic_channel' does not exist., n.a.a.k.f.a: Notification channel 'basic_channel' does not exist.
I/flutter ( 5032): at n.a.a.k.i.g.i(:5)
I/flutter ( 5032): at n.a.a.k.i.k.i(Unknown Source:4)
I/flutter ( 5032): at n.a.a.k.d.b(Unknown Source:10)
I/flutter ( 5032): at n.a.a.f.f(:2)
I/flutter ( 5032): at n.a.a.f.onMethodCall(:42)
I/flutter ( 5032): at l.a.d.a.w.a(Unknown Source:17)
I/flutter ( 5032): at io.flutter.embedding.engine.n.g.e(Unknown Source:17)
I/flutter ( 5032): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(Unknown Source:4)
I/flutter ( 5032): at android.os.MessageQueue.nativePollOnce(Native Method)
I/flutter ( 5032): at android.os.MessageQueue.next(MessageQueue.java:335)
I/flutter ( 5032): at android.os.Looper.loopOnce(Looper.java:161)
I/flutter ( 5032): at android.os.Looper.loop(Looper.java:288)
I/flutter ( 5032): at android.app.ActivityThread.main(ActivityThread.java:7839)
I/flutter ( 5032): at java.lang.reflect.Method.invoke(Native Method)
I/flutter ( 5032): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
I/flutter ( 5032): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
I/flutter ( 5032): , null)
Exited