onMessage method

  1. @override
void onMessage(
  1. Function onRecieve,
  2. BuildContext context
)
override

Implementation

@override
void onMessage(Function onRecieve, BuildContext context) {
  debugPrint("CALLLEDDDDDDDDDD");
  FirebaseMessaging.onMessage.listen((RemoteMessage message) {
    onRecieve(message);

    // if (message.notification != null) {
    //   debugPrint('notification body: ${message.notification!.body}');
    //   debugPrint('notification title: ${message.notification!.title}');
    //   debugPrint('notification data: ${message.data}');

    //   if (message.notification != null) {
    //     showDialog(
    //         context: context,
    //         builder: (_) => AlertDialog(
    //               title: Text(message.notification!.title!),
    //               content: Text(message.notification!.body!),
    //             ));
    //   }
    // }
  });
}