Why is the notification sent from firebase is getting delay in receiving

Viewed 813

Below is the code for listening notification in flutter i am sending a notification from firebase console

    FirebaseMessaging.onMessage.listen((RemoteMessage message) {
      RemoteNotification notification = message.notification;
      AndroidNotification android = message.notification?.android;
      if (notification != null && android != null) {
        flutterLocalNotificationsPlugin.show(
            notification.hashCode,
            notification.title,
            notification.body,
            NotificationDetails(
              android: AndroidNotificationDetails(
                channel.id,
                channel.name,
                channel.description,
                color: Colors.blue,
                playSound: true,
                icon: 'ic_launcher',
              ),
            ));
      }
    });
1 Answers

Kindly explain it in details what is the actual problem you cannot receive notification when the app is open then you have to use local notification plugin for notification to be shown on app when app is open

Related