Hajk icon indicating copy to clipboard operation
Hajk copied to clipboard

Mobile user - "Always on" feature

Open JakubPelka opened this issue 2 years ago • 5 comments

Problem: Now if you are doing some work fieldwork mobile is usually turning off the screen by default. So while it is cold, raining or you have dirty hands it is not so great to unlock screen every few seconds / minutes etc.

Need: Make it possible to activate override in mobile that (by the switch) will make it possible to make function "Screen always on" active.

Solution: I know it is doable in some apps - like while navigating with GMaps it will not turn itself off after every 30sec. But how is it done - have no idea.

JakubPelka avatar Mar 15 '22 08:03 JakubPelka

After a quick investigation: 1. Probably possible in Chrome on Android using the wakelock api. iOS Safari does not seem to have implemented this (yet). Reference: https://caniuse.com/wake-lock

Someone has solved the issue in Safari iOS with a hack... playing a hidden inline video that forces the screen to stay awake... https://github.com/richtr/NoSleep.js

Another approach would be to provide a native Hajk wrapper-app for both Android and iOS to be able to use system specific functionality.

jesade-vbg avatar Mar 24 '22 08:03 jesade-vbg

Update: Wake lock is now implemented in Safari, but it does not work in PWA (bug) which isnt good. Still broken in iOS 17.3. https://bugs.webkit.org/show_bug.cgi?id=254545

jesade-vbg avatar Jan 29 '24 06:01 jesade-vbg

Good investigation @jesade-vbg. Weird that it's enabled for a website but stops working once user adds this to the Home Screen as a PWA. I would have more understanding for this if it was the other way around…

jacobwod avatar Jan 29 '24 07:01 jacobwod

Update: Wake lock api is now availiable (May 2024) in the latest Chrome+Firefox on android etc. Still not working in PWA in iOS. https://caniuse.com/wake-lock

jesade-vbg avatar Jun 04 '24 08:06 jesade-vbg

Perhaps worth implementing anyway? I haven't really heard users complain about the screen turning off when it shouldn't, but I can imagine that if someone uses Hajk for navigational purposes it can be annoying.

jacobwod avatar Jun 05 '24 08:06 jacobwod