为什么从firebase发送的通知接收延迟



下面是在flutter中侦听通知的代码,我正在从firebase控制台发送通知

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',
),
));
}
});

请详细解释一下实际问题是什么,当应用程序打开时,您无法收到通知,然后您必须使用本地通知插件,以便在应用程序打开时显示通知

最新更新