Is there a way to tell a javascript function to continue running even as a phone is locked?
Pretty much I have a timer that I need to continue to run even as the phone is set to idle.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you can. You can even run a JavaScript when the safari is in the background.
Just put a hidden frame on your site:
background.html:
The page in the hidden frame refreshes every 3 seconds, and run the JavaScript, even if the phone is locked.
Be careful because it can lead to high data traffic also if you are not on WiFi!