feat(linux): Creating a background service works

This commit is contained in:
PapaTutuWawa committed 2023-09-10 22:02:39 +02:00
1 parent 01374a8eb9
commit e0ccbc8b85
16 files changed
+576 -14

No files matched your search

+16 -14
View File
@@ -127,21 +127,23 @@ class MyAppState extends State<MyApp> {
TextButton(
onPressed: () async {
// Create channel
await MoxxyNotificationsApi().createNotificationChannels(
[
NotificationChannel(
id: 'foreground_service',
title: 'Foreground service',
description: 'lol',
importance: NotificationChannelImportance.MIN,
showBadge: false,
vibration: false,
enableLights: false,
),
],
);
if (Platform.isAndroid) {
await MoxxyNotificationsApi().createNotificationChannels(
[
NotificationChannel(
id: 'foreground_service',
title: 'Foreground service',
description: 'lol',
importance: NotificationChannelImportance.MIN,
showBadge: false,
vibration: false,
enableLights: false,
),
],
);
await Permission.notification.request();
await Permission.notification.request();
}
final srv = getForegroundService();
await srv.start(