admin管理员组文章数量:1023078
the notifications are not triggered when the device is locked or app is killed, but when I open the device then it comes
I have set the awesome notifications as follows:
import 'package:awesome_notifications/awesome_notifications.dart';
Future<void> main() async {
//debugPaintSizeEnabled = true;
WidgetsFlutterBinding.ensureInitialized();
// Always initialize Awesome Notifications
await NotificationController.initializeLocalNotifications();
await NotificationController.initializeIsolateReceivePort();
await Geolocator.requestPermission();
runApp(const MyApp());
}
static List<Map<String, dynamic>> allWeeksNotifications = [
{
'notificationweekday': 'Sunday',
'notificationtime': '09:00',
'notificationtitle': 'Ssunday Notification',
'notificationbody': 'it is Sunday',
'pagetype': 'tab2',
'pageindex': 2,
'notificationid': 1030
}]
static Future<void> initializeLocalNotifications() async {
await AwesomeNotifications().initialize(
null,
[
NotificationChannel(
channelKey: 'adan_channel',
channelName: 'Adan Notifications',
channelDescription: 'Notifications for Adan prayer times',
defaultColor: Colors.green,
ledColor: Colors.green,
importance: NotificationImportance.High,
channelShowBadge: true,
),
],);
initialAction = await AwesomeNotifications()
.getInitialNotificationAction(removeFromActionEvents: false);
}
here is my try
the notifications are not triggered when the device is locked or app is killed, but when I open the device then it comes
I have set the awesome notifications as follows:
import 'package:awesome_notifications/awesome_notifications.dart';
Future<void> main() async {
//debugPaintSizeEnabled = true;
WidgetsFlutterBinding.ensureInitialized();
// Always initialize Awesome Notifications
await NotificationController.initializeLocalNotifications();
await NotificationController.initializeIsolateReceivePort();
await Geolocator.requestPermission();
runApp(const MyApp());
}
static List<Map<String, dynamic>> allWeeksNotifications = [
{
'notificationweekday': 'Sunday',
'notificationtime': '09:00',
'notificationtitle': 'Ssunday Notification',
'notificationbody': 'it is Sunday',
'pagetype': 'tab2',
'pageindex': 2,
'notificationid': 1030
}]
static Future<void> initializeLocalNotifications() async {
await AwesomeNotifications().initialize(
null,
[
NotificationChannel(
channelKey: 'adan_channel',
channelName: 'Adan Notifications',
channelDescription: 'Notifications for Adan prayer times',
defaultColor: Colors.green,
ledColor: Colors.green,
importance: NotificationImportance.High,
channelShowBadge: true,
),
],);
initialAction = await AwesomeNotifications()
.getInitialNotificationAction(removeFromActionEvents: false);
}
here is my try
本文标签: flutterAwesome Notifications not triggered when device is lockedStack Overflow
版权声明:本文标题:flutter - Awesome Notifications not triggered when device is locked - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745576255a2157034.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论