'BLE background scanning stops after working for more than an hour

An Ionic app that scans for BLE tags while running in the background.

The problem is that the app stops scanning for BLE devices after running for more than an hour.

I would like the app to run for a long time without being killed.

Also if the phone has a lock screen password the app stops scanning for BLE devices sooner than when the phone doesn't have a lock screen password



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source