Skip to content

setSpeaker support & emit pushkit notification for ios for seamless & reliable voip calls on ios #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

shivanshtalwar0
Copy link

In this pr i have introduced setSpeaker method which lets you toggle speaker on and off in sync with native call UI,
along with that i have introduced a pushkit event for dart side to handle cases such as when we want to notify app of call should hangup by using
something like this below when you send a pushkit notification on voip channel with alert so ios wont interpret it as another call and we can safely handle hangup.

callKeep.on<CallKeepPushPayload>((event) async {
      print('CallKeepPushPayload: ${event.payload}');
      final state = event.payload?['state'] ?? 'started';
      final eventType = event.payload?['eventType'] ?? '';
      if (state == 'ended' && eventType == 'call') {
        await endIncomingCall(event.payload?['uuid'] ?? '');
        return;
      }
    });

@Copilot Copilot AI review requested due to automatic review settings July 16, 2025 09:37
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces speaker control functionality and pushkit notification handling for iOS to enable seamless and reliable VoIP calls. The changes enable toggling speaker mode in sync with native call UI and provide a dart-side event for handling pushkit notifications that can be used for call hangup scenarios.

  • Adds setSpeaker method to toggle speaker on/off for both iOS and Android platforms
  • Introduces CallKeepPushPayload event for handling pushkit notifications on the Dart side
  • Updates code formatting and styling throughout multiple files

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lib/src/api.dart Adds setSpeaker method and improves code formatting consistency
lib/src/actions.dart Introduces CallKeepPushPayload event class
ios/Classes/CallKeep.m Implements setSpeaker functionality and adds pushkit payload event emission
ios/Classes/CallKeep.h Adds setSpeaker method declaration and CallKeepPushPayload constant
android/src/main/java/io/wazo/callkeep/VoiceConnectionService.java Updates foreground service type and API annotations
android/src/main/java/io/wazo/callkeep/CallKeepModule.java Implements setSpeaker functionality for Android
android/build.gradle Updates Gradle version
Comments suppressed due to low confidence (2)

@@ -70,6 +70,7 @@
import io.wazo.callkeep.utils.ConstraintsMap;

// @see https://github.com/kbagchiGWC/voice-quickstart-android/blob/9a2aff7fbe0d0a5ae9457b48e9ad408740dfb968/exampleConnectionService/src/main/java/com/twilio/voice/examples/connectionservice/VoiceConnectionService.java
@RequiresApi(api = Build.VERSION_CODES.M)
Copy link
Preview

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @RequiresApi annotation at class level requires API 23+, but the startForegroundService method has @RequiresApi(api = Build.VERSION_CODES.R) which requires API 30+. Consider if the class-level annotation should be more restrictive or if runtime checks are needed.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant