For Android, you can use Essentials: Accelerometer in the Service, due to the background service limitation in android 8.0 or later. You can try to create a Foreground Service, then run Essentials: Accelerometer in foreground service.
Foreground service will push a notification in the foreground, it will keep your application running in the background, your application will not be killed or hang easily.
For iOS, you can register your application to run in the Background, please notice: your application should fall into approved categories.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.