forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotification_interface.dart
More file actions
39 lines (31 loc) · 1.04 KB
/
Copy pathnotification_interface.dart
File metadata and controls
39 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import 'dart:async';
import 'package:awesome_notifications/awesome_notifications.dart';
import 'package:omi/backend/schema/message.dart';
/// Common interface for notification services across all platforms
abstract class NotificationInterface {
Future<void> initialize();
Future<void> showNotification({
required int id,
required String title,
required String body,
Map<String, String?>? payload,
bool wakeUpScreen = false,
NotificationSchedule? schedule,
NotificationLayout layout = NotificationLayout.Default,
});
Future<bool> requestNotificationPermissions();
Future<void> register();
Future<String> getTimeZone();
Future<void> saveFcmToken(String? token);
void saveNotificationToken();
Future<bool> hasNotificationPermissions();
Future<void> createNotification({
String title = '',
String body = '',
int notificationId = 1,
Map<String, String?>? payload,
});
void clearNotification(int id);
Future<void> listenForMessages();
Stream<ServerMessage> get listenForServerMessages;
}