Flutterfire: [Firebase Messaging] Notification Channel set in AndroidManifest.xml has not been created by the app. Default value will be used.

Created on 6 Apr 2020  路  3Comments  路  Source: FirebaseExtended/flutterfire

Describe the bug
when sending a notification while app is in recent apps the notifications arrives but the code in the on resume function is not executed instead this error message appears :
Notification Channel set in AndroidManifest.xml has not been created by the app. Default value will be used.
the code in the on resume is just a print of the message.

To Reproduce
Steps to reproduce the behavior:

  1. put the application in the recent apps.
  2. send a message via firebase console.
  3. notification is sent to device but no print in the logs instead this error message.
    Notification Channel set in AndroidManifest.xml has not been created by the app. Default value will be used.

Expected behavior
the print must be seen in logs.

android messaging user bug

Most helpful comment

for execute onResume/onLaunch you need to add 'click_action' data to FCM message with 'FLUTTER_NOTIFICATION_CLICK' value
so add this part to your message data
{...
'title' : 'any title',
'body' : 'anybody',
'data' : [{
...,
'click_action' : 'FLUTTER_NOTIFICATION_CLICK'
}]

All 3 comments

Hi @zadcall
can you please provide your flutter doctor -v and flutter run --verbose?
Thank you

I'd recommend using the https://pub.dev/packages/flutter_local_notifications plugin to create and manage notification channels on Android.

I'm assuming you've added a default notification channel id to your AndroidManifest.xml file; you'd need to use the plugin above to also create this channel if it does not already exist.

for execute onResume/onLaunch you need to add 'click_action' data to FCM message with 'FLUTTER_NOTIFICATION_CLICK' value
so add this part to your message data
{...
'title' : 'any title',
'body' : 'anybody',
'data' : [{
...,
'click_action' : 'FLUTTER_NOTIFICATION_CLICK'
}]

Was this page helpful?
0 / 5 - 0 ratings