Skip to content

[Mac OS] Microphone permission is requested even if the client role is set to audience #2320

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
1 of 5 tasks
danielwilliamson opened this issue May 22, 2025 · 5 comments
Open
1 of 5 tasks
Labels
bug Something isn't working

Comments

@danielwilliamson
Copy link

danielwilliamson commented May 22, 2025

Version of the agora_rtc_engine

6.5.2

Platforms affected

  • Android
  • iOS
  • macOS
  • Windows
  • Web

Steps to reproduce

  1. Set the client role to ClientRoleType.clientRoleAudience
  2. Call joinChannel
  3. See that the microphone permission alert will appear

Expected results

When the client role is set to ClientRoleType.clientRoleAudience microphone permission won't be requested.

Actual results

When the client role is set to ClientRoleType.clientRoleAudience the microphone permission alert is shown.

Code sample

Code sample
await engine.setClientRole(role: ClientRoleType.clientRoleAudience);
await engine.enableVideo();
await engine.joinChannelWithUserAccount(...);

Screenshots or Video

Screenshots / Video demonstration

Image

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.29.3, on macOS 15.4 24E248 darwin-arm64, locale en-AU)
    ! Flutter version 3.29.3 on channel [user-branch] at /Users/danielwilliamson/development/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.99.3)
[✓] Connected device (4 available)
    ! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
@peilinok
Copy link
Contributor

Hi @danielwilliamson ,

Would please call engine.enableLocalAudio(false) before joinChannel and try again?

@danielwilliamson
Copy link
Author

Hi @peilinok thanks for the quick response. Unfortunately this didn't resolve the issue. Please see a snapshot of the logs below:

[2025-05-23 10:06:16.216] [81765] [info] [iris_rtc_device_manager_impl.cc:29] IrisRtcDeviceManagerImpl Initialize
[2025-05-23 10:06:16.216] [81765] [info] [iris_rtc_media_player_impl.cc:30] IrisMediaPlayerImpl Initialize
[2025-05-23 10:06:16.216] [81765] [info] [iris_rtc_spatial_audio_engine_impl.cc:202] IrisLocalSpatialAudioEngineImpl Initialize
[2025-05-23 10:06:16.216] [81765] [info] [iris_rtc_media_recorder_impl.cc:17] IrisMediaRecorderImpl Initialize
[2025-05-23 10:06:16.217] [81765] [info] [iris_rtc_music_center_impl.cc:20] IrisMusicPlayerImpl Initialize
[2025-05-23 10:06:16.217] [81765] [info] [iris_rtc_engine_impl.cc:112] api name RtcEngine_initialize ret 0 result {"result":0}
[2025-05-23 10:06:16.217] [81765] [info] [iris_rtc_engine_impl.cc:96] api name RtcEngine_setAppType params {"appType":4}
[2025-05-23 10:06:16.217] [81765] [info] [iris_rtc_engine_impl.cc:112] api name RtcEngine_setAppType ret 0 result {"result":0}
[2025-05-23 10:06:16.217] [81765] [info] [iris_rtc_engine_impl.cc:96] api name RtcEngine_enableVideo params {}
[2025-05-23 10:06:16.217] [81765] [info] [iris_rtc_engine_impl.cc:112] api name RtcEngine_enableVideo ret 0 result {"result":0}
[2025-05-23 10:06:16.218] [81765] [info] [iris_rtc_engine_impl.cc:96] api name RtcEngine_enableAudio params {}
[2025-05-23 10:06:16.218] [81765] [info] [iris_rtc_engine_impl.cc:112] api name RtcEngine_enableAudio ret 0 result {"result":0}
[2025-05-23 10:06:16.220] [81765] [info] [iris_rtc_engine_impl.cc:96] api name RtcEngine_registerEventHandler params {"event":105553164551120}
[2025-05-23 10:06:16.220] [81765] [info] [iris_rtc_engine_impl.cc:112] api name RtcEngine_registerEventHandler ret 0 result {"result":0}
[2025-05-23 10:06:16.220] [81765] [info] [iris_rtc_engine_impl.cc:96] api name RtcEngine_setChannelProfile params {"profile":1}
[2025-05-23 10:06:16.220] [81765] [info] [iris_rtc_engine_impl.cc:112] api name RtcEngine_setChannelProfile ret 0 result {"result":0}
[2025-05-23 10:06:16.226] [81765] [info] [iris_rtc_engine_impl.cc:96] api name RtcEngine_setAudioProfile params {"profile":5,"scenario":3}
[2025-05-23 10:06:16.227] [81765] [info] [iris_rtc_engine_impl.cc:112] api name RtcEngine_setAudioProfile ret 0 result {"result":0}
[2025-05-23 10:06:16.228] [81765] [info] [iris_rtc_engine_impl.cc:96] api name RtcEngine_setVideoEncoderConfiguration params {"config":{"dimensions":{"width":1280,"height":720},"frameRate":30,"orientationMode":2}}
[2025-05-23 10:06:16.228] [81765] [info] [iris_rtc_engine_impl.cc:112] api name RtcEngine_setVideoEncoderConfiguration ret 0 result {"result":0}
[2025-05-23 10:06:16.229] [81765] [info] [iris_rtc_engine_impl.cc:96] api name RtcEngine_setClientRole params {"role":2,"options":null}
[2025-05-23 10:06:16.229] [81765] [info] [iris_rtc_engine_impl.cc:112] api name RtcEngine_setClientRole ret 0 result {"result":0}
[2025-05-23 10:06:16.238] [81765] [info] [iris_rtc_engine_impl.cc:96] api name RtcEngine_enableLocalAudio params {"enabled":false}
[2025-05-23 10:06:16.238] [81765] [info] [iris_rtc_engine_impl.cc:112] api name RtcEngine_enableLocalAudio ret 0 result {"result":0}
[2025-05-23 10:06:16.251] [81765] [info] [iris_rtc_engine_impl.cc:96] api name RtcEngine_enableVideo params {}
[2025-05-23 10:06:16.251] [81765] [info] [iris_rtc_engine_impl.cc:112] api name RtcEngine_enableVideo ret 0 result {"result":0}
[2025-05-23 10:06:16.251] [81765] [info] [iris_rtc_engine_impl.cc:96] api name RtcEngine_joinChannelWithUserAccount params 

@peilinok
Copy link
Contributor

Hi @danielwilliamson ,

After consulting with our engineering team, we can confirm that our SDK only requests microphone access when explicitly calling joinChannel with microphone functionality enabled. Could you please verify if you have properly implemented the microphone permission request in your application, perhaps using a permission management solution like permission_handler? This is a crucial prerequisite for microphone access on the device.

@danielwilliamson
Copy link
Author

Hi @peilinok, the app in question is 1 to many live streaming app where there is 1 host and multiple viewers. So in this case it's not appropriate to prompt the user (the viewer) to accept microphone permissions when they themselves will never broadcast their voice.

This functionality works correctly on iOS. We don't prompt for microphone permission and when joining the Agora channel the user isn't prompted to accept the microphone permission. This is only an issue on Mac OS.

@peilinok
Copy link
Contributor

Hi @danielwilliamson , I will continue investigating this issue and will inform you immediately of any progress.

@peilinok peilinok added the bug Something isn't working label May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants