@@ -11,7 +11,6 @@ import 'package:webtrit_signaling_service/webtrit_signaling_service.dart';
1111import 'package:webtrit_phone/data/data.dart' ;
1212import 'package:webtrit_phone/models/models.dart' ;
1313import 'package:webtrit_phone/repositories/repositories.dart' ;
14- import 'package:webtrit_phone/push_notification/push_notifications.dart' ;
1514
1615import '../models/jsep_value.dart' ;
1716
@@ -30,24 +29,21 @@ class PushNotificationIsolateManager implements CallkeepBackgroundServiceDelegat
3029 required this .storage,
3130 required this .certificates,
3231 required this .logger,
33- required this .localPushRepository,
34- required this .missedCallTitle,
35- required this .unknownCallerFallback,
32+ required Future <void > Function (String callId, String ? callerName) onMissedCall,
3633 this .callLogsRepository,
37- }) : _pushService = callkeep {
34+ }) : _onMissedCall = onMissedCall,
35+ _pushService = callkeep {
3836 // setBackgroundServiceDelegate is called in the constructor so callkeep can
3937 // route performAnswerCall / performEndCall as soon as the object exists,
4038 // before [init] is called.
4139 _pushService.setBackgroundServiceDelegate (this );
4240 }
4341
4442 final Logger logger;
45- final LocalPushRepository localPushRepository;
4643 final CallLogsRepository ? callLogsRepository;
4744 final SecureStorage storage;
4845 final TrustedCertificates certificates;
49- final String missedCallTitle;
50- final String unknownCallerFallback;
46+ final Future <void > Function (String callId, String ? callerName) _onMissedCall;
5147
5248 final BackgroundPushNotificationService _pushService;
5349
@@ -499,13 +495,7 @@ class PushNotificationIsolateManager implements CallkeepBackgroundServiceDelegat
499495
500496 Future <void > _showMissedCallNotification (HangupEvent event, NewCall call) async {
501497 try {
502- await localPushRepository.displayPush (
503- AppLocalPush .missedCall (
504- event.callId,
505- missedCallTitle,
506- _getDisplayNameForMissedCall (event, call) ?? unknownCallerFallback,
507- ),
508- );
498+ await _onMissedCall (event.callId, _getDisplayNameForMissedCall (event, call));
509499 } catch (e) {
510500 logger.severe ('Failed to show missed call notification' , e);
511501 }
0 commit comments