Search code examples
audiowidgetios8ios-app-extension

Today Extension and background audio


I am trying to do a simple podcast-like widget for iOS 8. Things works fine, audio works... except that when the screen sleep, the audio stops.

Can Today Extension do background audio? Or multitasking in general?


Solution

  • No. Today Widget is destroyed when it goes out of view (as evidenced by viewDidDisappear).. so sound can only be enabled when the widget is physically in view.

    Edit: Nope it is linked to the host app that runs it. As detailed in Apple documentation, an extension is a specialized binary that is delivered through a containing app. The containing app is only used for delivery and the extension runs independently of it. This notwithstanding, an iOS containing app is required to effectively provide some functionality in addition to the extension. On OS X such requirement is relaxed and a containing app is not required to provide any additional functionality.

    As mentioned, an extension life cycle is completely unrelated to its containing app's and it comprises 4 steps:

    User chooses an app extension. System launches it. App extension runs. System kills app extension.

    http://www.infoq.com/news/2014/07/apple-ios8-app-extensions