Skip to content

Add background audio with foreground service and CallKit session - #2

Merged
graszka22 merged 1 commit into
mainfrom
graszka22/background-audio
Oct 26, 2026
Merged

graszka22 merged 1 commit into
mainfrom
graszka22/background-audio

Conversation

@graszka22

Copy link
Copy Markdown
Contributor

Keep microphone capture and playback running while the app is in the background, with an Android foreground service and an iOS CallKit session.

Keep microphone capture and playback running while the app is in the background, with an Android foreground service and an iOS CallKit session.

Co-authored-by: Cursor <cursoragent@cursor.com>
@graszka22
graszka22 force-pushed the graszka22/background-audio branch from a13c12e to b3525c6 Compare October 22, 2026 16:08
@graszka22
graszka22 changed the base branch from graszka22/audio-switch to main October 22, 2026 16:08
@Magmusacy
Magmusacy requested a balanced review from Copilot October 23, 2026 13:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved Android service crash and cancellation paths, plus CallKit lifecycle defects, can disrupt calls or leave resources running.

5 open issues
What changed in this PR

Adds opt-in background-call support to the Flutter SDK through an Android foreground service and an iOS CallKit session.

Changes:

  • Exposes background-service configuration and typed CallKit actions through public Dart APIs.
  • Implements native service, permission, and CallKit lifecycle handling.
  • Adds channel-level tests, example integration, and platform setup documentation.
File Description
test/​background/​foreground_service_test.dart Tests service configuration and platform no-ops.
test/​background/​call_kit_test.dart Tests CallKit methods and typed events.
SPEC.md Defines background-call behavior and setup requirements.
README.md Documents API usage and native configuration.
lib/​src/​background/​foreground_service.dart Adds the Android service API and configuration.
lib/​src/​background/​call_kit.dart Adds the CallKit API and action types.
lib/​fishjam_client.dart Exports the new public APIs.
ios/​fishjam_client/​Sources/​fishjam_client/​FishjamClientPlugin.swift Registers background method and event channels.
ios/​fishjam_client/​Sources/​fishjam_client/​CallKitManager.swift Implements CallKit sessions and media-session integration.
example/​lib/​room_screen.dart Integrates background support into room lifecycle handling.
example/​ios/​Runner/​Info.plist Enables audio and VoIP background modes.
example/​android/​app/​src/​main/​AndroidManifest.xml Declares foreground-service permissions and service.
CHANGELOG.md Records background-call support.
android/​src/​main/​kotlin/​io/​fishjam/​client/​foregroundservice/​NotificationPermission.kt Handles notification permission requests.
android/​src/​main/​kotlin/​io/​fishjam/​client/​foregroundservice/​ForegroundServiceController.kt Manages service configuration and requested types.
android/​src/​main/​kotlin/​io/​fishjam/​client/​foregroundservice/​FishjamForegroundService.kt Implements the foreground service and notification.
android/​src/​main/​kotlin/​io/​fishjam/​client/​FishjamClientPlugin.kt Connects service commands and activity permission callbacks.
AGENTS.md Documents ownership of native-plugin Dart modules.

Review effort: Balanced

@Magmusacy Magmusacy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good, couldn't find any real issues that would prevent this from going to prod

@graszka22
graszka22 merged commit 3d5c72c into main Oct 26, 2026
1 check passed
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.

3 participants