Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

iOS Microphone permission requested automatically upon room connection without publishing

未关闭
#1,080 1 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
dart

调研方向

Start by tracing the iOS audio-session handling reached during room.connect() and compare it with the explicit microphone paths setMicrophoneEnabled(true) and LocalAudioTrack.create(). Reproduce on a physical iOS device with a token that has canPublish: false, without calling either publishing API. Done means connecting as a listener does not prompt for microphone permission, while explicit microphone use can still request it.

由索引模型根据 Issue 内容生成。

描述

Describe the bug
When joining a LiveKit room as a viewer (listener-only), the iOS system triggers a Microphone permission popup immediately upon calling room.connect(). This occurs even when autoSubscribe is handled correctly and no local tracks (audio or video) are being published by the client. For a "viewer" experience, no permission should be requested until the user explicitly attempts to publish.

To Reproduce
Initialize a Room object.
Call room.connect(url, token) with a token that has canPublish: false.
Observe that on a physical iOS device, the system prompts for Microphone access immediately during the connection phase.
Ensure room.localParticipant.setMicrophoneEnabled(true) is not called anywhere in the code.

Expected behavior
The room should connect silently. The microphone permission should only be requested when setMicrophoneEnabled(true) or LocalAudioTrack.create() is explicitly invoked.

Platform information
Flutter 3.41.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision db50e20168 (7 weeks ago) • 2026-03-25 16:21:00 -0700
Engine • hash 5cdd32777948fa7a648fac915f8da7120ac7e97a (revision 425cfb54d0) (1 months ago) • 2026-03-25 20:14:42.000Z
Tools • Dart 3.11.4 • DevTools 2.54.2

Plugin version: livekit_client: ^2.7.0

Flutter target OS: iOS [Real Device]

Flutter target OS version: iOS 26.4.2

  • Flutter version:
    Flutter (Channel stable, 3.41.6, on macOS 26.2 25C56 darwin-arm64, locale en-US) [583ms]
    • Flutter version 3.41.6 on channel stable at /Users/bisharatjunejo/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db50e20168 (7 weeks ago), 2026-03-25 16:21:00 -0700
    • Engine revision 425cfb54d0
    • Dart version 3.11.4
    • DevTools version 2.54.2
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging,
    enable-uiscene-migration

[!] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [3.4s]
• Android SDK at /Users/bisharatjunejo/Library/Android/sdk
• Emulator version 35.5.10.0 (build_id 13402964) (CL:N/A)
• Platform android-36, build-tools 36.0.0
• ANDROID_HOME = /Users/bisharatjunejo/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk".
• Java version OpenJDK Runtime Environment (build 21.0.6+-13368085-b895.109)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 26.0.1) [1,279ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17A400
• CocoaPods version 1.16.2

[✓] Chrome - develop for the web [6ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

  • Plugin version:
    Plugin version: livekit_client: ^2.7.0

  • Flutter target OS:
    Flutter target OS: iOS [Real Device]

  • Flutter target OS version:
    Flutter target OS version: iOS 26.4.2

  • Flutter console log:


Why is this happening?
On iOS, if an app touches the AVAudioSession category "PlayAndRecord," the OS may trigger the permission check. If LiveKit's default connection state sets the category to playAndRecord (even with the mic muted), iOS 17+ is very aggressive about showing that popup.

主要语言
Dart
星标
421
派生
260
平均合并
2 天 5 小时
30 天内合并 PR
17

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

livekit/client-sdk-flutter 的其他 Issue

查看 livekit/client-sdk-flutter 的全部 Issue

相似的 Issue

更多 Dart Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。