feat(linux): Creating a background service works

This commit is contained in:
2023-09-10 22:02:39 +02:00
parent 01374a8eb9
commit e0ccbc8b85
16 changed files with 576 additions and 14 deletions

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(