Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MissingPluginException for 'FcmDartService#start' on iOS #2549

Closed
tkeithblack opened this issue May 13, 2020 · 3 comments
Closed

MissingPluginException for 'FcmDartService#start' on iOS #2549

tkeithblack opened this issue May 13, 2020 · 3 comments

Comments

@tkeithblack
Copy link

Defining 'onBackgroundMessage' in firebaseMessaging.configure(...) causes a MissingPluginException under iOS because there is no MethodChannel definition for "FcmDartService#start" in the iOS implementation.

firebaseMessaging.configure(
      onMessage: (Map<String, dynamic> message) async {
        print("onMessage: $message");
      },
      onBackgroundMessage: backgroundMessageHandler,  // <- causes exception on iOS.
      onLaunch: (Map<String, dynamic> message) async {
        print("onLaunch: $message");
      },
      onResume: (Map<String, dynamic> message) async {
        print("onResume: $message");
      },
    );

Version: firebase_messaging 6.0.15

@philipgiuliani
Copy link

philipgiuliani commented May 14, 2020

iOS is currently not supported. You have to write it like this:

import 'dart:io';
....
onBackgroundMessage: Platform.isAndroid ? backgroundMessageHandler : null,

There is a fix PR open: #2180

@iapicca
Copy link

iapicca commented May 15, 2020

Hi @tkeithblack
I see there's an open issue addressing the case you described.
Please follow up on that issue,
I'm closing the current one as duplicate.
If you disagree please write in the comments
and I will reopen it.
Thank you

@iapicca iapicca closed this as completed May 15, 2020
@tkeithblack
Copy link
Author

Hi @tkeithblack
I see there's an open issue addressing the case you described.
Please follow up on that issue,
I'm closing the current one as duplicate.
If you disagree please write in the comments
and I will reopen it.
Thank you

Thank you @iapicca. Probably should update the plugin docs showing this is not supported for iOS.

Keith

@firebase firebase locked and limited conversation to collaborators Jul 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants