1 Reply Latest reply on Jul 5, 2012 7:58 AM by Cabana Criação

    Does UIBackgroundModes actually work for iOS?

    Rodster002

      Hello,

       

      I have an iOS app which plays music, but when the app is suspended, it stops. I would like it to behave like iTunes (so you can put the device to sleep or background the app and it still plays). I found this bit of code, but it doesn't seem to do the trick.

       

      This is what I have in my Main-app.xml

      <iPhone>

      <InfoAdditions>

        <![CDATA[

             <key>UIDeviceFamily</key>

             <array>

                <string>1</string>

                <string>2</string>

             </array>

                   <key>UIBackgroundModes</key>

                   <array>

                 <string>audio</string>

                   </array>

        ]]>

      </InfoAdditions>

      <requestedDisplayResolution>high</requestedDisplayResolution>

      </iPhone>

       

      Has anyone actually had any luck with this?

      Thanks!

        • 1. Re: Does UIBackgroundModes actually work for iOS?
          Cabana Criação

          It worked for me with Air 3.3

          I have also put this in my code:

          try {

                                                            NativeApplication.nativeApplication.executeInBackground = true;

                                                  } catch (e:Error) {

            trace("Não rolou o background activity: " + e);

                                                  }