change UIBackgroundModes audio at runtime

别来无恙 提交于 2019-12-05 19:28:01

The Info.plist is a part of you application's bundle. All files in this bundle are immutable.

Keep the audio value there and just pause the music when application enters background (in case the user turned that option off).

Why would you want to solve it this way? If the user does not want to hear background audio, simply shut off the music when the application goes in the background...You probably shouldnt be modifying the apps plist at runtime anyway..

Can't you just stop audio when your app entered the background if the user doesn't want background running? Furthermore if you want your app to fully exit if backgrounded when the user doesn't want background running then call the exit(...) Function.

But in answer to your question, no you can't change the background modes (or anything in the info.plist) at runtime.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!