5

I want to build an Ionic app that can still use accelerometer data while the app is minimized (runs in the background).

I have tried using:

The first two work in the foreground but won't work while the app is in the background (the accelerometer readings are paused and are resumed while on the foreground again). The Generic Sensor API won't work at all, even if I use this polyfill: https://github.com/kenchris/sensor-polyfills

I have also tried the Ionic Background Mode plugin, however, the accelerometer reading are still being paused in background. https://ionicframework.com/docs/native/background-mode

How can an Ionic app use the accelerometer while in background? Any plugin that I am not aware of its existence (e.g., the Ionic Background Geolocation lets the app receive locations while in background)? Any other way?

treecon
  • 2,415
  • 2
  • 14
  • 28
  • This is over 4 years ago, but I'm wondering, did you ever find a solution to this? – Miguel Stevens Jun 19 '23 at 06:00
  • Well, at that time, we came to a conclusion that this is not possible due to Android limitations. I don't know if something has changed since then. – treecon Jun 19 '23 at 09:45

0 Answers0