Describe the bug
A clear and concise description of what the bug is.
after adding latest firebase_messaging to my app
all is working fine
but after each notification arrive there is this error:
E/flutter ( 3795): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method FcmDartService#initialized on channel plugins.flutter.io/firebase_messaging_background)
E/flutter ( 3795): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:319:7)
E/flutter ( 3795): <asynchronous suspension>
E/flutter ( 3795): #1 _fcmSetupBackgroundChannel (package:firebase_messaging/firebase_messaging.dart:50:21)
E/flutter ( 3795): #2 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:45:6)
E/flutter ( 3795): #3 _fcmSetupBackgroundChannel (package:firebase_messaging/firebase_messaging.dart:23:32)
E/flutter ( 3795): #4 _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:239:25)
E/flutter ( 3795): #5 _rootRun (dart:async/zone.dart:1126:13)
E/flutter ( 3795): #6 _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter ( 3795): #7 _runZoned (dart:async/zone.dart:1518:10)
E/flutter ( 3795): #8 runZoned (dart:async/zone.dart:1502:12)
E/flutter ( 3795): #9 _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:231:5)
E/flutter ( 3795): #10 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:307:19)
E/flutter ( 3795): #11 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
Flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.7, on Microsoft Windows [Version 10.0.18363.535], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.6)
[√] IntelliJ IDEA Community Edition (version 2019.2)
[√] VS Code (version 1.41.1)
[√] Connected device (1 available)
• No issues found!
Hi @majdkz97
can you please provide your flutter run --verbose
and your pubspec.yaml
or if possible a reproducible minimal code sample.
Thank you
iapicca
The channel method FcmDartService#start is not implement at all on iOS. On iOS, If onBackgroundMessage is provided, an exception will be raised every time.
At a minimum, this exception should be changed to a "not implemented on this platform" type message so consumers know how to adjust their code
Going to re-open to track this. It should be handled gracefully on iOS.
I'm seeing this with Android:
E/flutter (23706): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method FcmDartService#initialized on channel plugins.flutter.io/firebase_messaging_background)
E/flutter (23706): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7)
E/flutter (23706): <asynchronous suspension>
E/flutter (23706): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
E/flutter (23706): #2 _fcmSetupBackgroundChannel (package:firebase_messaging/firebase_messaging.dart:50:21)
E/flutter (23706): #3 _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:241:25)
E/flutter (23706): #4 _rootRun (dart:async/zone.dart:1184:13)
E/flutter (23706): #5 _CustomZone.run (dart:async/zone.dart:1077:19)
E/flutter (23706): #6 _runZoned (dart:async/zone.dart:1619:10)
E/flutter (23706): #7 runZonedGuarded (dart:async/zone.dart:1608:12)
E/flutter (23706): #8 _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:233:5)
E/flutter (23706): #9 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301:19)
E/flutter (23706): #10 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
E/flutter (23706):
i had the same error too, but when it comes to me, to solve this I had to remove flutter apns plugin who were disabling fcm plugin.
I didn't see it into your pubspec.yaml but maybe for you it's a another plugin.
Check my GitHub issue :
https://github.com/FirebaseExtended/flutterfire/issues/2878
Most helpful comment
iapiccaThe channel method
FcmDartService#startis not implement at all on iOS. On iOS, IfonBackgroundMessageis provided, an exception will be raised every time.At a minimum, this exception should be changed to a "not implemented on this platform" type message so consumers know how to adjust their code