【发布时间】:2021-11-27 09:33:04
【问题描述】:
以下是在颤振中监听通知的代码,我正在从 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',
),
));
}
});
【问题讨论】:
标签: flutter notifications firebase-cloud-messaging delay