0

I'm developing an android app using flutter which uses Firebase cloud messaging. Everything was working fine and it was receiving cloud messages but recently nothing happens when the device receives a cloud message no matter the app is in foreground or background or terminated. The only thing that is logged into console is:

E/FlutterFcmService: Fatal: failed to find callback

which from what I know it belongs to the fact that I haven't handled background messages and despite this I should be able to receive the message. how can I realize what is the cause of this problem? a log file or something?

PS: I've tested on real devices with Android version 21 and 29 and the results are the same.

PS: I've done

flutter pub upgrade
flutter pub get
flutter clean

and removed the app entirely then installed it again.

PS: I've sent the message using Firebase console and the project backend. both include 'notification' field inside the message.

Thanks in advance

Xoltawn
  • 1,445
  • 1
  • 11
  • 17
  • did you check this https://stackoverflow.com/questions/58156832/firebase-messaging-fatal-failed-to-find-callback – Merym Sep 15 '20 at 09:26
  • @Merym yep, it didn't work. now I'm getting the notification when the app is background. but when I tap on notification, onResume is not called. And also when I'm inside app , onMessage function is not called – Xoltawn Sep 16 '20 at 10:53
  • what eror do you get now – Merym Sep 16 '20 at 10:54
  • @Merym I'm getting the notification when the app is background and the notification is shown in notification bar. but when I tap on notification, onResume is not called. And also when I'm inside app , onMessage function is not called and I get:E/FlutterFcmService: Fatal: failed to find callback – Xoltawn Sep 16 '20 at 11:34
  • you have to add click_action: 'FLUTTER_NOTIFICATION_CLICK' – Merym Sep 16 '20 at 11:38
  • @Merym I'm adding this bro. furthermore, click_action is used to trigger onResume and onLaunch when tapping notification.my problem is even when app is in foreground, onMessage is not called and it logs to console :Fatal: failed to find callback – Xoltawn Sep 16 '20 at 12:05
  • you have to put youre code – Merym Sep 16 '20 at 12:08

0 Answers0