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.
Is this possible? Or do progressive web apps not yet have the freedom to operate in the background/access phone features through API's.
Thanks!
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.
来源:https://stackoverflow.com/questions/36944167/background-events-in-progressive-web-apps-building-an-alarm-clock-app