Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 iPhone 和 iPad 上的硬件静音按钮打开时使应用程序声音静音。我想检测到,无论何时打开和关闭硬件静音按钮,我的应用程序声音都会打开和关闭。
您无需收听事件,只需使用适当的音频会话类别。AVAudioSessionCategoryAmbient 或 AVAudioSessionCategorySoloAmbient