You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing my first mobile app using Ionic which gathers motion and gyroscope data to track movement once every 50ms. This needs to work when the user has their phone locked, hence I'm using the background mode plugin.
I'm noticing that the interval time between capturing data increases significantly when running in the background (while the phone is locked), and capturing data every 1 second rather than every 50ms.
To keep things simple, I placed a setInterval function to tick every 20ms in the constructor of a new app and to just print out Date.now(), output:
Is there anything that can be done to keep the app ticking as quickly as when it's in focus? Is this a limitation with Hybrid frameworks and would a native app be able to handle this?
Thanks
The text was updated successfully, but these errors were encountered:
To summarize, browsers throttle timers (such as setInterval) to only fire once per second when out of focus (inactive tab). The hacktimer.js library can be used to prevent this.
In order for the application to continue functioning at full speed on iOS when the user has locked their phone, the following config needs to be placed inside of config.xml:
Hi,
I'm writing my first mobile app using Ionic which gathers motion and gyroscope data to track movement once every 50ms. This needs to work when the user has their phone locked, hence I'm using the background mode plugin.
I'm noticing that the interval time between capturing data increases significantly when running in the background (while the phone is locked), and capturing data every 1 second rather than every 50ms.
To keep things simple, I placed a setInterval function to tick every 20ms in the constructor of a new app and to just print out Date.now(), output:
Is there anything that can be done to keep the app ticking as quickly as when it's in focus? Is this a limitation with Hybrid frameworks and would a native app be able to handle this?
Thanks
The text was updated successfully, but these errors were encountered: