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
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745576257a4633979.html
评论列表(0条)