Looks impossible for an iOS Air App to play audio in standby!?
Hi there!
I have started this thread first in here:
http://forums.adobe.com/message/6095789
It appears so far (Air 4.0.0.1240) it is not yet possible for an Air Application to keep playing Audio files in background when iOS device enters STANDBY (pressing power button).
As far as I know, what an Air application CAN DO in this case is that:
1- you include this code in the Main class/Timeline of your Flash app:
import flash.desktop.NativeApplication;
NativeApplication.nativeApplication.executeInBackground = true;
2- add this code to the XML file:
...
<iPhone>
<InfoAdditions>
<![CDATA[
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
<key>UIDeviceFamily</key>
<array>
<string>1</string>
<string>2</string>
</array>
]]>
</InfoAdditions>
</iPhone>
...
Now your App has the ability of keep playing Audio files in Background (when iOS App is minimized, by pressing the HOME button).
BUT as soon as the device enters standby mode (i.e by pressing the POWER button) Audio playback Pauses/Stops!
So why is this feature needed?! well there are LOTS of "Audio player Apps" available (written in JAVA) they do continue playing the Audio in standby.
Imagine your App users need to listen to a long streaming audio file (such as an speech, mp3 etc.). what should they do??
you CAN prevent their device from going to Standby and let them listen the whole thing, But the question is whether they like to spend their whole battery on your App or not?!!?
I suppose the key to solve this iissue is by finding a method to activate/use iOS "AVAudioSessionCategoryPlayback" class. is that possible already?!
Thanks a lot for your time and I highly hope someone out there tell me Hey! you are wrong! here is the solution...
Kind Regards,
Ali
Technical details))
Adobe Flash Pro cs6
Air 4.0.0.1240 for ios
tested on Ipad 2/IPhone 5 (iOS 7)
tested with All cpu render mdes(Direct,GPU,CPU)
