Reading accelerometer data while the app is running in background

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:

I have also tried the Ionic Background Mode plugin, however, the accelerometer reading are still being paused in background.

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?