Wake lock / Keep screen on

Is there a way (plugin?) to implement “wake lock” features to keep a mobile screen from going to sleep?
Use case example: Fitness app that displays an exercise and timer, updating these with the “do every X seconds…” workflow.

Ideally this would be iOS and Android compatible, although I believe the “Wake Lock API” is currently Android only.

1 Like

I haven’t seen this done successfully, I have a feeling (having worked on iOS apps) that the only way to achieve this would be through writing this as a function in Xcode and making use of native Swift tools. I don’t think this can be achieved through a web app, but if you wrap your Bubble app (maybe using Zeroqode’s service) you can then add native functions in Xcode to achieve it.

Apple are rightfully quite stringent in their security and device level policies like that.

1 Like

There is a JS library that has that feature:
https://richtr.github.io/NoSleep.js/example

Works like a charm.

3 Likes

Awesome - thanks for sharing. Wonder if anyone can make it to a plugin?

Looks like @jared.gibb has done just that (Thank you!)

1 Like

Just waiting on bubble approval. I feel like I may be requested to change the icon :joy: but hopefully not.

It’s live!

1 Like