Skip to content

Commit c4374ca

Browse files
authored
hide CallKit notification when call is accepted from in-app incoming screen (#759)
1 parent 5b037a6 commit c4374ca

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

packages/stream_video_flutter/README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,7 @@ Here are some of the features we support:
6060
| Push notification providers support ||| |
6161
| Call recording ||| |
6262
| Broadcasting to HLS ||| |
63-
| Picture in picture support ||| In the Roadmap, part of the next major release |
64-
65-
66-
### Known Issues
67-
68-
* Missed calls, not delivered when device was offline, might ring on Android instead of showing missed call notification
63+
| Picture in picture support ||| |
6964

7065

7166
## 🗺️ Roadmap

packages/stream_video_push_notification/lib/src/stream_video_push_notification.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,19 @@ class StreamVideoPushNotificationManager implements PushNotificationManager {
8787
_idCallAccepted,
8888
client.events.on<CoordinatorCallAcceptedEvent>(
8989
(event) async {
90+
// end CallKit call on other devices if the call was accepted on one of them
9091
if (streamVideo.activeCall?.state.value.status
9192
is! CallStatusActive) {
9293
await endCallByCid(event.callCid.toString());
9394
}
95+
// if the call was accepted on the same device, end the CallKit call silently
96+
// (in case it was accepted from the app and not from the CallKit UI)
97+
else {
98+
await FlutterCallkitIncoming.silenceEvents();
99+
await endCallByCid(event.callCid.toString());
100+
await Future<void>.delayed(const Duration(milliseconds: 300));
101+
await FlutterCallkitIncoming.unsilenceEvents();
102+
}
94103
},
95104
),
96105
);

0 commit comments

Comments
 (0)