菜鸟教程小白 发表于 2022-12-13 02:24:24

ios - 在屏幕锁定的情况下运行 TriggerIO iOS 应用程序?


                                            <p><p>我有一个指导用户完成锻炼的健身应用,但为了做到这一点,该应用即使在后台也必须保持活跃。具体来说,这对于我们的新音频版本至关重要,它使用切入和切出的音频提示引导用户完成锻炼。目前,我正在使用 <a href="http://docs.trigger.io/en/v1.4/modules/media.html#createaudioplayer" rel="noreferrer noopener nofollow">TriggerIO&#39;s implementation to play audio</a>这也是 <a href="http://docs.trigger.io/en/v1.4/modules/media.html#config" rel="noreferrer noopener nofollow">allows background audio</a> ,但只会继续后台执行,直到音频文件完成。此外,我很快将用 <a href="http://docs.trigger.io/en/v1.4/modules/native/index.html" rel="noreferrer noopener nofollow">native plugin</a> 替换它。包括背景音乐闪避。</p>

<p>有没有办法让我在音频文件播放完毕后继续在后台运行我的 HTML5 应用程序?</p>

<p>谢谢。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>没有办法让 webview 在 iOS 上永久在后台运行 - 允许在后台运行的任务集是有限的:参见 <a href="http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW20" rel="noreferrer noopener nofollow">http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW20</a> </p>

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

<p>如果本地通知对您不起作用,请通过 [email protected] 与我们联系:我们还没有办法让插件请求新的后台处理模式,但这绝对是我们可以添加的。 </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 在屏幕锁定的情况下运行 TriggerIO iOS 应用程序?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/16136873/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/16136873/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 在屏幕锁定的情况下运行 TriggerIO iOS 应用程序?