bluefireteam / audioplayers

A Flutter package to play multiple audio files simultaneously (Android/iOS/web/Linux/Windows/macOS)
https://pub.dartlang.org/packages/audioplayers
MIT License
2.01k stars 845 forks source link

Microphone permission issue #1838

Closed China-jxsg-YanYuanJie closed 2 months ago

China-jxsg-YanYuanJie commented 2 months ago

Checklist

Current bug behaviour

After I reference the SDK in my Flutter module, when the iOS program initializes the Flutter engine, Flutter needs to register the AudioplayersDarwinPlugin, and SwiftAudioplayersDarwinPlugin init will call globalContext.apply(), which causes the microphone permission to be obtained in advance. However, I have not actually used this permission yet.

Expected behaviour

I hope that registering AudioplayersDarwinPlugin will not trigger the acquisition of microphone permissions, but only obtain this permission and prompt the permission pop-up window when it is actually used.

Steps to reproduce

  1. Execute flutter run on the code sample
  2. ...
  3. ...

Code sample

Code sample ```dart void main() { } ```

Affected platforms

iOS

Platform details

No response

AudioPlayers Version

^5.2.1

Build mode

debug

Audio Files/URLs/Sources

No response

Screenshots

No response

Logs

my relevant logs
Full Logs ``` my full logs or a link to a gist ``` Flutter doctor: ``` Output of: flutter doctor -v ```

Related issues / more information

No response

Working on PR

yeah