Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12576] iOS: Background mode "audio" does not work with SDK 3.0.0.GA

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2013-02-05T00:48:06.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 03 API, 2013 Sprint 03
ComponentsiOS
Labelsregression
ReporterMichael Descher
AssigneeDaniel Sefton
Created2013-01-26T20:26:53.000+0000
Updated2013-03-13T14:56:45.000+0000

Description

*Problem description* iOS Background Mode "audio" is not correctly converted to the Info.plist file with SDK 3.0.0.GA. *tiapp.xml*
<iphone>
    <backgroundModes>
        <mode>audio</mode>
    </backgroundModes>
</iphone>
*Workaround* 1. Set for Ti.SDK 3.0.0 2. Compile the app to go on the device 3. DO NOT TRANSFER it 4. In the folder {appfolder}/build/iphone find the file info.plist 5. Copy this file into {appfolder}/ 6. Edit this file; and add the key above (exactly as it is shown) 7. Compile again for the device 8. Put it on the device now 9. Test it - should work.

Comments

  1. David Fischetti 2013-02-04

    Also having this same problem. Worked fine with previous SDK but receiving multiple reports from users that background audio no longer works. My info.plist in the root of my project has what I believe to be the proper code to enable background audio. Glad to help debug and try and solve this within my project. Thanks
  2. David Fischetti 2013-02-04

    Forgot to mention that I did try the workaround but it does not seem to work. The discussion actually references the proper code or "key" mentioned in step 6. This bug report only mentions the tiapp.xml code to include.
  3. Sabil Rahim 2013-02-05

    @Micheal Descher The correct way to specify background modes in iOS is like this:
         <ios>
               <plist>
                   <dict>
                       <key>UIBackgroundModes</key>
                       <array>
                           <string>audio</string>
                           <string>location</string>
                           <string>voip</string>
                           <string>newsstand-content</string>
                           <string>external-accessory</string>
                           <string>bluetooth-central</string>
                       </array>
                   </dict>
               </plist>
           </ios>
       
    I have tested and verified that these backgroundmnodes are copied over into the info.plist correctly in 3.0.0.GA and in the latest master. For more information, please follow our docs : http://docs.appcelerator.com/titanium/latest/#!/guide/tiapp.xml_and_timodule.xml_Reference (UIBackgroundModes Section) Marking ticket as invalid.
  4. David Fischetti 2013-02-05

    Hmmm... I do in fact have the correct code listed above in my info.plist file. UIBackgroundModes audio This worked fine in Ti API 1.7.5 but in Ti API 3.0.0 it fails to play in the background. My app hasn't changed since that version so has something else changed since 1.7.5 that could have caused this to not work? thanks
  5. Sabil Rahim 2013-02-05

    @David Fischetti, by iOS i ment iOS for Titanium (inside tiapp.xml). We actually standardized the way to include keys into info.plist through tiapp.xml around the 2.0 release period. Sorry for the confusion.
  6. David Fischetti 2013-02-05

    @sabil. Thanks for the reply and clarification. I've tried this a few times with no luck unfortunately. (and I do apologize for posting here as I don't want to treat it like a forum. I just think there's either a bug or some documentation missing somewhere.) Here's a snippet of my tiapp.xml Ti.UI.PORTRAIT Ti.UI.PORTRAIT Ti.UI.UPSIDE_PORTRAIT Ti.UI.LANDSCAPE_LEFT Ti.UI.LANDSCAPE_RIGHT UIBackgroundModes audio and i've deleted the info.plist from my {appfolder} and deleted the contents in my build folder and rebuilt the project. I then copied the info.plist in that build folder into {appfolder}. Looking at that code I do see UIBackgroundModes audio So there's not much more to do than that I believe. The audio I'm playing is opening a mp3 file from within a webview. So there's no setting there. I just plays in a native quicktime window within my app. Any help is appreciated. Thanks
  7. David Fischetti 2013-02-12

    Hi Sabil. I'm still not able to get this working? Do you see anything wrong with above. i've tried various different things but still not having any luck. any help is appreciated.
  8. Sabil Rahim 2013-02-12

    @David Fishetti could you give me snippet of the code that you are trying to run, so that i can have a better perspective at what you are trying to do before i make any suggestions. Thanks Sabil
  9. David Fischetti 2013-02-12

    Hey Sabil. I really appreciate the reply. I just updated to the latest Xcode (I think I missed the latest update). After doing that it seemed to start working. Not sure what happened there but perhaps there was some oddity causing it to break. Regardless. It IS working now. Thanks again, Dave
  10. Shyam Bhadauria 2013-02-22

    Closing it as per the comments as well as its working fine with 3.0.0.GA

JSON Source