如何在不单击按钮的情况下创建通知? 打开应用程序时如何初始化出现通知?
String groupKey = 'com.android.example.WORK_EMAIL';
String groupChannelId = 'grouped channel id';
String groupChannelName = 'grouped channel name';
String groupChannelDescription = 'grouped channel description';
AndroidNotificationDetails firstNotificationAndroidSpecifics =
AndroidNotificationDetails(
groupChannelId, groupChannelName,
groupChannelDescription,
importance: Importance.Max,
priority: Priority.High,
groupKey: groupKey,
style: AndroidNotificationStyle.BigText,
styleInformation: BigTextStyleInformation(''),
);
final AndroidNotificationDetails android = AndroidNotificationDetails(
'ch_ID',
'Ch_Name',
'ch_Description',
priority: Priority.High,
importance: Importance.Max,
// add this line in your code
styleInformation: BigTextStyleInformation(''),
);
NotificationDetails firstNotificationPlatformSpecifics =
NotificationDetails(
firstNotificationAndroidSpecifics, null,);
flutterLocalNotificationsPlugin.show(
1, 'Confirmation ',
'Hello' , firstNotificationPlatformSpecifics);
如何快速启动通知?