App Rejected by iTunes Because of UIBackgroundModes

I am using sounds in an app and I thought I was doing it right but the app was rejected by Apple because:

We noticed your app declares support for audio in the UIBackgroundModes key in your Info.plist, but no audible content is played when the application is in the background. While your intention may have been to provide this functionality, at the time of review, we were not able to play background audio for your app.

The code I am using is in a quiz game:

[lua]sound_to_play = math.random(1,#correct_sounds)
play_sound = audio.loadSound(correct_sounds[sound_to_play].sound)
correct_play = audio.play( play_sound )[/lua]

Should I not be using audio.loadSound for small files? [import]uid: 112036 topic_id: 22750 reply_id: 322750[/import]

I use audio.loadSound and audio.play for even sounds that are a fraction of a second long, as well as my looping game music.

From what their message sounds like, it seems like they are expecting audio to play even when you close the app, like your music player.

Maybe the issue is in your build.settings file [import]uid: 31262 topic_id: 22750 reply_id: 90784[/import]

Yeah, I thought that too but my build settings are very generic and do not have anything related to sound in them. The sounds are all about 2 seconds in length. Maybe I need to unload them when the app is minimized? [import]uid: 112036 topic_id: 22750 reply_id: 90785[/import]

Your problem is you set UIBackgroundModes jn your build.settings (for audio) and you don’t know what it means or does. You had to have blindly copied and pasted that from somewhere. Simply remove it and resubmit your app.

[import]uid: 7563 topic_id: 22750 reply_id: 90791[/import]

Are you able to post your build.settings?

Edit: Oops Ewing figured it out 2 steps quicker [import]uid: 31262 topic_id: 22750 reply_id: 90792[/import]

Edited: Is it because I am using plist incorrectly? I didn’t notice that it was even in my build settings. I don’t know where I got this code:

settings = { iphone = { plist = { CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-72.png", }, }, } } [import]uid: 112036 topic_id: 22750 reply_id: 90885[/import]

That looks like a pretty typical build.settings you would get from the sample code. That one is alright. Your problem is that there must be a UIBackgroundModes table somewhere in the plist table. I don’t think that is the same build.settings you used to build/ship your app.

[import]uid: 7563 topic_id: 22750 reply_id: 90891[/import]

That is the same file. I have not edited it since I submitted it and there is no other build.settings file in the folder. Beyond that, I have 12 apps approved by apple that all use this same file. This is the first app I have ever had rejected so it’s a mystery. [import]uid: 112036 topic_id: 22750 reply_id: 90895[/import]

Can you open the .app bundle of the app you submitted and inspect the Info.plist for the UIBackgroundModes key and verify it is there. Maybe Apple made a mistake. If it is there, rebuild a new app with Corona and see if the UIBackgroundModes key appears in the Info.plist. Corona should not be setting that key unless you explicitly added it yourself to build.settings. (It’s a pretty esoteric key.)

[import]uid: 7563 topic_id: 22750 reply_id: 90898[/import]