我正在try 实现本地通知,在我升级应用程序版本之前,它工作得很好,如下所示:
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
showNotification() async {
var android = AndroidNotificationDetails(
'channel id', 'channel name');
var iOS = DarwinNotificationDetails();
var platform = NotificationDetails(android: android, iOS: iOS);
await flutterLocalNotificationsPlugin.periodicallyShow(0, 'Hello user,',
"Don't miss out on the exciting deals for the day.", RepeatInterval.everyMinute, platform);
}
但自从我更改为flutter_local_notifications: ^10.0.0
后,我就再也没有收到任何通知了.虽然我收到了错误消息[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: NoSuchMethodError: The method 'periodicallyShow' was called on null.
和Tried calling: periodicallyShow(0, "Hello Hobber,", "Don't miss out on the exciting deals for the day.", Instance of 'RepeatInterval', Instance of 'NotificationDetails')
,但有人能帮助我吗?