jeudi 15 janvier 2015

Cordova Media Plugin with iOS - Background Audio - App rejection

I had to build a Cordova app that plays sounds and has audio content between 5 and 20 minutes of length. To play the audio, I use the Media plugin. The audio plays fine, and that is not the problem. I use the media plugin to play the content because <audio> has issues on Android.


Anyway, the App has been rejected twice by Apple now, both times with the same reason:



2.16: Multitasking Apps may only use background services for their intended purposes:
VoIP, audio playback, location, task completion, local notifications, etc.


I use the audio background mode, because there is sound in the background - when the audio content plays, it continues in the background (i.e., App closing, Lock Screen, etc). It works when I test it. The audio content plays. Yet the reason said by Apple is "There is no background audio."


As said above, I use the media plugin. The media plugin sets the audio session, see here. I also followed this guide as well, added the code there.


I am not an iOS programmer. This is my very first iOS and Cordova App I ever wrote. But my boss is quite angry by now and blames me for the rejections. I also don't have access to an XCode or an iOS device all the time.


By now, I have no idea what to do. Perhaps someone more seasoned with iOS can help me here.


1 commentaire: