如何解决flutterLocalNotificationsPlugin.zonedSchedule 功能不起作用
我需要使用flutter本地调度,但是文档上的这个功能不起作用! 我曾尝试在用户单击它起作用的按钮后进行本地通知,但此功能存在问题
Future<void> schedulingNotification() async {
tz.initializeTimeZones();
final String timeZoneName = await FlutterNativeTimezone.getLocalTimezone();
tz.setLocalLocation(tz.getLocation(timeZoneName));
await flutterLocalNotificationsPlugin.zonedSchedule(
0,'scheduled title','scheduled body',tz.TZDateTime.now(tz.local).add(const Duration(seconds: 5)),const NotificationDetails(
android: AndroidNotificationDetails('your channel id','your channel name','your channel description')),androidAllowWhileIdle: true,uiLocalNotificationDateInterpretation:
UILocalNotificationDateInterpretation.absoluteTime);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。