简体   繁体   中英

AVAudioSession disable Background Audio at runtime

I am using the iOS background capabilities

<key>UIBackgroundModes</key>
<array>
    <string>audio</string>
</array>

I now want my users to be able to change this value at runtime. Is it possible to change this value at runtime or do i need to add logic to stop my audio in the applicationDidEnterBackground method?

The settings you are describing are left aside your app and cannot be changed at runtime. The correct way is to add logic yourself as you describe.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM