591 audio background/resume = Fail.

Built with 591 using this in my build.settings:

UIApplicationExitsOnSuspend = "NO",  
UIBackgroundModes ={ "audio" },  

After switching to the iPod and playing a video, then returning to the app, the audio fails play again.
~~Kenn [import]uid: 13859 topic_id: 13429 reply_id: 313429[/import]

… If I do ONLY

UIApplicationExitsOnSuspend = "NO",  

… then the app does resume correctly and the audio will play. But of course it won’t play any audio in the “background”.

:wink: [import]uid: 13859 topic_id: 13429 reply_id: 49325[/import]

I’ve just tried this with my test app and it still works for me - but remember it only works on the device or iOS simulator not on the Corona simulator.

By the way I use

UIApplicationExitsOnSuspend = false,  

rather than = “NO” (don’t know if they are equivalent?)

Stefan [import]uid: 2646 topic_id: 13429 reply_id: 49431[/import]

Yeah, using it on an iPhone 3Gs… the app is also in the store with the 591 build and we got a cute little 1 star review noting the same bug. :wink:

Here’s Apple’s doc on the “UIApplicationExitsOnSuspend” info.plist setting:

UIApplicationExitsOnSuspend (Boolean - iOS) specifies that the application should be terminated rather than moved to the background when it is quit. Applications linked against iPhone SDK 4.0 or later can include this key and set its value to YES to prevent being automatically opted-in to background execution and application suspension. When the value of this key is YES, the application is terminated and purged from memory instead of moved to the background. If this key is not present, or is set to NO, the application moves to the background as usual.
~~Kenn [import]uid: 13859 topic_id: 13429 reply_id: 49515[/import]

Use:
UIApplicationExitsOnSuspend = false
Don’t use “NO”. I’m not sure what “NO” will do. (NO is a keyword in Obj-C, but build.settings is Lua and Lua uses the keyword false. The final Info.plist that gets generated should produce a boolean value with NO.)

Remember that background and resume will only work on iOS 4 or greater. If your 3G is running 3.x, your settings won’t have any affect. Also remember that Apple doesn’t promise to not kill your application while backgrounded. If your app is taking too much RAM and the next app you launch needs a lot of memory, your app may be culled.
If you want audio backgrounding, then you should be setting UIBackgroundModes as you are doing.

iphone =
{
plist =
{
UIBackgroundModes =
{
“audio”,
},
UIApplicationExitsOnSuspend = false,
},
},
},
This other thread contains more information:
http://developer.anscamobile.com/forum/2011/06/05/new-audiosession-properties

If you think you found a bug, please submit a bug report with a reproducible test case.
[import]uid: 7563 topic_id: 13429 reply_id: 49528[/import]

@ewing, note:

UIApplicationExitsOnSuspend = "NO",  

… works correctly for me and matches Apple’s own documentation.

But, since we’re at it: Can you confirm for me that you guys are actually converting “false” or “true” to NO/YES for Apple in this field?

http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html

[text]UIApplicationExitsOnSuspend

UIApplicationExitsOnSuspend (Boolean - iOS) specifies that the application should be terminated rather than moved to the background when it is quit. Applications linked against iOS SDK 4.0 or later can include this key and set its value to YES to prevent being automatically opted-in to background execution and application suspension. When the value of this key is YES, the application is terminated and purged from memory instead of moved to the background. If this key is not present, or is set to NO, the application moves to the background as usual.

This key is supported in iOS 4.0 and later.
[/text]
I was under the impression we were to use Apple related values when entering that type of info into our build.settings.

As for a bug report: This as close to a bug report as I get.

http://itunes.apple.com/us/app/dramatic-music-app/id417696249?mt=8
[text]Customer Reviews
Fun for a minute then…cricket, cricket…no sound

by JoeJoe:(
Had fun with this for about 10 minutes, just long enough for me to purchase the .99 cent version. And then silence… No sound! I hope there are some fixes coming!
[/text]

My fix is coming… by removing the “audio” background specific processing.
Past that, if noone cares, that’s fine by me. :wink: Dropping audio solved my problem. It probably won’t solve the problem of others who actually need to keep sound playing when the app backgrounds… they can waste their own time on a “formal” bug report.

Best,
~~Kenn [import]uid: 13859 topic_id: 13429 reply_id: 49539[/import]

We have to translate build.settings to an Info.plist. It is actually a non-trivial process in the general case. We do convert Lua true/false to native plist booleans which should be represented as

or

in the actual plist file if you open it up in a raw text editor.

My concern is that “NO” might be converted as a string type instead instead of a boolean type and misinterpreted by the OS.

As for audio, there are a bunch more rules. Basic audio backgrounding works for us, so if you aren’t able to produce that, we can’t really help you any further without a reproducible test case.

If you are running iOS applications that disallow sound mixing, they will stop your Corona app from playing music.

Corona backgrounding is still limited. We suspend the Corona core to not violate other Apple rules and waste resources. But the audio completion callback notification system is tied to the Corona core, so you cannot currently get callbacks. We also have not yet tied in remote control (double tap menu) access either.

[import]uid: 7563 topic_id: 13429 reply_id: 49622[/import]

hi,
i have my – build.settings like this

settings =
{
orientation =
{
default = “landscapeRight”,
},

iphone =
{
plist=
{
UIHiddenStatusBar= true,
UIApplicationExitsOnStandby = true,
CFBundleIconFile = “Icon.png”,
CFBundleIconFiles = {
“Icon.png”,
“Icon@2x.png”,
“Icon-72.png”,
},
},
},
}

still my app failed to resume after home button pressed.
is this coz i use trial version of corona.
or anything else i am missing?? [import]uid: 42171 topic_id: 13429 reply_id: 57239[/import]