I'm creating a live audio streaming app using titanium studio (version 3.1.1). I need to enable background audio playback for iphone. Currently background audio works in android emulator but not in iphone sinulator (when I click the home button, audio fades away and stop). I created the audioplayer and set the audioSessionMode.
Ti.App.player = Ti.Media.createAudioPlayer({
url :'http://broadcast.infomaniak.net/radionova-high.mp3',
allowBackground :true
});
Titanium.Media.audioSessionMode = Ti.Media.AUDIO_SESSION_MODE_PLAYBACK;
When I add and save the following lines to Info.plist file and run the project, the file reloads and remove these lines. How do I correctly edit this file? or is there another way to get background audio in iphone?
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>