Skip to content

Fix/macos detach event listeners - #338

Merged
cybex-dev merged 6 commits into
masterfrom
fix/macos_detach_event_listeners
Aug 7, 2026
Merged

cybex-dev merged 6 commits into
masterfrom
fix/macos_detach_event_listeners

Conversation

@cybex-dev

Copy link
Copy Markdown
Owner

This pull request introduces several improvements and bug fixes to the Twilio Voice Flutter plugin, particularly for macOS support and JavaScript interop. The most significant changes include expanded platform support for incoming calls, improved handling of custom parameters in JS interop, more robust event listener management, and some code cleanup for call disposal.

Platform support improvements:

  • Incoming call handling is now enabled for macOS in addition to web and Android by updating platform checks in _AppState (main.dart). [1] [2]

JavaScript interop and event listener management:

  • The customParameters method in TVCall.swift now correctly handles Twilio's JS Map by converting it to a plain object, ensuring parameters are accessible on macOS. Also, custom parameters only fill gaps not covered by Twilio's authoritative parameters. [1] [2]
  • Event listener handler variable names are now sanitized to handle event names with invalid JS identifier characters, and removal uses removeListener instead of off for better compatibility. [1] [2] [3]

Twilio event support:

  • The set of detached events in detachEventListeners was expanded to include warning and warningCleared events.

Code cleanup:

  • Redundant calls to twilioCall?.dispose() were removed from TwilioVoicePlugin.swift to prevent unnecessary disposal. [1] [2] [3]

@cybex-dev cybex-dev self-assigned this Aug 7, 2026
@cybex-dev cybex-dev added bug Something isn't working macOS labels Aug 7, 2026
@cybex-dev
cybex-dev merged commit f864cc7 into master Aug 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant