Use native service as Android notification source
This commit is contained in:
@@ -14,6 +14,7 @@ import '../features/attention/notify/notification_controller.dart';
|
||||
import '../features/attention/notify/chat_question_notices.dart';
|
||||
import '../features/attention/notify/notification_store.dart';
|
||||
import '../features/notification_service/notification_service_bridge.dart';
|
||||
import '../features/notification_service/notification_service_controller.dart';
|
||||
import '../features/notification_service/notification_service_handoff.dart';
|
||||
import '../features/attention/runtime/attention_ack_queue.dart';
|
||||
import '../features/attention/runtime/attention_ack_sync.dart';
|
||||
@@ -118,6 +119,7 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
store: SharedPreferencesNotificationStore(
|
||||
serverId: serverStorageScope(widget.serverId),
|
||||
),
|
||||
serviceController: _deliveryController,
|
||||
);
|
||||
ChatQuestionNotices? _chatQuestionNotices;
|
||||
|
||||
@@ -152,6 +154,13 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
/// Android background delivery (no service elsewhere).
|
||||
final NotificationServiceBridge _deliveryService =
|
||||
createNotificationServiceBridge();
|
||||
late final NotificationServiceController _deliveryController =
|
||||
NotificationServiceController(
|
||||
_deliveryService,
|
||||
requestNotificationPermission: () async {
|
||||
await _notifications.requestPermission();
|
||||
},
|
||||
);
|
||||
NotificationServiceHandoff? _deliveryHandoff;
|
||||
|
||||
@override
|
||||
@@ -250,6 +259,7 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
_ackSync.dispose();
|
||||
_attentionCount.dispose();
|
||||
_notifications.dispose();
|
||||
_deliveryController.dispose();
|
||||
_chatQuestionNotices?.dispose();
|
||||
_delegate.removeListener(_routeChanged);
|
||||
_delegate.dispose();
|
||||
@@ -567,6 +577,7 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
onOpenTemplates: _delegate.openTemplates,
|
||||
notifications: _notifications,
|
||||
deliveryService: _deliveryService,
|
||||
deliveryServiceController: _deliveryController,
|
||||
),
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user