I have successfully used background audio in published apps.
Use this code in build.settings …
settings = { iphone = { plist = { UIBackgroundModes = { "audio", }, UIApplicationExitsOnSuspend = false, }, }, }
and in your lua code …
-- set this propoerty to allow audio to continue playing when app suspended/screen locked or silent switch on -- N.B. this API is subject to change -- need to do this before any other audio calls -- N.B. this does not work in the Corona simulator only in iOS simulator or device if audio.supportsSessionProperty then --print("setting audio to allow play to continue on suspend") audio.setSessionProperty(audio.OverrideMixWithOthers, audio.MediaPlaybackMixMode) end
This has been working for quite a while - and still works with the iOS7 beta on my iPhone4S - but as Rob says, no guarantee that it won’t break in the future! You’ll find a lengthy thread about the audio session properties and the process i went through to get this to work here …
http://forums.coronalabs.com/topic/8742-new-audiosession-properties/
Stefan