Skip to content

Commit 0f90662

Browse files
authored
add callPreferences to observeCallKitEvents (#883)
1 parent c108e66 commit 0f90662

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

packages/stream_video/lib/src/stream_video.dart

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,13 +612,15 @@ class StreamVideo extends Disposable {
612612

613613
Future<bool> consumeAndAcceptActiveCall({
614614
void Function(Call)? onCallAccepted,
615+
CallPreferences? callPreferences,
615616
}) async {
616617
final calls = await pushNotificationManager?.activeCalls();
617618
if (calls == null || calls.isEmpty) return false;
618619

619620
final callResult = await consumeIncomingCall(
620621
uuid: calls.first.uuid!,
621622
cid: calls.first.callCid!,
623+
preferences: callPreferences,
622624
);
623625

624626
callResult.fold(
@@ -644,11 +646,14 @@ class StreamVideo extends Disposable {
644646

645647
CompositeSubscription observeCoreCallKitEvents({
646648
void Function(Call)? onCallAccepted,
649+
CallPreferences? acceptCallPreferences,
647650
}) {
648651
final callKitEventSubscriptions = CompositeSubscription();
649652

650-
observeCallAcceptCallKitEvent(onCallAccepted: onCallAccepted)
651-
?.addTo(callKitEventSubscriptions);
653+
observeCallAcceptCallKitEvent(
654+
onCallAccepted: onCallAccepted,
655+
acceptCallPreferences: acceptCallPreferences,
656+
)?.addTo(callKitEventSubscriptions);
652657

653658
observeCallDeclinedCallKitEvent()?.addTo(callKitEventSubscriptions);
654659
observeCallEndedCallKitEvent()?.addTo(callKitEventSubscriptions);
@@ -658,11 +663,13 @@ class StreamVideo extends Disposable {
658663

659664
StreamSubscription<ActionCallAccept>? observeCallAcceptCallKitEvent({
660665
void Function(Call)? onCallAccepted,
666+
CallPreferences? acceptCallPreferences,
661667
}) {
662668
return onCallKitEvent<ActionCallAccept>(
663669
(event) => _onCallAccept(
664670
event,
665671
onCallAccepted: onCallAccepted,
672+
callPreferences: acceptCallPreferences,
666673
),
667674
);
668675
}
@@ -678,14 +685,19 @@ class StreamVideo extends Disposable {
678685
Future<void> _onCallAccept(
679686
ActionCallAccept event, {
680687
void Function(Call)? onCallAccepted,
688+
CallPreferences? callPreferences,
681689
}) async {
682690
_logger.d(() => '[onCallAccept] event: $event');
683691

684692
final uuid = event.data.uuid;
685693
final cid = event.data.callCid;
686694
if (uuid == null || cid == null) return;
687695

688-
final call = await consumeIncomingCall(uuid: uuid, cid: cid);
696+
final call = await consumeIncomingCall(
697+
uuid: uuid,
698+
cid: cid,
699+
preferences: callPreferences,
700+
);
689701
final callToJoin = call.getDataOrNull();
690702
if (callToJoin == null) return;
691703

0 commit comments

Comments
 (0)