2

I have a fitness app that guides users through a workout, but in order to do that, the app must remain active even while in the background. Specifically, this is crucial with our new audio release, which guides the user through their workout using audio cues that cut in and out. Currently, I'm using TriggerIO's implementation to play audio which also allows background audio, but only continues background execution until the audio file finishes. Additionally, I will soon replace that with a native plugin that includes background-music ducking.

Is there a way for me to continue running my HTML5 app in the background after an audio file finishes playing?

Thanks.

4

1 回答 1

4

没有办法让 webview 在 iOS 的后台永久运行 - 有一组有限的任务可以在后台运行:请参阅http://developer.apple.com/library/ios/#documentation/iphone /conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW20

根据您的音频播放要求的可预测性,您可能可以使用本地通知(http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html #//apple_ref/doc/uid/TP40008194),这会更简单,因为您的应用不需要请求额外的 UIBackgroundModes。

如果本地通知对您不起作用,请通过 support@trigger.io 联系:我们还没有办法让插件请求新的后台处理模式,但这绝对是我们可以添加的。

于 2013-04-22T15:14:36.173 回答