问题描述
我正在玩渐进式网络应用程序,我想尝试构建的一个场景是闹钟应用程序.
I am playing around with progressive web apps, and one scenario I wanted to try building was an alarm clock app.
我认为要使这个应用程序正常工作,它必须在后台运行并在满足内部条件(当前时间 === 警报时间)后变为活动状态.
I figure to make this app work properly, it will have to run in the background and become active once the internal conditions (current time === alarm time) have been met.
这可能吗?或者,渐进式网络应用程序还没有通过 API 在后台运行/访问手机功能的自由.
Is this possible? Or do progressive web apps not yet have the freedom to operate in the background/access phone features through API's.
谢谢!
推荐答案
尚无法设置后台计时器.ScheduledTask API 可能是你想要的,但它仍在讨论、实施和以此类推.
Setting background timers isn't yet possible. The ScheduledTask API is probably do what you want, but it's still being discussed, implemented and so on.
这篇关于渐进式 Web 应用程序中的后台事件?(构建闹钟应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!