New FireMessagin version

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?

Upvotes: 0

Views: 48

Answers (1)

Hardik Mehta
Hardik Mehta

Reputation: 2415

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/

Upvotes: 1

Related Questions