Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

6. Mobile Device Hardware Additions > Background Audio Playback Support on iOS ...

Background Audio Playback Support on iOS (Mobile)

With AIR 3, we are now able to inform iOS whether or not application audio should continue playing while the application is not in focus. We do this through manipulation of the AIR application descriptor file.

Locate the iPhone node within your descriptor file and within the InfoAdditions node, insert a new <key> with a value of “UIBackgroundModes”. Directly underneath this <key>, provide an <array> node with a <string> node nested within it. The value of this <string> node will be “audio”.

That’s all there is to it. Now compile to iOS as normal.

    <!-- iOS specific capabilities -->
    <iPhone>
        <InfoAdditions>
            <![CDATA[

                <key>UIDeviceFamily</key>
                <array>
                    <string>1</string>
                    <string>2</string>
                </array>

                <key>UIStatusBarStyle</key>
                <string>UIStatusBarStyleBlackOpaque</string>

                <key>UIRequiresPersistentWiFi</key>
                <string>YES</string>

                <key>UIBackgroundModes</key>
                <array>
                    <string>audio</string>
                </array>

            ]]>
        </InfoAdditions>
        <requestedDisplayResolution>high</requestedDisplayResolution>
    </iPhone>

  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial