Skip to content

fix: register ADM observer after the peer connection factory is created (iOS)#13

Draft
SERDUN wants to merge 1 commit into
main_ext_rebase_06.05.26from
feat/wt-1415-call-waiting-tone
Draft

fix: register ADM observer after the peer connection factory is created (iOS)#13
SERDUN wants to merge 1 commit into
main_ext_rebase_06.05.26from
feat/wt-1415-call-waiting-tone

Conversation

@SERDUN

@SERDUN SERDUN commented Jul 3, 2026

Copy link
Copy Markdown
Member

Overview

The audio device module observer was assigned in the plugin init, but _peerConnectionFactory is created lazily in initialize:, so the assignment ran on nil and was a silent no-op. As a result no ADM callback was ever delivered - including the pre-existing audioDeviceModuleDidUpdateDevices: (device-change events posted to Dart as onDeviceChange). The observer is now set right after the factory is created.

The full RTCAudioDeviceModuleDelegate protocol is implemented with no-op stubs for the engine-lifecycle methods: the ADM invokes every method without respondsToSelector: checks (all methods are required in the header), so a partial adoption would crash with unrecognized selector once the observer is live.

No functional change beyond restoring the device-change events.

Testing

  • Verified on device (iPhone, iOS 26.4): engine-lifecycle delegate callbacks fire per call once the observer is registered; no crashes across call/route/CallKit cycles.
  • clang -fsyntax-only clean.

…ed (iOS)

The observer was assigned in the plugin init, but _peerConnectionFactory is
created lazily in initialize:, so the assignment ran on nil and was a silent
no-op - no ADM callback (device updates via audioDeviceModuleDidUpdateDevices,
engine lifecycle) was ever delivered. The observer is now set right after the
factory is created.

The full RTCAudioDeviceModuleDelegate protocol is implemented with no-op stubs
for the engine-lifecycle methods: the ADM invokes every method without
respondsToSelector checks (all are required), so a partial adoption would crash
once the observer is live.
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