Home > Mobile >  New FireMessagin version
New FireMessagin version

Time:06-23

I have updated my flutter project to the new firebase versions.

And I have encountered the following problem.

The method 'configure' isn't defined for the class 'FirebaseMessaging'.
FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;

_firebaseMessaging.configure(
      onMessage: (Map<String, dynamic> message) async {
        ...
      },
      onResume: (Map<String, dynamic> message) async {
        ...
      },
      onLaunch: (Map<String, dynamic> message) async {
        ...
      },
    );

How would you do with the new version?

CodePudding user response:

Its old now : you can use this as per your requirement.

FirebaseMessaging.onMessage.listen((RemoteMessage message) {
});

check this link : https://firebase.flutter.dev/docs/messaging/usage/

  • Related