Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
163
rated 0 times [  167] [ 4]  / answers: 1 / hits: 9711  / 10 Years ago, thu, july 17, 2014, 12:00:00

Is it possible to keep a html 5 web pages WebSocket connection open in Mobile-Safari once the screen is locked?



I want to send my users continuous updates throughout the day and it seems silly that their screens should always have to be unlocked to receive those notifications.



Are there any other options?


More From » ios

 Answers
2

I have found a hacky way to keep WebSocket alive in Mobile Safari.



Basically it's the same solution as for this question.



Create an infinity looping audio file to keep Javascript running:



<audio loop src=http://www.sousound.com/music/healing/healing_01.mp3></audio>


Note: some user interaction is required to initiate the audio file.



It would be nice if a WebSocket kept the browser alive in the same manner as an audio or video file.



PS this also works on Android.


[#43819] Wednesday, July 16, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
masonm

Total Points: 167
Total Questions: 87
Total Answers: 103

Location: Rwanda
Member since Wed, Jun 8, 2022
2 Years ago
masonm questions
;