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:
Expected behavior
the print must be seen in logs.
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'
}]
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'
}]